[multiple] quiet clang compiler warnings

personal/stbuehler/ci-build
Glenn Strauss 2019-12-08 00:42:23 -05:00
parent ca97505a72
commit cbdbd60b35
4 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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++) {

View File

@ -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;
}
}