[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 08/08: Fixed additional compiler warnings on W32
From: |
gnunet |
Subject: |
[libmicrohttpd] 08/08: Fixed additional compiler warnings on W32 |
Date: |
Sat, 14 May 2022 15:11:43 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 83fe7b778a7fddf7454acf1f3b9afbd856ff9009
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sat May 14 16:09:10 2022 +0300
Fixed additional compiler warnings on W32
---
src/microhttpd/daemon.c | 2 +-
src/microhttpd/mhd_send.c | 6 +++---
src/microhttpd/mhd_threads.c | 2 +-
src/microhttpd/response.c | 16 ++++++++++------
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,
#else /* SO_EXCLBIND */
SO_EXCLBIND,
#endif /* SO_EXCLBIND */
- (void *) &on,
+ (const void *) &on,
sizeof (on)))
{
#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,
complete_response = false;
push_body = complete_response;
}
- vector[0].buf = (char *) header;
+ vector[0].buf = (char *) _MHD_DROP_CONST (header);
vector[0].len = (unsigned long) header_size;
- vector[1].buf = (char *) body;
+ vector[1].buf = (char *) _MHD_DROP_CONST (body);
vector[1].len = (unsigned long) body_size;
ret = WSASend (s, vector, 2, &vec_sent, 0, NULL, NULL);
@@ -1600,7 +1600,7 @@ send_iov_emu (struct MHD_Connection *connection,
* Adjust buffer of the last element. */
r_iov->iov[r_iov->sent].iov_base =
(void *) ((uint8_t *) r_iov->iov[r_iov->sent].iov_base + sent);
- r_iov->iov[r_iov->sent].iov_len -= sent;
+ r_iov->iov[r_iov->sent].iov_len -= (MHD_iov_size_) sent;
return (ssize_t) total_sent;
}
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,
}
#endif /* SIZEOF_SIZE_T != SIZEOF_UNSIGNED_INT */
- thread->handle = (MHD_thread_handle_)
+ thread->handle = (MHD_thread_handle_) (uintptr_t)
_beginthreadex (NULL,
(unsigned int) stack_size,
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,
#if ! defined(_WIN32) || defined(__CYGWIN__)
ssize_t n;
#else /* _WIN32 && !__CYGWIN__ */
- const HANDLE fh = (HANDLE) _get_osfhandle (response->fd);
+ const HANDLE fh = (HANDLE) (uintptr_t) _get_osfhandle (response->fd);
#endif /* _WIN32 && !__CYGWIN__ */
const int64_t offset64 = (int64_t) (pos + response->fd_off);
@@ -1055,17 +1055,21 @@ pipe_reader (void *cls,
ssize_t n;
(void) pos;
+
#ifndef _WIN32
if (SSIZE_MAX < max)
max = SSIZE_MAX;
+ n = read (response->fd,
+ buf,
+ (MHD_SCKT_SEND_SIZE_) max);
#else /* _WIN32 */
if (UINT_MAX < max)
- max = UINT_MAX;
-#endif /* _WIN32 */
-
+ max = INT_MAX;
n = read (response->fd,
buf,
- (MHD_SCKT_SEND_SIZE_) max);
+ (unsigned int) max);
+#endif /* _WIN32 */
+
if (0 == n)
return MHD_CONTENT_READER_END_OF_STREAM;
if (n < 0)
@@ -1595,7 +1599,7 @@ MHD_create_response_from_iovec (const struct MHD_IoVec
*iov,
{
int64_t i_add;
- i_add = iov[i].iov_len / ULONG_MAX;
+ i_add = (int64_t) (iov[i].iov_len / ULONG_MAX);
if (0 != iov[i].iov_len % ULONG_MAX)
i_add++;
if (INT_MAX < (i_add + i_cp))
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (f50b6be7 -> 83fe7b77), gnunet, 2022/05/14
- [libmicrohttpd] 02/08: MHD_create_response_from_buffer_copy(): fixed doxy, gnunet, 2022/05/14
- [libmicrohttpd] 04/08: Return NULL for MHD_CONNECTION_INFO_CLIENT_ADDRESS if information is not available, gnunet, 2022/05/14
- [libmicrohttpd] 01/08: Replaced MHD_RESPMEM_MUST_FREE with more portable solution in examples, gnunet, 2022/05/14
- [libmicrohttpd] 03/08: Replaced MHD_RESPMEM_PERSISTENT usage in examples and code, gnunet, 2022/05/14
- [libmicrohttpd] 08/08: Fixed additional compiler warnings on W32,
gnunet <=
- [libmicrohttpd] 05/08: Fixed return type for get_system_fdsetsize_value (), gnunet, 2022/05/14
- [libmicrohttpd] 06/08: Fixed handling of connections with non-standard client addresses (pipe or UNIX sockets)., gnunet, 2022/05/14
- [libmicrohttpd] 07/08: Fixed some compiler warnings on W32, gnunet, 2022/05/14