diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-07-13 07:13:04 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-07-13 07:13:04 +0000 |
commit | 64eece6828f6b5fbc5d87c806ed8c2103c065d11 (patch) | |
tree | 61d2c2c560641a5249c05523257411504842843f /src/microhttpd/mhd_str.c | |
parent | 086d70723fcb6c76a3878d7204857555af07938f (diff) | |
download | libmicrohttpd-64eece6828f6b5fbc5d87c806ed8c2103c065d11.tar.gz libmicrohttpd-64eece6828f6b5fbc5d87c806ed8c2103c065d11.zip |
mhd_str.c: fix compiler warnings
Diffstat (limited to 'src/microhttpd/mhd_str.c')
-rw-r--r-- | src/microhttpd/mhd_str.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c index 5699613b..5c8c2172 100644 --- a/src/microhttpd/mhd_str.c +++ b/src/microhttpd/mhd_str.c | |||
@@ -306,7 +306,7 @@ MHD_str_to_uint64_ (const char * str, uint64_t * out_val) | |||
306 | { | 306 | { |
307 | const int digit = (unsigned char)(*str) - '0'; | 307 | const int digit = (unsigned char)(*str) - '0'; |
308 | if ( (res > (UINT64_MAX / 10)) || | 308 | if ( (res > (UINT64_MAX / 10)) || |
309 | (res == (UINT64_MAX / 10) && digit > (UINT64_MAX % 10)) ) | 309 | (res == (UINT64_MAX / 10) && (uint64_t)digit > (UINT64_MAX % 10)) ) |
310 | return 0; | 310 | return 0; |
311 | 311 | ||
312 | res *= 10; | 312 | res *= 10; |
@@ -345,7 +345,7 @@ MHD_str_to_uint64_n_ (const char * str, size_t maxlen, uint64_t * out_val) | |||
345 | { | 345 | { |
346 | const int digit = (unsigned char)str[i] - '0'; | 346 | const int digit = (unsigned char)str[i] - '0'; |
347 | if ( (res > (UINT64_MAX / 10)) || | 347 | if ( (res > (UINT64_MAX / 10)) || |
348 | (res == (UINT64_MAX / 10) && digit > (UINT64_MAX % 10)) ) | 348 | (res == (UINT64_MAX / 10) && (uint64_t)digit > (UINT64_MAX % 10)) ) |
349 | return 0; | 349 | return 0; |
350 | 350 | ||
351 | res *= 10; | 351 | res *= 10; |
@@ -381,7 +381,7 @@ MHD_strx_to_sizet_ (const char * str, size_t * out_val) | |||
381 | while (digit >= 0) | 381 | while (digit >= 0) |
382 | { | 382 | { |
383 | if ( (res < (SIZE_MAX / 16)) || | 383 | if ( (res < (SIZE_MAX / 16)) || |
384 | (res == (SIZE_MAX / 16) && digit <= (SIZE_MAX % 16)) ) | 384 | (res == (SIZE_MAX / 16) && (size_t)digit <= (SIZE_MAX % 16)) ) |
385 | { | 385 | { |
386 | res *= 16; | 386 | res *= 16; |
387 | res += digit; | 387 | res += digit; |
@@ -424,7 +424,7 @@ MHD_strx_to_sizet_n_ (const char * str, size_t maxlen, size_t * out_val) | |||
424 | while (i < maxlen && (digit = toxdigitvalue (str[i])) >= 0) | 424 | while (i < maxlen && (digit = toxdigitvalue (str[i])) >= 0) |
425 | { | 425 | { |
426 | if ( (res > (SIZE_MAX / 16)) || | 426 | if ( (res > (SIZE_MAX / 16)) || |
427 | (res == (SIZE_MAX / 16) && digit > (SIZE_MAX % 16)) ) | 427 | (res == (SIZE_MAX / 16) && (size_t)digit > (SIZE_MAX % 16)) ) |
428 | return 0; | 428 | return 0; |
429 | 429 | ||
430 | res *= 16; | 430 | res *= 16; |
@@ -461,7 +461,7 @@ MHD_strx_to_uint32_ (const char * str, uint32_t * out_val) | |||
461 | while (digit >= 0) | 461 | while (digit >= 0) |
462 | { | 462 | { |
463 | if ( (res < (UINT32_MAX / 16)) || | 463 | if ( (res < (UINT32_MAX / 16)) || |
464 | (res == (UINT32_MAX / 16) && digit <= (UINT32_MAX % 16)) ) | 464 | (res == (UINT32_MAX / 16) && (uint32_t)digit <= (UINT32_MAX % 16)) ) |
465 | { | 465 | { |
466 | res *= 16; | 466 | res *= 16; |
467 | res += digit; | 467 | res += digit; |
@@ -504,7 +504,7 @@ MHD_strx_to_uint32_n_ (const char * str, size_t maxlen, uint32_t * out_val) | |||
504 | while (i < maxlen && (digit = toxdigitvalue (str[i])) >= 0) | 504 | while (i < maxlen && (digit = toxdigitvalue (str[i])) >= 0) |
505 | { | 505 | { |
506 | if ( (res > (UINT32_MAX / 16)) || | 506 | if ( (res > (UINT32_MAX / 16)) || |
507 | (res == (UINT32_MAX / 16) && digit > (UINT32_MAX % 16)) ) | 507 | (res == (UINT32_MAX / 16) && (uint32_t)digit > (UINT32_MAX % 16)) ) |
508 | return 0; | 508 | return 0; |
509 | 509 | ||
510 | res *= 16; | 510 | res *= 16; |
@@ -541,7 +541,7 @@ MHD_strx_to_uint64_ (const char * str, uint64_t * out_val) | |||
541 | while (digit >= 0) | 541 | while (digit >= 0) |
542 | { | 542 | { |
543 | if ( (res < (UINT64_MAX / 16)) || | 543 | if ( (res < (UINT64_MAX / 16)) || |
544 | (res == (UINT64_MAX / 16) && digit <= (UINT64_MAX % 16)) ) | 544 | (res == (UINT64_MAX / 16) && (uint64_t)digit <= (UINT64_MAX % 16)) ) |
545 | { | 545 | { |
546 | res *= 16; | 546 | res *= 16; |
547 | res += digit; | 547 | res += digit; |
@@ -584,7 +584,7 @@ MHD_strx_to_uint64_n_ (const char * str, size_t maxlen, uint64_t * out_val) | |||
584 | while (i < maxlen && (digit = toxdigitvalue (str[i])) >= 0) | 584 | while (i < maxlen && (digit = toxdigitvalue (str[i])) >= 0) |
585 | { | 585 | { |
586 | if ( (res > (UINT64_MAX / 16)) || | 586 | if ( (res > (UINT64_MAX / 16)) || |
587 | (res == (UINT64_MAX / 16) && digit > (UINT64_MAX % 16)) ) | 587 | (res == (UINT64_MAX / 16) && (uint64_t)digit > (UINT64_MAX % 16)) ) |
588 | return 0; | 588 | return 0; |
589 | 589 | ||
590 | res *= 16; | 590 | res *= 16; |