[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 04/06: websocket_threaded_example: fixed compiler warnin
From: |
gnunet |
Subject: |
[libmicrohttpd] 04/06: websocket_threaded_example: fixed compiler warning on x32 platforms |
Date: |
Sun, 24 Oct 2021 13:45:07 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 18c2ad66c72fbc8ed94fbaceb62274a1ee3e603c
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Oct 24 11:24:07 2021 +0300
websocket_threaded_example: fixed compiler warning on x32 platforms
---
src/examples/websocket_threaded_example.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/examples/websocket_threaded_example.c
b/src/examples/websocket_threaded_example.c
index 1586933e..e2a2c9c1 100644
--- a/src/examples/websocket_threaded_example.c
+++ b/src/examples/websocket_threaded_example.c
@@ -575,14 +575,8 @@ ws_send_frame (MHD_socket sock, const char *msg, size_t
length)
frame[1] = length & 0x7F;
idx_first_rdata = 2;
}
- else if ((length >= 126) && (length <= 0xFFFF))
- {
- frame[1] = 126;
- frame[2] = (length >> 8) & 0xFF;
- frame[3] = length & 0xFF;
- idx_first_rdata = 4;
- }
- else
+#if SIZEOF_SIZE_T > 4
+ else if (0xFFFF < length)
{
frame[1] = 127;
frame[2] = (unsigned char) ((length >> 56) & 0xFF);
@@ -595,6 +589,14 @@ ws_send_frame (MHD_socket sock, const char *msg, size_t
length)
frame[9] = (unsigned char) (length & 0xFF);
idx_first_rdata = 10;
}
+#endif /* SIZEOF_SIZE_T > 4 */
+ else
+ {
+ frame[1] = 126;
+ frame[2] = (length >> 8) & 0xFF;
+ frame[3] = length & 0xFF;
+ idx_first_rdata = 4;
+ }
idx_response = 0;
response = malloc (idx_first_rdata + length + 1);
if (NULL == response)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (07829e85 -> 9cb16af3), gnunet, 2021/10/24
- [libmicrohttpd] 05/06: Fixed: include "MHD_config.h" before other headers to set correct macros, gnunet, 2021/10/24
- [libmicrohttpd] 02/06: configure: fixed harmless typo in cache variable name, gnunet, 2021/10/24
- [libmicrohttpd] 06/06: connection.c: fixed copy-paste error in comment, gnunet, 2021/10/24
- [libmicrohttpd] 01/06: configure: improved reporting on Solaris, gnunet, 2021/10/24
- [libmicrohttpd] 03/06: Added check at configure time for PAGESIZE and PAGE_SIZE macros, gnunet, 2021/10/24
- [libmicrohttpd] 04/06: websocket_threaded_example: fixed compiler warning on x32 platforms,
gnunet <=