Skip to content

Commit

Permalink
pixconv: fix -Werror=sign-conversion
Browse files Browse the repository at this point in the history
Updates #138
  • Loading branch information
nigeltao committed Dec 15, 2023
1 parent d40b7fb commit b4e0969
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
26 changes: 13 additions & 13 deletions internal/cgen/base/pixconv-submodule-regular.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,9 +1036,9 @@ wuffs_private_impl__swizzle_bgr_565__bgr(uint8_t* dst_ptr,
// TODO: unroll.

while (n >= 1) {
uint32_t b5 = s[0] >> 3;
uint32_t g6 = s[1] >> 2;
uint32_t r5 = s[2] >> 3;
uint32_t b5 = (uint32_t)(s[0] >> 3);
uint32_t g6 = (uint32_t)(s[1] >> 2);
uint32_t r5 = (uint32_t)(s[2] >> 3);
uint32_t rgb_565 = (r5 << 11) | (g6 << 5) | (b5 << 0);
wuffs_base__poke_u16le__no_bounds_check(d + (0 * 2), (uint16_t)rgb_565);

Expand Down Expand Up @@ -1067,9 +1067,9 @@ wuffs_private_impl__swizzle_bgr_565__bgrx(uint8_t* dst_ptr,
// TODO: unroll.

while (n >= 1) {
uint32_t b5 = s[0] >> 3;
uint32_t g6 = s[1] >> 2;
uint32_t r5 = s[2] >> 3;
uint32_t b5 = (uint32_t)(s[0] >> 3);
uint32_t g6 = (uint32_t)(s[1] >> 2);
uint32_t r5 = (uint32_t)(s[2] >> 3);
uint32_t rgb_565 = (r5 << 11) | (g6 << 5) | (b5 << 0);
wuffs_base__poke_u16le__no_bounds_check(d + (0 * 2), (uint16_t)rgb_565);

Expand Down Expand Up @@ -1359,9 +1359,9 @@ wuffs_private_impl__swizzle_bgr_565__rgb(uint8_t* dst_ptr,
// TODO: unroll.

while (n >= 1) {
uint32_t r5 = s[0] >> 3;
uint32_t g6 = s[1] >> 2;
uint32_t b5 = s[2] >> 3;
uint32_t r5 = (uint32_t)(s[0] >> 3);
uint32_t g6 = (uint32_t)(s[1] >> 2);
uint32_t b5 = (uint32_t)(s[2] >> 3);
uint32_t rgb_565 = (r5 << 11) | (g6 << 5) | (b5 << 0);
wuffs_base__poke_u16le__no_bounds_check(d + (0 * 2), (uint16_t)rgb_565);

Expand Down Expand Up @@ -1565,8 +1565,8 @@ wuffs_private_impl__swizzle_bgr_565__y(uint8_t* dst_ptr,
// TODO: unroll.

while (n >= 1) {
uint32_t y5 = s[0] >> 3;
uint32_t y6 = s[0] >> 2;
uint32_t y5 = (uint32_t)(s[0] >> 3);
uint32_t y6 = (uint32_t)(s[0] >> 2);
uint32_t rgb_565 = (y5 << 11) | (y6 << 5) | (y5 << 0);
wuffs_base__poke_u16le__no_bounds_check(d + (0 * 2), (uint16_t)rgb_565);

Expand Down Expand Up @@ -1595,8 +1595,8 @@ wuffs_private_impl__swizzle_bgr_565__y_16be(uint8_t* dst_ptr,
// TODO: unroll.

while (n >= 1) {
uint32_t y5 = s[0] >> 3;
uint32_t y6 = s[0] >> 2;
uint32_t y5 = (uint32_t)(s[0] >> 3);
uint32_t y6 = (uint32_t)(s[0] >> 2);
uint32_t rgb_565 = (y5 << 11) | (y6 << 5) | (y5 << 0);
wuffs_base__poke_u16le__no_bounds_check(d + (0 * 2), (uint16_t)rgb_565);

Expand Down
26 changes: 13 additions & 13 deletions release/c/wuffs-unsupported-snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -21588,9 +21588,9 @@ wuffs_private_impl__swizzle_bgr_565__bgr(uint8_t* dst_ptr,
// TODO: unroll.

while (n >= 1) {
uint32_t b5 = s[0] >> 3;
uint32_t g6 = s[1] >> 2;
uint32_t r5 = s[2] >> 3;
uint32_t b5 = (uint32_t)(s[0] >> 3);
uint32_t g6 = (uint32_t)(s[1] >> 2);
uint32_t r5 = (uint32_t)(s[2] >> 3);
uint32_t rgb_565 = (r5 << 11) | (g6 << 5) | (b5 << 0);
wuffs_base__poke_u16le__no_bounds_check(d + (0 * 2), (uint16_t)rgb_565);

Expand Down Expand Up @@ -21619,9 +21619,9 @@ wuffs_private_impl__swizzle_bgr_565__bgrx(uint8_t* dst_ptr,
// TODO: unroll.

while (n >= 1) {
uint32_t b5 = s[0] >> 3;
uint32_t g6 = s[1] >> 2;
uint32_t r5 = s[2] >> 3;
uint32_t b5 = (uint32_t)(s[0] >> 3);
uint32_t g6 = (uint32_t)(s[1] >> 2);
uint32_t r5 = (uint32_t)(s[2] >> 3);
uint32_t rgb_565 = (r5 << 11) | (g6 << 5) | (b5 << 0);
wuffs_base__poke_u16le__no_bounds_check(d + (0 * 2), (uint16_t)rgb_565);

Expand Down Expand Up @@ -21911,9 +21911,9 @@ wuffs_private_impl__swizzle_bgr_565__rgb(uint8_t* dst_ptr,
// TODO: unroll.

while (n >= 1) {
uint32_t r5 = s[0] >> 3;
uint32_t g6 = s[1] >> 2;
uint32_t b5 = s[2] >> 3;
uint32_t r5 = (uint32_t)(s[0] >> 3);
uint32_t g6 = (uint32_t)(s[1] >> 2);
uint32_t b5 = (uint32_t)(s[2] >> 3);
uint32_t rgb_565 = (r5 << 11) | (g6 << 5) | (b5 << 0);
wuffs_base__poke_u16le__no_bounds_check(d + (0 * 2), (uint16_t)rgb_565);

Expand Down Expand Up @@ -22117,8 +22117,8 @@ wuffs_private_impl__swizzle_bgr_565__y(uint8_t* dst_ptr,
// TODO: unroll.

while (n >= 1) {
uint32_t y5 = s[0] >> 3;
uint32_t y6 = s[0] >> 2;
uint32_t y5 = (uint32_t)(s[0] >> 3);
uint32_t y6 = (uint32_t)(s[0] >> 2);
uint32_t rgb_565 = (y5 << 11) | (y6 << 5) | (y5 << 0);
wuffs_base__poke_u16le__no_bounds_check(d + (0 * 2), (uint16_t)rgb_565);

Expand Down Expand Up @@ -22147,8 +22147,8 @@ wuffs_private_impl__swizzle_bgr_565__y_16be(uint8_t* dst_ptr,
// TODO: unroll.

while (n >= 1) {
uint32_t y5 = s[0] >> 3;
uint32_t y6 = s[0] >> 2;
uint32_t y5 = (uint32_t)(s[0] >> 3);
uint32_t y6 = (uint32_t)(s[0] >> 2);
uint32_t rgb_565 = (y5 << 11) | (y6 << 5) | (y5 << 0);
wuffs_base__poke_u16le__no_bounds_check(d + (0 * 2), (uint16_t)rgb_565);

Expand Down

0 comments on commit b4e0969

Please sign in to comment.