From 7540096351b86e7bb497934b427086e606fe42c1 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 23 Mar 2017 19:38:04 -0600 Subject: [PATCH] handy.h: Make uniform the defns of strFOO, memFOO For consistency --- handy.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/handy.h b/handy.h index c38d15a..c3f5bbe 100644 --- a/handy.h +++ b/handy.h @@ -466,20 +466,20 @@ Returns zero if non-equal, or non-zero if equal. */ -#define strNE(s1,s2) (strcmp(s1,s2)) -#define strEQ(s1,s2) (!strcmp(s1,s2)) +#define strNE(s1,s2) (strcmp(s1,s2) != 0) +#define strEQ(s1,s2) (strcmp(s1,s2) == 0) #define strLT(s1,s2) (strcmp(s1,s2) < 0) #define strLE(s1,s2) (strcmp(s1,s2) <= 0) #define strGT(s1,s2) (strcmp(s1,s2) > 0) #define strGE(s1,s2) (strcmp(s1,s2) >= 0) -#define strnNE(s1,s2,l) (strncmp(s1,s2,l)) -#define strnEQ(s1,s2,l) (!strncmp(s1,s2,l)) +#define strnNE(s1,s2,l) (strncmp(s1,s2,l) != 0) +#define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0) #define strBEGINs(s1,s2) (strncmp(s1,"" s2 "", sizeof(s2)-1) == 0) -#define memNE(s1,s2,l) (memcmp(s1,s2,l)) -#define memEQ(s1,s2,l) (!memcmp(s1,s2,l)) +#define memNE(s1,s2,l) (memcmp(s1,s2,l) != 0) +#define memEQ(s1,s2,l) (memcmp(s1,s2,l) == 0) /* memEQ and memNE where second comparand is a string constant */ #define memEQs(s1, l, s2) \ -- 1.8.3.1