From 76612ac031ee31c7d6e9b62325d279117e1ee182 Mon Sep 17 00:00:00 2001 From: jsteube Date: Thu, 14 Jan 2016 20:54:41 +0100 Subject: [PATCH] Fix more missing casts to uint in rule-engine --- OpenCL/rp.c | 16 ++++++++-------- src/rp_kernel_on_cpu.c | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/OpenCL/rp.c b/OpenCL/rp.c index ad31581..741de40 100644 --- a/OpenCL/rp.c +++ b/OpenCL/rp.c @@ -2008,7 +2008,7 @@ static u32 rule_op_mangle_toggle_at (const u32 p0, const u32 p1, u32 buf0[4], u3 { if (p0 >= in_len) return (in_len); - const u32 tmp = 0x20 << ((p0 & 3) * 8); + const u32 tmp = 0x20u << ((p0 & 3) * 8); switch (p0 / 4) { @@ -2477,7 +2477,7 @@ static u32 rule_op_mangle_overstrike (const u32 p0, const u32 p1, u32 buf0[4], u const u32 p1n = p1 << ((p0 & 3) * 8); - const u32 m = ~(0xff << ((p0 & 3) * 8)); + const u32 m = ~(0xffu << ((p0 & 3) * 8)); switch (p0 / 4) { @@ -3734,7 +3734,7 @@ static u32 rule_op_mangle_chr_shiftl (const u32 p0, const u32 p1, u32 buf0[4], u { if (p0 >= in_len) return (in_len); - const u32 mr = 0xff << ((p0 & 3) * 8); + const u32 mr = 0xffu << ((p0 & 3) * 8); const u32 ml = ~mr; switch (p0 / 4) @@ -3756,7 +3756,7 @@ static u32 rule_op_mangle_chr_shiftr (const u32 p0, const u32 p1, u32 buf0[4], u { if (p0 >= in_len) return (in_len); - const u32 mr = 0xff << ((p0 & 3) * 8); + const u32 mr = 0xffu << ((p0 & 3) * 8); const u32 ml = ~mr; switch (p0 / 4) @@ -3778,7 +3778,7 @@ static u32 rule_op_mangle_chr_incr (const u32 p0, const u32 p1, u32 buf0[4], u32 { if (p0 >= in_len) return (in_len); - const u32 mr = 0xff << ((p0 & 3) * 8); + const u32 mr = 0xffu << ((p0 & 3) * 8); const u32 ml = ~mr; const u32 n = 0x01010101 & mr; @@ -3802,7 +3802,7 @@ static u32 rule_op_mangle_chr_decr (const u32 p0, const u32 p1, u32 buf0[4], u32 { if (p0 >= in_len) return (in_len); - const u32 mr = 0xff << ((p0 & 3) * 8); + const u32 mr = 0xffu << ((p0 & 3) * 8); const u32 ml = ~mr; const u32 n = 0x01010101 & mr; @@ -3831,7 +3831,7 @@ static u32 rule_op_mangle_replace_np1 (const u32 p0, const u32 p1, u32 buf0[4], lshift_block (buf0, buf1, tib40, tib41); - const u32 mr = 0xff << ((p0 & 3) * 8); + const u32 mr = 0xffu << ((p0 & 3) * 8); const u32 ml = ~mr; switch (p0 / 4) @@ -3860,7 +3860,7 @@ static u32 rule_op_mangle_replace_nm1 (const u32 p0, const u32 p1, u32 buf0[4], rshift_block (buf0, buf1, tib40, tib41); - const u32 mr = 0xff << ((p0 & 3) * 8); + const u32 mr = 0xffu << ((p0 & 3) * 8); const u32 ml = ~mr; switch (p0 / 4) diff --git a/src/rp_kernel_on_cpu.c b/src/rp_kernel_on_cpu.c index f2f7a5b..3fdf4b8 100644 --- a/src/rp_kernel_on_cpu.c +++ b/src/rp_kernel_on_cpu.c @@ -13,7 +13,7 @@ static uint32_t generate_cmask (uint32_t buf) { const uint32_t rmask = ((buf & 0x40404040) >> 1) - & ~((buf & 0x80808080) >> 2); + & ~((buf & 0x80808080) >> 2); const uint32_t hmask = (buf & 0x1f1f1f1f) + 0x05050505; const uint32_t lmask = (buf & 0x1f1f1f1f) + 0x1f1f1f1f; @@ -1126,7 +1126,7 @@ static uint rule_op_mangle_toggle_at (const uint p0, const uint p1, uint32_t buf { if (p0 >= in_len) return (in_len); - const uint tmp = 0x20 << ((p0 & 3) * 8); + const uint tmp = 0x20u << ((p0 & 3) * 8); switch (p0 / 4) { @@ -1595,7 +1595,7 @@ static uint rule_op_mangle_overstrike (const uint p0, const uint p1, uint32_t bu const uint p1n = p1 << ((p0 & 3) * 8); - const uint m = ~(0xff << ((p0 & 3) * 8)); + const uint m = ~(0xffu << ((p0 & 3) * 8)); switch (p0 / 4) { @@ -2277,7 +2277,7 @@ static uint rule_op_mangle_chr_shiftl (const uint p0, const uint p1, uint32_t bu { if (p0 >= in_len) return (in_len); - const uint mr = 0xff << ((p0 & 3) * 8); + const uint mr = 0xffu << ((p0 & 3) * 8); const uint ml = ~mr; switch (p0 / 4) @@ -2299,7 +2299,7 @@ static uint rule_op_mangle_chr_shiftr (const uint p0, const uint p1, uint32_t bu { if (p0 >= in_len) return (in_len); - const uint mr = 0xff << ((p0 & 3) * 8); + const uint mr = 0xffu << ((p0 & 3) * 8); const uint ml = ~mr; switch (p0 / 4) @@ -2321,7 +2321,7 @@ static uint rule_op_mangle_chr_incr (const uint p0, const uint p1, uint32_t buf0 { if (p0 >= in_len) return (in_len); - const uint mr = 0xff << ((p0 & 3) * 8); + const uint mr = 0xffu << ((p0 & 3) * 8); const uint ml = ~mr; const uint n = 0x01010101 & mr; @@ -2345,7 +2345,7 @@ static uint rule_op_mangle_chr_decr (const uint p0, const uint p1, uint32_t buf0 { if (p0 >= in_len) return (in_len); - const uint mr = 0xff << ((p0 & 3) * 8); + const uint mr = 0xffu << ((p0 & 3) * 8); const uint ml = ~mr; const uint n = 0x01010101 & mr; @@ -2374,7 +2374,7 @@ static uint rule_op_mangle_replace_np1 (const uint p0, const uint p1, uint32_t b lshift_block (buf0, buf1, tib40, tib41); - const uint mr = 0xff << ((p0 & 3) * 8); + const uint mr = 0xffu << ((p0 & 3) * 8); const uint ml = ~mr; switch (p0 / 4) @@ -2403,7 +2403,7 @@ static uint rule_op_mangle_replace_nm1 (const uint p0, const uint p1, uint32_t b rshift_block (buf0, buf1, tib40, tib41); - const uint mr = 0xff << ((p0 & 3) * 8); + const uint mr = 0xffu << ((p0 & 3) * 8); const uint ml = ~mr; switch (p0 / 4) -- 2.25.1