Skip to content

Commit 9d3980b

Browse files
committed
handy.h: Add void * casts to memEQ, memNE
This change is to allow these macros to be called without having to do casting in the call.
1 parent 813cfad commit 9d3980b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

handy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@ based on the underlying C library functions):
507507
#define strnNE(s1,s2,l) (strncmp(s1,s2,l) != 0)
508508
#define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)
509509

510-
#define memNE(s1,s2,l) (memcmp(s1,s2,l) != 0)
511-
#define memEQ(s1,s2,l) (memcmp(s1,s2,l) == 0)
510+
#define memEQ(s1,s2,l) (memcmp(((const void *) (s1)), ((const void *) (s2)), l) == 0)
511+
#define memNE(s1,s2,l) (! memEQ(s1,s2,l))
512512

513513
/* memEQ and memNE where second comparand is a string constant */
514514
#define memEQs(s1, l, s2) \

0 commit comments

Comments
 (0)