]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: Apply the coccinelle patch for `XXXcmp()` on include/
authorTim Duesterhus <tim@bastelstu.be>
Sat, 2 Jan 2021 21:31:54 +0000 (22:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 4 Jan 2021 09:09:02 +0000 (10:09 +0100)
Compare the various `XXXcmp()` functions against zero.

include/haproxy/action.h
include/haproxy/protobuf.h

index c5c0a6c4bc52241f083756b8b66d9a5fc9f7cda0..709d17c5f2e82948f32ccb038f58e2ee522f35c7 100644 (file)
@@ -43,7 +43,7 @@ static inline struct action_kw *action_lookup(struct list *keywords, const char
                        if (kw_list->kw[i].match_pfx &&
                            strncmp(kw, kw_list->kw[i].kw, strlen(kw_list->kw[i].kw)) == 0)
                                return &kw_list->kw[i];
-                       if (!strcmp(kw, kw_list->kw[i].kw))
+                       if (strcmp(kw, kw_list->kw[i].kw) == 0)
                                return &kw_list->kw[i];
                }
        }
index 7f46543e320860578629676ff3b72612bcb84bdc..cfcd95004eacc06eae6d8bd6ce8fd83391c1b422 100644 (file)
@@ -94,37 +94,37 @@ static inline uint64_t pbuf_le64toh(uint64_t v)
 int protobuf_type(const char *s)
 {
        /* varint types. */
-       if (!strcmp(s, "int32"))
+       if (strcmp(s, "int32") == 0)
                return PBUF_T_VARINT_INT32;
-       else if (!strcmp(s, "uint32"))
+       else if (strcmp(s, "uint32") == 0)
                return PBUF_T_VARINT_UINT32;
-       else if (!strcmp(s, "sint32"))
+       else if (strcmp(s, "sint32") == 0)
                return PBUF_T_VARINT_SINT32;
-       else if (!strcmp(s, "int64"))
+       else if (strcmp(s, "int64") == 0)
                return PBUF_T_VARINT_INT64;
-       else if (!strcmp(s, "uint64"))
+       else if (strcmp(s, "uint64") == 0)
                return PBUF_T_VARINT_UINT64;
-       else if (!strcmp(s, "sint64"))
+       else if (strcmp(s, "sint64") == 0)
                return PBUF_T_VARINT_SINT64;
-       else if (!strcmp(s, "bool"))
+       else if (strcmp(s, "bool") == 0)
                return PBUF_T_VARINT_BOOL;
-       else if (!strcmp(s, "enum"))
+       else if (strcmp(s, "enum") == 0)
                return PBUF_T_VARINT_ENUM;
 
        /* 32bit fixed size types. */
-       else if (!strcmp(s, "fixed32"))
+       else if (strcmp(s, "fixed32") == 0)
                return PBUF_T_32BIT_FIXED32;
-       else if (!strcmp(s, "sfixed32"))
+       else if (strcmp(s, "sfixed32") == 0)
                return PBUF_T_32BIT_SFIXED32;
-       else if (!strcmp(s, "float"))
+       else if (strcmp(s, "float") == 0)
                return PBUF_T_32BIT_FLOAT;
 
        /* 64bit fixed size types. */
-       else if (!strcmp(s, "fixed64"))
+       else if (strcmp(s, "fixed64") == 0)
                return PBUF_T_64BIT_FIXED64;
-       else if (!strcmp(s, "sfixed64"))
+       else if (strcmp(s, "sfixed64") == 0)
                return PBUF_T_64BIT_SFIXED64;
-       else if (!strcmp(s, "double"))
+       else if (strcmp(s, "double") == 0)
                return PBUF_T_64BIT_DOUBLE;
        else
                return -1;