summaryrefslogtreecommitdiff
path: root/src/gf_w64.c
diff options
context:
space:
mode:
authorLoic Dachary <ldachary@redhat.com>2015-09-02 19:11:51 +0200
committerLoic Dachary <ldachary@redhat.com>2015-09-02 19:20:33 +0200
commitd1b6bbf706b2628ab21cee2eb51a7cfe8cf04bcd (patch)
treea54d2f73e0d3b8cb5666788e2504098364240ac8 /src/gf_w64.c
parent284a97a0d9299721a62e357f8a17a31c16533fe1 (diff)
downloadgf-complete-d1b6bbf706b2628ab21cee2eb51a7cfe8cf04bcd.tar.gz
add -Wsign-compare and address the warnings
* (1 << w) are changed into ((uint32_t)1 << w) * int are changed into uint32_t gf.c: gf_composite_get_default_poly: a larger unsigned were assigned to unsigned integers in which case the type of the assigned variable is changed to be the same as the value assigned to it. gf_w16.c: GF_MULTBY_TWO setting the parameter to a variable instead of passing the expression resolves the warning for some reason. Signed-off-by: Loic Dachary <loic@dachary.org>
Diffstat (limited to 'src/gf_w64.c')
-rw-r--r--src/gf_w64.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gf_w64.c b/src/gf_w64.c
index de231db..eae31e6 100644
--- a/src/gf_w64.c
+++ b/src/gf_w64.c
@@ -35,7 +35,7 @@ void
gf_w64_multiply_region_from_single(gf_t *gf, void *src, void *dest, gf_val_64_t val, int bytes, int
xor)
{
- int i;
+ uint32_t i;
gf_val_64_t *s64;
gf_val_64_t *d64;
@@ -733,7 +733,7 @@ static
void
gf_w64_group_set_shift_tables(uint64_t *shift, uint64_t val, gf_internal_t *h)
{
- int i;
+ uint64_t i;
uint64_t j;
uint64_t one = 1;
int g_s;
@@ -741,7 +741,7 @@ gf_w64_group_set_shift_tables(uint64_t *shift, uint64_t val, gf_internal_t *h)
g_s = h->arg1;
shift[0] = 0;
- for (i = 1; i < (1 << g_s); i <<= 1) {
+ for (i = 1; i < ((uint64_t)1 << g_s); i <<= 1) {
for (j = 0; j < i; j++) shift[i|j] = shift[j]^val;
if (val & (one << 63)) {
val <<= 1;
@@ -984,7 +984,7 @@ int gf_w64_group_init(gf_t *gf)
uint64_t i, j, p, index;
struct gf_w64_group_data *gd;
gf_internal_t *h = (gf_internal_t *) gf->scratch;
- int g_r, g_s;
+ uint64_t g_r, g_s;
g_s = h->arg1;
g_r = h->arg2;