diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-09-28 20:50:19 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-09-28 20:50:19 +0300 |
commit | 4e18379e5155429dcb944a856e0a1607c64d5c47 (patch) | |
tree | f621d581bc5cff7135c407fbee20fe7e7843e306 | |
parent | 5fb65271fd0f6f22fe186c19120323422cc9eeac (diff) | |
download | libmicrohttpd-4e18379e5155429dcb944a856e0a1607c64d5c47.tar.gz libmicrohttpd-4e18379e5155429dcb944a856e0a1607c64d5c47.zip |
daemon.c: muted some compiler warnings, added comments.
-rw-r--r-- | src/microhttpd/daemon.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index fb363caa..7d4daa73 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -130,6 +130,7 @@ mhd_panic_std (void *cls, | |||
130 | unsigned int line, | 130 | unsigned int line, |
131 | const char *reason) | 131 | const char *reason) |
132 | { | 132 | { |
133 | (void)cls; /* Mute compiler warning. */ | ||
133 | #ifdef HAVE_MESSAGES | 134 | #ifdef HAVE_MESSAGES |
134 | fprintf (stderr, | 135 | fprintf (stderr, |
135 | _("Fatal error in GNU libmicrohttpd %s:%u: %s\n"), | 136 | _("Fatal error in GNU libmicrohttpd %s:%u: %s\n"), |
@@ -4404,6 +4405,8 @@ unescape_wrapper (void *cls, | |||
4404 | struct MHD_Connection *connection, | 4405 | struct MHD_Connection *connection, |
4405 | char *val) | 4406 | char *val) |
4406 | { | 4407 | { |
4408 | (void)cls; /* Mute compiler warning. */ | ||
4409 | (void)connection; /* Mute compiler warning. */ | ||
4407 | return MHD_http_unescape (val); | 4410 | return MHD_http_unescape (val); |
4408 | } | 4411 | } |
4409 | 4412 | ||
@@ -4630,7 +4633,10 @@ parse_options_va (struct MHD_Daemon *daemon, | |||
4630 | case MHD_OPTION_CONNECTION_TIMEOUT: | 4633 | case MHD_OPTION_CONNECTION_TIMEOUT: |
4631 | uv = va_arg (ap, | 4634 | uv = va_arg (ap, |
4632 | unsigned int); | 4635 | unsigned int); |
4633 | if (TIME_T_MAX < uv) | 4636 | /* Next comparison could be always false on some platforms and whole branch will |
4637 | * be optimized out on those platforms. On others it will be compiled into real | ||
4638 | * check. */ | ||
4639 | if (TIME_T_MAX < uv) /* Compiler may warn on some platforms, ignore warning. */ | ||
4634 | { | 4640 | { |
4635 | #ifdef HAVE_MESSAGES | 4641 | #ifdef HAVE_MESSAGES |
4636 | MHD_DLOG (daemon, | 4642 | MHD_DLOG (daemon, |
@@ -4687,7 +4693,10 @@ parse_options_va (struct MHD_Daemon *daemon, | |||
4687 | #endif | 4693 | #endif |
4688 | daemon->worker_pool_size = 0; | 4694 | daemon->worker_pool_size = 0; |
4689 | } | 4695 | } |
4690 | else if (daemon->worker_pool_size >= (SIZE_MAX / sizeof (struct MHD_Daemon))) | 4696 | /* Next comparison could be always false on some platforms and whole branch will |
4697 | * be optimized out on those platforms. On others it will be compiled into real | ||
4698 | * check. */ | ||
4699 | else if (daemon->worker_pool_size >= (SIZE_MAX / sizeof (struct MHD_Daemon))) /* Compiler may warn on some platforms, ignore warning. */ | ||
4691 | { | 4700 | { |
4692 | #ifdef HAVE_MESSAGES | 4701 | #ifdef HAVE_MESSAGES |
4693 | MHD_DLOG (daemon, | 4702 | MHD_DLOG (daemon, |