Skip to content

Commit

Permalink
encoding.binary: fix u32 little endian comments (#20256)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimshrier committed Dec 23, 2023
1 parent 1b6d681 commit c7ce72f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/encoding/binary/little_endian.v
Expand Up @@ -78,7 +78,7 @@ pub fn little_endian_put_u32(mut b []u8, v u32) {
b[3] = u8(v >> u32(24))
}

// little_endian_put_u32_at writes a u32 to the two bytes in the array b at the specified offset in little endian order.
// little_endian_put_u32_at writes a u32 to the four bytes in the array b at the specified offset in little endian order.
@[direct_array_access; inline]
pub fn little_endian_put_u32_at(mut b []u8, v u32, o int) {
_ = b[o] // bounds check
Expand All @@ -89,7 +89,7 @@ pub fn little_endian_put_u32_at(mut b []u8, v u32, o int) {
b[o + 3] = u8(v >> u32(24))
}

// little_endian_put_u32_end writes a u32 to the last two bytes in the array b in little endian order.
// little_endian_put_u32_end writes a u32 to the last four bytes in the array b in little endian order.
@[direct_array_access; inline]
pub fn little_endian_put_u32_end(mut b []u8, v u32) {
little_endian_put_u32_at(mut b, v, b.len - 4)
Expand Down

0 comments on commit c7ce72f

Please sign in to comment.