diff --git a/src/aof.c b/src/aof.c index 1f615cf14ed08628b5e148c3a7a9a936b1a4f079..c92798c57f3d4b948db72745c9ca4171ea1487eb 100644 --- a/src/aof.c +++ b/src/aof.c @@ -3,6 +3,10 @@ #include #include #include +#include +#include +#include +#include /* Called when the user switches from "appendonly yes" to "appendonly no" * at runtime using the CONFIG command. */ diff --git a/src/debug.c b/src/debug.c index 10b620d6f3ade7c37115e29055cd73fbef75922f..ba183d7275414bc1ab70f1de56f39049412e2447 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1,6 +1,8 @@ #include "redis.h" #include "sha1.h" /* SHA1 is used for DEBUG DIGEST */ +#include + /* ================================= Debugging ============================== */ /* Compute the sha1 of string at 's' with 'len' bytes long. diff --git a/src/rdb.c b/src/rdb.c index 5bda5e5655514574bc45be42a9e09a3c74fb352e..509c70c307f378d417dedc4032ba4c59e9edcb7e 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -2,6 +2,11 @@ #include "lzf.h" /* LZF compression library */ #include +#include +#include +#include +#include +#include int rdbSaveType(FILE *fp, unsigned char type) { if (fwrite(&type,1,1,fp) == 0) return -1; diff --git a/src/redis.c b/src/redis.c index 5f539216f4e9bc2b1208d1132cba0a071ab61111..86536b4375a0ec0938da0b6b8691a62194efb819 100644 --- a/src/redis.c +++ b/src/redis.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -1443,8 +1442,10 @@ void *getMcontextEip(ucontext_t *uc) { #else return (void*) uc->uc_mcontext->__ss.__eip; #endif -#elif defined(__i386__) || defined(__X86_64__) || defined(__x86_64__) - return (void*) uc->uc_mcontext.gregs[REG_EIP]; /* Linux 32/64 bit */ +#elif defined(__i386__) + return (void*) uc->uc_mcontext.gregs[14]; /* Linux 32 */ +#elif defined(__X86_64__) || defined(__x86_64__) + return (void*) uc->uc_mcontext.gregs[16]; /* Linux 64 */ #elif defined(__ia64__) /* Linux IA64 */ return (void*) uc->uc_mcontext.sc_ip; #else diff --git a/src/redis.h b/src/redis.h index e54caa2a2233cbae245a5a73b0d362df3f0e82e5..545a3e0fdba45315cc1964d53402324327c070fb 100644 --- a/src/redis.h +++ b/src/redis.h @@ -15,6 +15,7 @@ #include #include #include +#include #include "ae.h" /* Event driven programming library */ #include "sds.h" /* Dynamic safe strings */ diff --git a/src/ziplist.c b/src/ziplist.c index 4b9d0fadcd15f9a1277e66ffb615ec29dde321fb..6c5827b9c7d4f3c0b80d405bd3b7c2574afdc1ea 100644 --- a/src/ziplist.c +++ b/src/ziplist.c @@ -551,7 +551,7 @@ void ziplistRepr(unsigned char *zl) { if (entry.encoding == ZIP_ENC_RAW) { fwrite(p,entry.len,1,stdout); } else { - printf("%lld", zipLoadInteger(p,entry.encoding)); + printf("%lld", (long long) zipLoadInteger(p,entry.encoding)); } printf("\n"); p += entry.len;