commit 93bc2751bf5a04380de4435877344418bbeec770
parent ed4c182944c33f0147b4eeed88362916995783b0
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Wed, 27 Sep 2023 20:02:00 +0300
Improved compatibility with old compilers
Diffstat:
5 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/src/examples/connection_close.c b/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,
diff --git a/src/examples/pthread_windows.h b/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 */
diff --git a/src/include/microhttpd.h b/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
};
diff --git a/src/microhttpd/test_str.c b/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));
diff --git a/src/testcurl/test_get_response_cleanup.c b/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;