From 86ef9fce7517313570838ca8e853132876035611 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 7 Jan 2018 11:14:46 +0100 Subject: Change return code of string comparison functions to bool These functions were returning 0 or 1 anyway. Signed-off-by: Berthold Stoeger --- core/dive.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/dive.h b/core/dive.h index d956dfeb3..cd48aee30 100644 --- a/core/dive.h +++ b/core/dive.h @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -27,17 +28,17 @@ #define IS_FP_SAME(_a, _b) (fabs((_a) - (_b)) <= 0.000001 * MAX(fabs(_a), fabs(_b))) -static inline int same_string(const char *a, const char *b) +static inline bool same_string(const char *a, const char *b) { return !strcmp(a ?: "", b ?: ""); } -static inline int same_string_caseinsensitive(const char *a, const char *b) +static inline bool same_string_caseinsensitive(const char *a, const char *b) { return !strcasecmp(a ?: "", b ?: ""); } -static inline int includes_string_caseinsensitive(const char *haystack, const char *needle) +static inline bool includes_string_caseinsensitive(const char *haystack, const char *needle) { if (!needle) return 1; /* every string includes the NULL string */ @@ -66,8 +67,6 @@ static inline char *copy_string(const char *s) #ifdef __cplusplus extern "C" { -#else -#include #endif extern int last_xml_version; -- cgit v1.2.3-70-g09d2