gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 03/04: Minor readability improvements


From: gnunet
Subject: [libmicrohttpd] 03/04: Minor readability improvements
Date: Wed, 01 Dec 2021 14:46:12 +0100

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 280fb849e0fa6524520c1dc7aed78e695ec29e8e
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Nov 30 16:20:33 2021 +0300

    Minor readability improvements
---
 src/examples/websocket_threaded_example.c | 6 +++---
 src/microhttpd/daemon.c                   | 2 +-
 src/microhttpd/mhd_threads.h              | 9 ++++-----
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/examples/websocket_threaded_example.c 
b/src/examples/websocket_threaded_example.c
index 3a232b41..3f94cbd8 100644
--- 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
index 25ac0969..9731bf72 100644
--- 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
index 14612ded..818cd5fa 100644
--- 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);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]