Skip to content

Commit

Permalink
assert.h replaced with redisassert.h when appropriate.
Browse files Browse the repository at this point in the history
Also a warning was suppressed by including unistd.h in redisassert.h
(needed for _exit()).
  • Loading branch information
antirez committed Aug 19, 2013
1 parent 85070a3 commit e16dd1d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/dict.c
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/pqsort.c
Expand Up @@ -39,7 +39,6 @@

#include <sys/types.h>

#include <assert.h>
#include <errno.h>
#include <stdlib.h>

Expand Down
4 changes: 3 additions & 1 deletion src/redisassert.h
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/ziplist.c
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/zipmap.c
Expand Up @@ -78,7 +78,6 @@

#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "zmalloc.h"
#include "endianconv.h"

Expand Down

0 comments on commit e16dd1d

Please sign in to comment.