summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-01-07 11:14:46 +0100
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-01-11 06:07:13 +0100
commit86ef9fce7517313570838ca8e853132876035611 (patch)
tree10a6ef4e0f0ef01ed070b7d5237e0fb4e3febeca
parent34bc4fc0af953723fd42c4ffc0b0a8bf1cf68b22 (diff)
downloadsubsurface-86ef9fce7517313570838ca8e853132876035611.tar.gz
Change return code of string comparison functions to bool
These functions were returning 0 or 1 anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--core/dive.h9
1 files 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 <stdlib.h>
#include <stdint.h>
+#include <stdbool.h>
#include <time.h>
#include <math.h>
#include <zip.h>
@@ -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 <stdbool.h>
#endif
extern int last_xml_version;