commit 280fb849e0fa6524520c1dc7aed78e695ec29e8e
parent 3f634541483e4d0aa2a0346233ebafc4c1500707
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Tue, 30 Nov 2021 16:20:33 +0300
Minor readability improvements
Diffstat:
3 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/examples/websocket_threaded_example.c b/src/examples/websocket_threaded_example.c
@@ -420,9 +420,9 @@ is_websocket_request (struct MHD_Connection *con, const char *upg_header,
(void) con; /* Unused. Silent compiler warning. */
- return (upg_header != NULL) && (con_header != NULL)
- && (0 == strcmp (upg_header, WS_UPGRADE_VALUE))
- && (NULL != strstr (con_header, "Upgrade"))
+ return ((upg_header != NULL) && (con_header != NULL)
+ && (0 == strcmp (upg_header, WS_UPGRADE_VALUE))
+ && (NULL != strstr (con_header, "Upgrade")))
? MHD_YES
: MHD_NO;
}
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -2157,7 +2157,7 @@ thread_main_handle_connection (void *data)
#else
1,
#endif
- (NULL == tvp) ? -1 : tv.tv_sec * 1000) < 0)
+ (NULL == tvp) ? -1 : (tv.tv_sec * 1000)) < 0)
{
if (MHD_SCKT_LAST_ERR_IS_ (MHD_SCKT_EINTR_))
continue;
diff --git a/src/microhttpd/mhd_threads.h b/src/microhttpd/mhd_threads.h
@@ -150,10 +150,9 @@ typedef struct _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
* @param thread handle to watch
* @return nonzero on success, zero otherwise
*/
-#define MHD_join_thread_(thread) (WAIT_OBJECT_0 == WaitForSingleObject ( \
- (thread), INFINITE) ? (CloseHandle ( \
- (thread)), ! 0) : \
- 0)
+#define MHD_join_thread_(thread) \
+ ( (WAIT_OBJECT_0 == WaitForSingleObject ( (thread), INFINITE)) ? \
+ (CloseHandle ( (thread)), ! 0) : 0 )
#endif
#if defined(MHD_USE_POSIX_THREADS)
@@ -239,7 +238,7 @@ MHD_create_thread_ (MHD_thread_handle_ID_ *thread,
*/
int
MHD_create_named_thread_ (MHD_thread_handle_ID_ *thread,
- const char*thread_name,
+ const char *thread_name,
size_t stack_size,
MHD_THREAD_START_ROUTINE_ start_routine,
void *arg);