mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-17 11:10:42 +00:00
CLEANUP: Reapply strcmp.cocci (2)
This reapplies strcmp.cocci across the whole src/ tree.
This commit is contained in:
parent
cd5d62249f
commit
f88ea5949c
@ -138,7 +138,7 @@ struct event_hdl_sub_type event_hdl_string_to_sub_type(const char *name)
|
||||
int it;
|
||||
|
||||
for (it = 0; it < (int)(sizeof(event_hdl_sub_type_map) / sizeof(event_hdl_sub_type_map[0])); it++) {
|
||||
if (!strcmp(name, event_hdl_sub_type_map[it].name))
|
||||
if (strcmp(name, event_hdl_sub_type_map[it].name) == 0)
|
||||
return event_hdl_sub_type_map[it].type;
|
||||
}
|
||||
return EVENT_HDL_SUB_NONE;
|
||||
|
@ -1329,14 +1329,14 @@ static int hlua_server_index(struct lua_State *L)
|
||||
{
|
||||
const char *key = lua_tostring(L, 2);
|
||||
|
||||
if (!strcmp(key, "name")) {
|
||||
if (strcmp(key, "name") == 0) {
|
||||
if (ONLY_ONCE())
|
||||
ha_warning("hlua: use of server 'name' attribute is deprecated and will eventually be removed, please use get_name() function instead: %s\n", hlua_traceback(L, ", "));
|
||||
lua_pushvalue(L, 1);
|
||||
hlua_server_get_name(L);
|
||||
return 1;
|
||||
}
|
||||
if (!strcmp(key, "puid")) {
|
||||
if (strcmp(key, "puid") == 0) {
|
||||
if (ONLY_ONCE())
|
||||
ha_warning("hlua: use of server 'puid' attribute is deprecated and will eventually be removed, please use get_puid() function instead: %s\n", hlua_traceback(L, ", "));
|
||||
lua_pushvalue(L, 1);
|
||||
@ -1980,14 +1980,14 @@ static int hlua_proxy_index(struct lua_State *L)
|
||||
{
|
||||
const char *key = lua_tostring(L, 2);
|
||||
|
||||
if (!strcmp(key, "name")) {
|
||||
if (strcmp(key, "name") == 0) {
|
||||
if (ONLY_ONCE())
|
||||
ha_warning("hlua: use of proxy 'name' attribute is deprecated and will eventually be removed, please use get_name() function instead: %s\n", hlua_traceback(L, ", "));
|
||||
lua_pushvalue(L, 1);
|
||||
hlua_proxy_get_name(L);
|
||||
return 1;
|
||||
}
|
||||
if (!strcmp(key, "uuid")) {
|
||||
if (strcmp(key, "uuid") == 0) {
|
||||
if (ONLY_ONCE())
|
||||
ha_warning("hlua: use of proxy 'uuid' attribute is deprecated and will eventually be removed, please use get_uuid() function instead: %s\n", hlua_traceback(L, ", "));
|
||||
lua_pushvalue(L, 1);
|
||||
|
@ -69,7 +69,7 @@ int type_to_smp(const char *type)
|
||||
int it = 0;
|
||||
|
||||
while (it < SMP_TYPES) {
|
||||
if (!strcmp(type, smp_to_type[it]))
|
||||
if (strcmp(type, smp_to_type[it]) == 0)
|
||||
break; // found
|
||||
it += 1;
|
||||
}
|
||||
|
@ -678,7 +678,7 @@ static enum act_parse_ret tcp_parse_set_mark(const char **args, int *orig_arg, s
|
||||
}
|
||||
|
||||
/* Register processing function. */
|
||||
if (!strcmp("set-bc-mark", args[cur_arg - 1]))
|
||||
if (strcmp("set-bc-mark", args[cur_arg - 1]) == 0)
|
||||
rule->action_ptr = tcp_action_set_bc_mark;
|
||||
else
|
||||
rule->action_ptr = tcp_action_set_fc_mark; // fc mark
|
||||
@ -740,7 +740,7 @@ static enum act_parse_ret tcp_parse_set_tos(const char **args, int *orig_arg, st
|
||||
}
|
||||
|
||||
/* Register processing function. */
|
||||
if (!strcmp("set-bc-tos", args[cur_arg - 1]))
|
||||
if (strcmp("set-bc-tos", args[cur_arg - 1]) == 0)
|
||||
rule->action_ptr = tcp_action_set_bc_tos;
|
||||
else
|
||||
rule->action_ptr = tcp_action_set_fc_tos; // fc tos
|
||||
|
Loading…
Reference in New Issue
Block a user