Fixed compilation in mac os x snow leopard when compiling a 32 bit binary.

This commit is contained in:
antirez 2009-10-23 01:36:10 +02:00
parent 1812e0246c
commit cb7e07cc63
2 changed files with 10 additions and 2 deletions

2
TODO
View File

@ -3,6 +3,8 @@ Pre 1.1 todo
* For now only the last argument gets integer encoded, so make sure that: 1) every multi bulk commands implemented will have the last arg that is indeed a value, and not used otherwise. 2) to explicitly call the function to encode the object in MSET and other commands where there are multiple "values". * For now only the last argument gets integer encoded, so make sure that: 1) every multi bulk commands implemented will have the last arg that is indeed a value, and not used otherwise. 2) to explicitly call the function to encode the object in MSET and other commands where there are multiple "values".
* Man pages for MSET MSETNX and SRANDMEMBER. * Man pages for MSET MSETNX and SRANDMEMBER.
* Hashes (HSET, HGET, HEXISTS, HLEN, ...). * Hashes (HSET, HGET, HEXISTS, HLEN, ...).
* ZSETs
* An utility able to export an .rdb file into a text-only JSON dump, we can't live anymore without such a tool. Probably an extension to redis-cli.
After 1.1 todo After 1.1 todo

10
redis.c
View File

@ -307,7 +307,7 @@ typedef struct _redisSortOperation {
typedef struct zset { typedef struct zset {
dict *dict; dict *dict;
tree *tree; /* tree *tree; */
} zset; } zset;
struct sharedObjectsStruct { struct sharedObjectsStruct {
@ -639,11 +639,13 @@ static void redisLog(int level, const char *fmt, ...) {
* keys and radis objects as values (objects can hold SDS strings, * keys and radis objects as values (objects can hold SDS strings,
* lists, sets). */ * lists, sets). */
#if 0
static void dictVanillaFree(void *privdata, void *val) static void dictVanillaFree(void *privdata, void *val)
{ {
DICT_NOTUSED(privdata); DICT_NOTUSED(privdata);
zfree(val); zfree(val);
} }
#endif
static int sdsDictKeyCompare(void *privdata, const void *key1, static int sdsDictKeyCompare(void *privdata, const void *key1,
const void *key2) const void *key2)
@ -721,6 +723,7 @@ static dictType setDictType = {
NULL /* val destructor */ NULL /* val destructor */
}; };
#if 0
static dictType zsetDictType = { static dictType zsetDictType = {
dictEncObjHash, /* hash function */ dictEncObjHash, /* hash function */
NULL, /* key dup */ NULL, /* key dup */
@ -729,6 +732,7 @@ static dictType zsetDictType = {
dictRedisObjectDestructor, /* key destructor */ dictRedisObjectDestructor, /* key destructor */
dictVanillaFree /* val destructor */ dictVanillaFree /* val destructor */
}; };
#endif
static dictType hashDictType = { static dictType hashDictType = {
dictObjHash, /* hash function */ dictObjHash, /* hash function */
@ -1831,11 +1835,13 @@ static robj *createSetObject(void) {
return createObject(REDIS_SET,d); return createObject(REDIS_SET,d);
} }
#if 0
static robj *createZsetObject(void) { static robj *createZsetObject(void) {
dict *d = dictCreate(&zsetDictType,NULL); dict *d = dictCreate(&zsetDictType,NULL);
if (!d) oom("dictCreate"); if (!d) oom("dictCreate");
return createObject(REDIS_ZSET,d); return createObject(REDIS_ZSET,d);
} }
#endif
static void freeStringObject(robj *o) { static void freeStringObject(robj *o) {
if (o->encoding == REDIS_ENCODING_RAW) { if (o->encoding == REDIS_ENCODING_RAW) {
@ -4745,7 +4751,7 @@ static void *getMcontextEip(ucontext_t *uc) {
#elif defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6) #elif defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
return (void*) uc->uc_mcontext->__ss.__eip; return (void*) uc->uc_mcontext->__ss.__eip;
#elif defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6) #elif defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6)
#ifdef _STRUCT_X86_THREAD_STATE64 #if defined(_STRUCT_X86_THREAD_STATE64) && !defined(__i386__)
return (void*) uc->uc_mcontext->__ss.__rip; return (void*) uc->uc_mcontext->__ss.__rip;
#else #else
return (void*) uc->uc_mcontext->__ss.__eip; return (void*) uc->uc_mcontext->__ss.__eip;