diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2024-01-30 17:08:52 +0100 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2024-01-30 17:22:36 +0100 |
commit | d63cb66783776ce528681beb08b4e76c40c1fc9f (patch) | |
tree | 744aebde266798dcbbb081bf960c16a81bad69c5 | |
parent | d874f86dd20da89c746f0fd36e087240a393b732 (diff) | |
download | libmicrohttpd-d63cb66783776ce528681beb08b4e76c40c1fc9f.tar.gz libmicrohttpd-d63cb66783776ce528681beb08b4e76c40c1fc9f.zip |
Muted extra compiler warnings
-rw-r--r-- | src/examples/websocket_threaded_example.c | 2 | ||||
-rw-r--r-- | src/microhttpd/mhd_str.c | 18 | ||||
-rw-r--r-- | src/microhttpd/test_client_put_stop.c | 12 |
3 files changed, 17 insertions, 15 deletions
diff --git a/src/examples/websocket_threaded_example.c b/src/examples/websocket_threaded_example.c index 3047fc7d..1c98b428 100644 --- a/src/examples/websocket_threaded_example.c +++ b/src/examples/websocket_threaded_example.c | |||
@@ -675,7 +675,7 @@ ws_receive_frame (unsigned char *frame, ssize_t *length, int *type) | |||
675 | { | 675 | { |
676 | idx_first_mask = 10; | 676 | idx_first_mask = 10; |
677 | } | 677 | } |
678 | idx_first_data = idx_first_mask + 4; | 678 | idx_first_data = (unsigned char) (idx_first_mask + 4); |
679 | data_length = (size_t) *length - idx_first_data; | 679 | data_length = (size_t) *length - idx_first_data; |
680 | masks[0] = frame[idx_first_mask + 0]; | 680 | masks[0] = frame[idx_first_mask + 0]; |
681 | masks[1] = frame[idx_first_mask + 1]; | 681 | masks[1] = frame[idx_first_mask + 1]; |
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c index 8943b46e..d01086ac 100644 --- a/src/microhttpd/mhd_str.c +++ b/src/microhttpd/mhd_str.c | |||
@@ -1073,7 +1073,7 @@ MHD_str_remove_tokens_caseless_ (char *str, | |||
1073 | while (pt < tokens_len && (' ' == t[pt] || '\t' == t[pt])) | 1073 | while (pt < tokens_len && (' ' == t[pt] || '\t' == t[pt])) |
1074 | pt++; | 1074 | pt++; |
1075 | /* Found end of the token string or non-whitespace char */ | 1075 | /* Found end of the token string or non-whitespace char */ |
1076 | } while(pt < tokens_len && ',' != t[pt]); | 1076 | } while (pt < tokens_len && ',' != t[pt]); |
1077 | 1077 | ||
1078 | /* 'tkn' is the input token with 'tkn_len' chars */ | 1078 | /* 'tkn' is the input token with 'tkn_len' chars */ |
1079 | mhd_assert (0 != tkn_len); | 1079 | mhd_assert (0 != tkn_len); |
@@ -1531,8 +1531,10 @@ MHD_uint32_to_strx (uint32_t val, | |||
1531 | 1531 | ||
1532 | while (o_pos < buf_size) | 1532 | while (o_pos < buf_size) |
1533 | { | 1533 | { |
1534 | buf[o_pos++] = (digit <= 9) ? ('0' + (char) digit) : | 1534 | buf[o_pos++] = |
1535 | ('A' + (char) digit - 10); | 1535 | (char) ((digit <= 9) ? |
1536 | ('0' + (char) digit) : | ||
1537 | ('A' + (char) digit - 10)); | ||
1536 | if (0 == digit_pos) | 1538 | if (0 == digit_pos) |
1537 | return o_pos; | 1539 | return o_pos; |
1538 | digit_pos--; | 1540 | digit_pos--; |
@@ -1568,7 +1570,7 @@ MHD_uint16_to_str (uint16_t val, | |||
1568 | 1570 | ||
1569 | while (0 != buf_size) | 1571 | while (0 != buf_size) |
1570 | { | 1572 | { |
1571 | *chr = (char) digit + '0'; | 1573 | *chr = (char) ((char) digit + '0'); |
1572 | chr++; | 1574 | chr++; |
1573 | buf_size--; | 1575 | buf_size--; |
1574 | if (1 == divisor) | 1576 | if (1 == divisor) |
@@ -1609,7 +1611,7 @@ MHD_uint64_to_str (uint64_t val, | |||
1609 | 1611 | ||
1610 | while (0 != buf_size) | 1612 | while (0 != buf_size) |
1611 | { | 1613 | { |
1612 | *chr = (char) digit + '0'; | 1614 | *chr = (char) ((char) digit + '0'); |
1613 | chr++; | 1615 | chr++; |
1614 | buf_size--; | 1616 | buf_size--; |
1615 | if (1 == divisor) | 1617 | if (1 == divisor) |
@@ -1644,7 +1646,7 @@ MHD_uint8_to_str_pad (uint8_t val, | |||
1644 | } | 1646 | } |
1645 | else | 1647 | else |
1646 | { | 1648 | { |
1647 | buf[pos++] = '0' + (char) digit; | 1649 | buf[pos++] = (char) ('0' + (char) digit); |
1648 | val %= 100; | 1650 | val %= 100; |
1649 | min_digits = 2; | 1651 | min_digits = 2; |
1650 | } | 1652 | } |
@@ -1659,13 +1661,13 @@ MHD_uint8_to_str_pad (uint8_t val, | |||
1659 | } | 1661 | } |
1660 | else | 1662 | else |
1661 | { | 1663 | { |
1662 | buf[pos++] = '0' + (char) digit; | 1664 | buf[pos++] = (char) ('0' + (char) digit); |
1663 | val %= 10; | 1665 | val %= 10; |
1664 | } | 1666 | } |
1665 | 1667 | ||
1666 | if (buf_size <= pos) | 1668 | if (buf_size <= pos) |
1667 | return 0; | 1669 | return 0; |
1668 | buf[pos++] = '0' + (char) val; | 1670 | buf[pos++] = (char) ('0' + (char) val); |
1669 | return pos; | 1671 | return pos; |
1670 | } | 1672 | } |
1671 | 1673 | ||
diff --git a/src/microhttpd/test_client_put_stop.c b/src/microhttpd/test_client_put_stop.c index aaf5c829..3a6c1865 100644 --- a/src/microhttpd/test_client_put_stop.c +++ b/src/microhttpd/test_client_put_stop.c | |||
@@ -1964,17 +1964,17 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
1964 | { | 1964 | { |
1965 | *pport = 4170; | 1965 | *pport = 4170; |
1966 | if (use_shutdown) | 1966 | if (use_shutdown) |
1967 | *pport += 0; | 1967 | *pport = (uint16_t) (*pport + 0); |
1968 | if (use_close) | 1968 | if (use_close) |
1969 | *pport += 1; | 1969 | *pport = (uint16_t) (*pport + 1); |
1970 | if (use_hard_close) | 1970 | if (use_hard_close) |
1971 | *pport += 1; | 1971 | *pport = (uint16_t) (*pport + 1); |
1972 | if (by_step) | 1972 | if (by_step) |
1973 | *pport += 1 << 2; | 1973 | *pport = (uint16_t) (*pport + (1 << 2)); |
1974 | if (upl_chunked) | 1974 | if (upl_chunked) |
1975 | *pport += 1 << 3; | 1975 | *pport = (uint16_t) (*pport + (1 << 3)); |
1976 | if (! oneone) | 1976 | if (! oneone) |
1977 | *pport += 1 << 4; | 1977 | *pport = (uint16_t) (*pport + (1 << 4)); |
1978 | } | 1978 | } |
1979 | 1979 | ||
1980 | if (testMhdThreadExternal == thrType) | 1980 | if (testMhdThreadExternal == thrType) |