Ver Fonte

Improved compatibility with old compilers

Evgeny Grin (Karlson2k) há 2 anos atrás
pai
commit
93bc2751bf

+ 1 - 1
src/examples/connection_close.c

@@ -111,7 +111,7 @@ main (int argc, char *const *argv)
     /* MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, */
     /* MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, */
     MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD
-    | MHD_USE_ERROR_LOG | MHD_USE_POLL, // | MHD_USE_ITC,
+    | MHD_USE_ERROR_LOG | MHD_USE_POLL, /* | MHD_USE_ITC, */
     /* MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, */
     atoi (argv[1]),
     NULL, NULL, &ahc_echo, PAGE,

+ 1 - 1
src/examples/pthread_windows.h

@@ -43,4 +43,4 @@ int pthread_cond_signal (pthread_cond_t *cond);
 
 int pthread_cond_broadcast (pthread_cond_t *cond);
 
-#endif // !pthread_windows_H
+#endif /* !pthread_windows_H */

+ 2 - 2
src/include/microhttpd.h

@@ -4617,7 +4617,7 @@ enum MHD_DigestAuthAlgo3
    * Not supported by MHD for authentication.
    */
   MHD_DIGEST_AUTH_ALGO3_SHA512_256_SESSION =
-    MHD_DIGEST_BASE_ALGO_SHA512_256 | MHD_DIGEST_AUTH_ALGO3_SESSION,
+    MHD_DIGEST_BASE_ALGO_SHA512_256 | MHD_DIGEST_AUTH_ALGO3_SESSION
 };
 
 
@@ -5302,7 +5302,7 @@ enum MHD_DigestAuthResult
   /**
    * The 'response' is wrong. May indicate an attack attempt.
    */
-  MHD_DAUTH_RESPONSE_WRONG = -34,
+  MHD_DAUTH_RESPONSE_WRONG = -34
 };
 
 

+ 8 - 9
src/microhttpd/test_str.c

@@ -1805,9 +1805,9 @@ check_strx_to_uint32_overflow (void)
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks1 = sizeof(strx_ovflw) / sizeof(strx_ovflw[0]);
-  int c_failed[sizeof(strx_ovflw) / sizeof(strx_ovflw[0])
-               + sizeof(xdstrs_w_values)
-               / sizeof(xdstrs_w_values[0])];
+  int c_failed[(sizeof(strx_ovflw) / sizeof(strx_ovflw[0]))
+               + (sizeof(xdstrs_w_values)
+                  / sizeof(xdstrs_w_values[0]))];
   static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
 
   memset (c_failed, 0, sizeof(c_failed));
@@ -2099,9 +2099,9 @@ check_strx_to_uint32_n_overflow (void)
   size_t t_failed = 0;
   size_t i, j;
   static const size_t n_checks1 = sizeof(strx_ovflw) / sizeof(strx_ovflw[0]);
-  int c_failed[sizeof(strx_ovflw) / sizeof(strx_ovflw[0])
-               + sizeof(xdstrs_w_values)
-               / sizeof(xdstrs_w_values[0])];
+  int c_failed[(sizeof(strx_ovflw) / sizeof(strx_ovflw[0]))
+               + (sizeof(xdstrs_w_values)
+                  / sizeof(xdstrs_w_values[0]))];
   static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
 
   memset (c_failed, 0, sizeof(c_failed));
@@ -2522,9 +2522,8 @@ check_strx_to_uint64_n_valid (void)
 {
   size_t t_failed = 0;
   size_t i, j;
-  static const size_t n_checks = sizeof(xdstrs_w_values)
-                                 / sizeof(xdstrs_w_values[0]);
-  int c_failed[n_checks];
+  int c_failed[sizeof(xdstrs_w_values) / sizeof(xdstrs_w_values[0])];
+  static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
 
   memset (c_failed, 0, sizeof(c_failed));
 

+ 5 - 5
src/testcurl/test_get_response_cleanup.c

@@ -88,7 +88,7 @@ kill_curl (pid_t pid)
 {
   int status;
 
-  // fprintf (stderr, "Killing curl\n");
+  /* fprintf (stderr, "Killing curl\n"); /
   kill (pid, SIGTERM);
   waitpid (pid, &status, 0);
 }
@@ -111,7 +111,7 @@ push_free_callback (void *cls)
 {
   int *ok_p = cls;
 
-  // fprintf (stderr, "Cleanup callback called!\n");
+  /* fprintf (stderr, "Cleanup callback called!\n"); */
   *ok_p = 0;
 }
 
@@ -240,7 +240,7 @@ testMultithreadedGet (void)
             sizeof (url),
             "http://127.0.0.1:%u/",
             (unsigned int) port);
-  // fprintf (stderr, "Forking cURL!\n");
+  /* fprintf (stderr, "Forking cURL!\n"); */
   curl = fork_curl (url);
   (void) sleep (1);
   kill_curl (curl);
@@ -255,7 +255,7 @@ testMultithreadedGet (void)
   }
   kill_curl (curl);
   (void) sleep (1);
-  // fprintf (stderr, "Stopping daemon!\n");
+  /* fprintf (stderr, "Stopping daemon!\n"); */
   MHD_stop_daemon (d);
   if (ok != 0)
     return 32;
@@ -306,7 +306,7 @@ testMultithreadedPoolGet (void)
   (void) sleep (1);
   kill_curl (curl);
   (void) sleep (1);
-  // fprintf (stderr, "Stopping daemon!\n");
+  /* fprintf (stderr, "Stopping daemon!\n"); */
   MHD_stop_daemon (d);
   if (ok != 0)
     return 128;