diff options
author | antirez <antirez@gmail.com> | 2013-08-19 14:54:31 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-08-19 14:54:56 +0200 |
commit | 6b60a80ec1b740fc030ef5decff6bd5904993972 (patch) | |
tree | 3b45f50e54aeac18de9ec76ca54e5e41d9887bb7 | |
parent | c334bb3dcdb38330770b09e8ec92ba10c448024c (diff) | |
download | redis-issue-1240.tar.gz |
assert.h replaced with redisassert.h when appropriate.issue-1240
Also a warning was suppressed by including unistd.h in redisassert.h
(needed for _exit()).
-rw-r--r-- | src/dict.c | 2 | ||||
-rw-r--r-- | src/pqsort.c | 1 | ||||
-rw-r--r-- | src/redisassert.h | 4 | ||||
-rw-r--r-- | src/ziplist.c | 2 | ||||
-rw-r--r-- | src/zipmap.c | 1 |
5 files changed, 5 insertions, 5 deletions
diff --git a/src/dict.c b/src/dict.c index ad95d7498..dd4156d2f 100644 --- a/src/dict.c +++ b/src/dict.c @@ -39,13 +39,13 @@ #include <stdlib.h> #include <string.h> #include <stdarg.h> -#include <assert.h> #include <limits.h> #include <sys/time.h> #include <ctype.h> #include "dict.h" #include "zmalloc.h" +#include "redisassert.h" /* Using dictEnableResize() / dictDisableResize() we make possible to * enable/disable resizing of the hash table as needed. This is very important diff --git a/src/pqsort.c b/src/pqsort.c index 57c217f94..7325a88a4 100644 --- a/src/pqsort.c +++ b/src/pqsort.c @@ -39,7 +39,6 @@ #include <sys/types.h> -#include <assert.h> #include <errno.h> #include <stdlib.h> diff --git a/src/redisassert.h b/src/redisassert.h index e2cf47cb5..e5825c0f5 100644 --- a/src/redisassert.h +++ b/src/redisassert.h @@ -38,7 +38,9 @@ #ifndef __REDIS_ASSERT_H__ #define __REDIS_ASSERT_H__ -#define redisAssert(_e) ((_e)?(void)0 : (_redisAssert(#_e,__FILE__,__LINE__),_exit(1))) +#include <unistd.h> /* for _exit() */ + +#define assert(_e) ((_e)?(void)0 : (_redisAssert(#_e,__FILE__,__LINE__),_exit(1))) void _redisAssert(char *estr, char *file, int line); diff --git a/src/ziplist.c b/src/ziplist.c index fdfc2e9ce..d78f8f5da 100644 --- a/src/ziplist.c +++ b/src/ziplist.c @@ -105,12 +105,12 @@ #include <stdlib.h> #include <string.h> #include <stdint.h> -#include <assert.h> #include <limits.h> #include "zmalloc.h" #include "util.h" #include "ziplist.h" #include "endianconv.h" +#include "redisassert.h" #define ZIP_END 255 #define ZIP_BIGLEN 254 diff --git a/src/zipmap.c b/src/zipmap.c index d9b7c8b31..3cd56e5ff 100644 --- a/src/zipmap.c +++ b/src/zipmap.c @@ -78,7 +78,6 @@ #include <stdio.h> #include <string.h> -#include <assert.h> #include "zmalloc.h" #include "endianconv.h" |