Compiler warnings on Windows: C4018 and C4334

This commit is contained in:
Shahram Najm 2022-02-10 10:54:58 +00:00
parent 4f113ed801
commit 2736648f41
2 changed files with 4 additions and 6 deletions

View File

@ -371,7 +371,7 @@ static grib_codetable* load_table(grib_accessor_codetable* self)
size = grib_byte_count((grib_accessor*)self) * 8;
}
size = (1UL << size); /* 2^size */
size = (1ULL << size); /* 2^size - 64bits */
t = (grib_codetable*)grib_context_malloc_clear_persistent(c, sizeof(grib_codetable) +
(size - 1) * sizeof(code_table_entry));
@ -783,10 +783,8 @@ static int get_native_type(grib_accessor* a)
static int unpack_long(grib_accessor* a, long* val, size_t* len)
{
grib_accessor_codetable* self = (grib_accessor_codetable*)a;
long rlen = 0;
unsigned long i = 0;
long pos = a->offset * 8;
long rlen = 0, i = 0;
long pos = a->offset * 8;
grib_handle* hand = NULL;
#ifdef DEBUG

View File

@ -281,7 +281,7 @@ static grib_smart_table* load_table(grib_accessor_smart_table* self)
next = next->next;
}
size = (1UL << self->widthOfCode); /* 2 ^ self->widthOfCode */
size = (1ULL << self->widthOfCode); /* 2 ^ self->widthOfCode - 64 bits */
t = (grib_smart_table*)grib_context_malloc_clear_persistent(c, sizeof(grib_smart_table));
t->entries = (grib_smart_table_entry*)grib_context_malloc_clear_persistent(c, size * sizeof(grib_smart_table_entry));