aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-05-14 16:09:10 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-05-14 16:09:10 +0300
commit83fe7b778a7fddf7454acf1f3b9afbd856ff9009 (patch)
treee12a44c3472ff4bcef3655bbcd5834d3baa7f36f
parente4d6c07b141b0ddb989d6826e4f8344c50e1b5fa (diff)
downloadlibmicrohttpd-83fe7b778a7fddf7454acf1f3b9afbd856ff9009.tar.gz
libmicrohttpd-83fe7b778a7fddf7454acf1f3b9afbd856ff9009.zip
Fixed additional compiler warnings on W32
-rw-r--r--src/microhttpd/daemon.c2
-rw-r--r--src/microhttpd/mhd_send.c6
-rw-r--r--src/microhttpd/mhd_threads.c2
-rw-r--r--src/microhttpd/response.c16
4 files changed, 15 insertions, 11 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index beeee7d8..e96ef4a2 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -7011,7 +7011,7 @@ MHD_start_daemon_va (unsigned int flags,
7011#else /* SO_EXCLBIND */ 7011#else /* SO_EXCLBIND */
7012 SO_EXCLBIND, 7012 SO_EXCLBIND,
7013#endif /* SO_EXCLBIND */ 7013#endif /* SO_EXCLBIND */
7014 (void *) &on, 7014 (const void *) &on,
7015 sizeof (on))) 7015 sizeof (on)))
7016 { 7016 {
7017#ifdef HAVE_MESSAGES 7017#ifdef HAVE_MESSAGES
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index c607a4c8..be471619 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -1081,9 +1081,9 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
1081 complete_response = false; 1081 complete_response = false;
1082 push_body = complete_response; 1082 push_body = complete_response;
1083 } 1083 }
1084 vector[0].buf = (char *) header; 1084 vector[0].buf = (char *) _MHD_DROP_CONST (header);
1085 vector[0].len = (unsigned long) header_size; 1085 vector[0].len = (unsigned long) header_size;
1086 vector[1].buf = (char *) body; 1086 vector[1].buf = (char *) _MHD_DROP_CONST (body);
1087 vector[1].len = (unsigned long) body_size; 1087 vector[1].len = (unsigned long) body_size;
1088 1088
1089 ret = WSASend (s, vector, 2, &vec_sent, 0, NULL, NULL); 1089 ret = WSASend (s, vector, 2, &vec_sent, 0, NULL, NULL);
@@ -1600,7 +1600,7 @@ send_iov_emu (struct MHD_Connection *connection,
1600 * Adjust buffer of the last element. */ 1600 * Adjust buffer of the last element. */
1601 r_iov->iov[r_iov->sent].iov_base = 1601 r_iov->iov[r_iov->sent].iov_base =
1602 (void *) ((uint8_t *) r_iov->iov[r_iov->sent].iov_base + sent); 1602 (void *) ((uint8_t *) r_iov->iov[r_iov->sent].iov_base + sent);
1603 r_iov->iov[r_iov->sent].iov_len -= sent; 1603 r_iov->iov[r_iov->sent].iov_len -= (MHD_iov_size_) sent;
1604 1604
1605 return (ssize_t) total_sent; 1605 return (ssize_t) total_sent;
1606 } 1606 }
diff --git a/src/microhttpd/mhd_threads.c b/src/microhttpd/mhd_threads.c
index 45a10f12..628a628f 100644
--- a/src/microhttpd/mhd_threads.c
+++ b/src/microhttpd/mhd_threads.c
@@ -225,7 +225,7 @@ MHD_create_thread_ (MHD_thread_handle_ID_ *thread,
225 } 225 }
226#endif /* SIZEOF_SIZE_T != SIZEOF_UNSIGNED_INT */ 226#endif /* SIZEOF_SIZE_T != SIZEOF_UNSIGNED_INT */
227 227
228 thread->handle = (MHD_thread_handle_) 228 thread->handle = (MHD_thread_handle_) (uintptr_t)
229 _beginthreadex (NULL, 229 _beginthreadex (NULL,
230 (unsigned int) stack_size, 230 (unsigned int) stack_size,
231 start_routine, 231 start_routine,
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index 463f01a7..4c6c192a 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -967,7 +967,7 @@ file_reader (void *cls,
967#if ! defined(_WIN32) || defined(__CYGWIN__) 967#if ! defined(_WIN32) || defined(__CYGWIN__)
968 ssize_t n; 968 ssize_t n;
969#else /* _WIN32 && !__CYGWIN__ */ 969#else /* _WIN32 && !__CYGWIN__ */
970 const HANDLE fh = (HANDLE) _get_osfhandle (response->fd); 970 const HANDLE fh = (HANDLE) (uintptr_t) _get_osfhandle (response->fd);
971#endif /* _WIN32 && !__CYGWIN__ */ 971#endif /* _WIN32 && !__CYGWIN__ */
972 const int64_t offset64 = (int64_t) (pos + response->fd_off); 972 const int64_t offset64 = (int64_t) (pos + response->fd_off);
973 973
@@ -1055,17 +1055,21 @@ pipe_reader (void *cls,
1055 ssize_t n; 1055 ssize_t n;
1056 1056
1057 (void) pos; 1057 (void) pos;
1058
1058#ifndef _WIN32 1059#ifndef _WIN32
1059 if (SSIZE_MAX < max) 1060 if (SSIZE_MAX < max)
1060 max = SSIZE_MAX; 1061 max = SSIZE_MAX;
1062 n = read (response->fd,
1063 buf,
1064 (MHD_SCKT_SEND_SIZE_) max);
1061#else /* _WIN32 */ 1065#else /* _WIN32 */
1062 if (UINT_MAX < max) 1066 if (UINT_MAX < max)
1063 max = UINT_MAX; 1067 max = INT_MAX;
1064#endif /* _WIN32 */
1065
1066 n = read (response->fd, 1068 n = read (response->fd,
1067 buf, 1069 buf,
1068 (MHD_SCKT_SEND_SIZE_) max); 1070 (unsigned int) max);
1071#endif /* _WIN32 */
1072
1069 if (0 == n) 1073 if (0 == n)
1070 return MHD_CONTENT_READER_END_OF_STREAM; 1074 return MHD_CONTENT_READER_END_OF_STREAM;
1071 if (n < 0) 1075 if (n < 0)
@@ -1595,7 +1599,7 @@ MHD_create_response_from_iovec (const struct MHD_IoVec *iov,
1595 { 1599 {
1596 int64_t i_add; 1600 int64_t i_add;
1597 1601
1598 i_add = iov[i].iov_len / ULONG_MAX; 1602 i_add = (int64_t) (iov[i].iov_len / ULONG_MAX);
1599 if (0 != iov[i].iov_len % ULONG_MAX) 1603 if (0 != iov[i].iov_len % ULONG_MAX)
1600 i_add++; 1604 i_add++;
1601 if (INT_MAX < (i_add + i_cp)) 1605 if (INT_MAX < (i_add + i_cp))