Browse Source

[multiple] quiet clang compiler warnings

personal/stbuehler/ci-build
Glenn Strauss 2 years ago
parent
commit
cbdbd60b35
  1. 2
      src/configfile-glue.c
  2. 4
      src/mod_accesslog.c
  3. 4
      src/mod_evhost.c
  4. 4
      src/network.c

2
src/configfile-glue.c

@ -317,7 +317,7 @@ static void config_cond_result_trace(connection *con, const data_config *dc, int
default: msg = "invalid cond_result_t"; break;
}
log_error(con->conf.errh, __FILE__, __LINE__, "%d (%s) result: %s",
dc->context_ndx, "uncached"+(cached ? 2 : 0), msg);
dc->context_ndx, &"uncached"[cached ? 2 : 0], msg);
}
static cond_result_t config_check_cond_nocache(connection *con, const data_config *dc, int debug_cond, cond_cache_t *cache);

4
src/mod_accesslog.c

@ -259,9 +259,9 @@ static format_fields * accesslog_parse_format(const char * const format, const s
* so 127 should be enough except for obscene custom usage */
size_t i, j, k = 0, start = 0;
uint32_t used = 0;
const uint32_t sz = 127;
const uint32_t sz = 127;/* (sz+1 must match fptr[] num elts below) */
format_field *f;
format_field fptr[sz+1]; /* (128 elements takes 4k on stack in 64-bit) */
format_field fptr[128]; /* (128 elements takes 4k on stack in 64-bit) */
memset(fptr, 0, sizeof(fptr));
if (0 != FIELD_UNSET) return NULL;

4
src/mod_evhost.c

@ -78,9 +78,9 @@ static buffer * mod_evhost_parse_pattern_err(buffer *bptr) {
static buffer * mod_evhost_parse_pattern(const char *ptr) {
uint32_t used = 0;
const uint32_t sz = 127;
const uint32_t sz = 127;/* (sz+1 must match bptr[] num elts below) */
const char *pos;
buffer bptr[sz+1]; /* (128 elements takes 2k on stack in 64-bit) */
buffer bptr[128]; /* (128 elements takes 2k on stack in 64-bit) */
memset(bptr, 0, sizeof(bptr));
for(pos=ptr;*ptr;ptr++) {

4
src/network.c

@ -114,10 +114,10 @@ static int network_host_parse_addr(server *srv, sock_addr *addr, socklen_t *addr
}
if (colon) {
*colon++ = '\0';
port = strtol(colon, NULL, 10);
port = (unsigned int)strtol(colon, NULL, 10);
if (port == 0 || port > 65535) {
log_error(srv->errh, __FILE__, __LINE__,
"port not set or out of range: %hd", port);
"port not set or out of range: %u", port);
return -1;
}
}

Loading…
Cancel
Save