Compare the various `cmp()` functions against zero.
return;
list_for_each_entry(eng, &client->worker->engines, list) {
- if (!strcmp(eng->id, client->engine_id))
+ if (strcmp(eng->id, client->engine_id) == 0)
goto end;
}
server_port = atoi(optarg);
break;
case 'c':
- if (!strcmp(optarg, "pipelining"))
+ if (strcmp(optarg, "pipelining") == 0)
pipelining = true;
- else if (!strcmp(optarg, "async"))
+ else if (strcmp(optarg, "async") == 0)
async = true;
- else if (!strcmp(optarg, "fragmentation"))
+ else if (strcmp(optarg, "fragmentation") == 0)
fragmentation = true;
else
fprintf(stderr, "WARNING: unsupported capability '%s'\n", optarg);
const command_rec *cmds)
{
while (cmds->name) {
- if (!strcasecmp(name, cmds->name))
+ if (strcasecmp(name, cmds->name) == 0)
return cmds;
++cmds;
}
*/
w = getword_conf(parms->temp_pool, &args);
- if (*w == '\0' || (strcasecmp(w, "on") && strcasecmp(w, "off")))
+ if (*w == '\0' || (strcasecmp(w, "on") != 0 && strcasecmp(w, "off") != 0))
return apr_pstrcat(parms->pool, cmd->name, " must be On or Off",
NULL);
candidates = apr_array_make(ptemp, 1, sizeof(fnames));
while (apr_dir_read(&dirent, APR_FINFO_DIRENT, dirp) == APR_SUCCESS) {
/* strip out '.' and '..' */
- if (strcmp(dirent.name, ".")
- && strcmp(dirent.name, "..")) {
+ if (strcmp(dirent.name, ".") != 0
+ && strcmp(dirent.name, "..") != 0) {
fnew = (fnames *) apr_array_push(candidates);
fnew->fname = make_full_path(ptemp, path, dirent.name);
}
candidates = apr_array_make(ptemp, 1, sizeof(fnames));
while (apr_dir_read(&dirent, APR_FINFO_DIRENT | APR_FINFO_TYPE, dirp) == APR_SUCCESS) {
/* strip out '.' and '..' */
- if (strcmp(dirent.name, ".")
- && strcmp(dirent.name, "..")
+ if (strcmp(dirent.name, ".") != 0
+ && strcmp(dirent.name, "..") != 0
&& (apr_fnmatch(fname, dirent.name,
APR_FNM_PERIOD) == APR_SUCCESS)) {
const char *full_path = make_full_path(ptemp, path, dirent.name);
continue;
/* similar to invoke_cmd() */
- if (!strcasecmp(cmd_name, "IncludeOptional") ||
- !strcasecmp(cmd_name, "Include"))
+ if (strcasecmp(cmd_name, "IncludeOptional") == 0 ||
+ strcasecmp(cmd_name, "Include") == 0)
{
char *w, *fullname;
- if (!strcasecmp(cmd_name, "IncludeOptional"))
+ if (strcasecmp(cmd_name, "IncludeOptional") == 0)
optional = 1;
w = getword_conf(parms->pool, &args);
return;
list_for_each_entry(eng, &client->worker->engines, list) {
- if (!strcmp(eng->id, client->engine_id))
+ if (strcmp(eng->id, client->engine_id) == 0)
goto end;
}
configuration_file = optarg;
break;
case 'c':
- if (!strcmp(optarg, "pipelining"))
+ if (strcmp(optarg, "pipelining") == 0)
pipelining = true;
- else if (!strcmp(optarg, "async"))
+ else if (strcmp(optarg, "async") == 0)
async = true;
- else if (!strcmp(optarg, "fragmentation"))
+ else if (strcmp(optarg, "fragmentation") == 0)
fragmentation = true;
else
fprintf(stderr, "WARNING: unsupported capability '%s'\n", optarg);
goto error;
}
- if (!strcmp(key, "scope")) {
+ if (strcmp(key, "scope") == 0) {
default_scopes = 0; /* at least a scope defined, unset default scopes */
if (!value)
goto error;
appctx->ctx.stats.flags &= ~PROMEX_FL_SCOPE_ALL;
else if (*value == '*')
appctx->ctx.stats.flags |= PROMEX_FL_SCOPE_ALL;
- else if (!strcmp(value, "global"))
+ else if (strcmp(value, "global") == 0)
appctx->ctx.stats.flags |= PROMEX_FL_SCOPE_GLOBAL;
- else if (!strcmp(value, "server"))
+ else if (strcmp(value, "server") == 0)
appctx->ctx.stats.flags |= PROMEX_FL_SCOPE_SERVER;
- else if (!strcmp(value, "backend"))
+ else if (strcmp(value, "backend") == 0)
appctx->ctx.stats.flags |= PROMEX_FL_SCOPE_BACK;
- else if (!strcmp(value, "frontend"))
+ else if (strcmp(value, "frontend") == 0)
appctx->ctx.stats.flags |= PROMEX_FL_SCOPE_FRONT;
else
goto error;
}
- else if (!strcmp(key, "no-maint"))
+ else if (strcmp(key, "no-maint") == 0)
appctx->ctx.stats.flags |= PROMEX_FL_NO_MAINT_SRV;
}
return;
list_for_each_entry(eng, &client->worker->engines, list) {
- if (!strcmp(eng->id, client->engine_id))
+ if (strcmp(eng->id, client->engine_id) == 0)
goto end;
}
server_port = atoi(optarg);
break;
case 'c':
- if (!strcmp(optarg, "pipelining"))
+ if (strcmp(optarg, "pipelining") == 0)
pipelining = true;
- else if (!strcmp(optarg, "async"))
+ else if (strcmp(optarg, "async") == 0)
async = true;
- else if (!strcmp(optarg, "fragmentation"))
+ else if (strcmp(optarg, "fragmentation") == 0)
fragmentation = true;
else
fprintf(stderr, "WARNING: unsupported capability '%s'\n", optarg);