Skip to content

vlib: change byte types to u8 types - #19930

Merged
medvednikov merged 1 commit into
vlang:masterfrom
kimshrier:fix_byte_deprications
Nov 19, 2023
Merged

medvednikov merged 1 commit into
vlang:masterfrom
kimshrier:fix_byte_deprications

Conversation

@kimshrier

@kimshrier kimshrier commented Nov 19, 2023 •

Copy link
Copy Markdown
Contributor

I went looking through the files under vlib to see if any of them still used the byte type and replaced likely candidates with u8. I don't think I was too aggressive considering that the byte type still works but I thought it would be a good idea to go ahead and change these cases.

πŸ€–[deprecated] Generated by Copilot at ac46001

This pull request replaces the use of byte and &byte types with u8 and &u8 types in various modules and tests, following the recent renaming of the byte alias to u8 in the V language. This improves consistency, clarity, and compatibility across the codebase.

πŸ€–[deprecated] Generated by Copilot at ac46001

  • Change the return type and parameters of various functions and structs from &byte or []byte to &u8 or []u8 to comply with the new aliasing rules in V (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Move the linuxsys_bare.v file to memory_managment.v and update the functions in it (link, link)
  • Remove the byte type name from the tests and use u8 instead (link, link, link, link, link, link, link)
  • Update the string struct and the tos, tos2, and i64_tos functions in string_bare.v (link, link, link, link)
  • Update the wyhash function in map.c.v (link)
  • Update the vsprintf, vsnprintf, bare_read, bare_print, bare_eprint, and write functions in wasm_bare/libc_impl.c.v (link, link)
  • Update the arc4random_buf function in rand_freebsd.c.v and rand_openbsd.c.v (link, link)
  • Update the getrandom function in rand_solaris.c.v (link)
  • Update the strip_newlines function in base32.v (link)
  • Update the stbi_write_hdr function in stbi.c.v (link, link)
  • Update the test_assign_array_of_aliases function in checker/assign.v (link)
  • Update the get_bytes_array and test_aliased_array_method_call functions in tests/aliased_array_method_call_test.v (link, link)
  • Update the test_assign_array_of_aliases function in tests/assign_array_of_aliases_test.v (link)
  • Remove the check_init_value_for_arrays_of_option[byte]() line from the test_check_init_value_for_arrays_of_option function in tests/check_init_value_for_arrays_of_option_test.v (link)
  • Update the UUID type and the codec_test_uuid constant in tests/const_from_bytes_test.v (link)
  • Update the f1 and f2 functions in tests/fn_call_mut_array_of_aliases_args_test.v (link)
  • Update the test_fn_with_array_of_aliases_argument function in tests/fn_with_array_of_aliases_argument_test.v (link)
  • Remove the assert typeof(byte(1)).name == 'byte' line from the test_typeof_simple_types function in tests/typeof_simple_types_test.v (link)

@medvednikov
medvednikov merged commit cc220e6 into vlang:master Nov 19, 2023
@medvednikov

Copy link
Copy Markdown
Member

Thanks! :)

@kimshrier
kimshrier deleted the fix_byte_deprications branch December 9, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants