CLEANUP: Apply the coccinelle patch for `XXXcmp()` on include/

Compare the various `XXXcmp()` functions against zero.
This commit is contained in:
Tim Duesterhus 2021-01-02 22:31:54 +01:00 committed by Willy Tarreau
parent e5ff14100a
commit 54182ec9d7
2 changed files with 15 additions and 15 deletions

View 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];
}
}

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