This reapplies strcmp.cocci across the whole src/ tree.
---
 src/event_hdl.c | 2 +-
 src/hlua_fcn.c  | 8 ++++----
 src/sample.c    | 2 +-
 src/tcp_act.c   | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/event_hdl.c b/src/event_hdl.c
index f5bb5b6e7e..f4f7b19e4d 100644
--- a/src/event_hdl.c
+++ b/src/event_hdl.c
@@ -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;
diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
index a13e0f5f41..7aaab3a381 100644
--- a/src/hlua_fcn.c
+++ b/src/hlua_fcn.c
@@ -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);
diff --git a/src/sample.c b/src/sample.c
index cbb959161b..8f46d31b96 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -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;
        }
diff --git a/src/tcp_act.c b/src/tcp_act.c
index 1cefc90dcd..a88fab4afe 100644
--- a/src/tcp_act.c
+++ b/src/tcp_act.c
@@ -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
-- 
2.43.2


Reply via email to