<commit_before>diff --git a/deps/hiredis/Makefile redis/deps/hiredis/Makefile
index 2a84b9b..1225539 100644
--- a/deps/hiredis/Makefile
+++ redis/deps/hiredis/Makefile
@@ -26,6 +26,15 @@ ifeq ($(uname_S),Darwin)
   STLIBNAME?=libhiredis.a
   STLIB_MAKE_CMD?=libtool -static -o ${STLIBNAME} - ${OBJ}
 else
+ifeq ($(uname_S),Haiku)
+  CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF)
+  CCLINK?=-lroot -lnetwork
+  LDFLAGS?=-L. -Wl,-rpath,.
+  DYLIBNAME?=libhiredis.so
+  DYLIB_MAKE_CMD?=gcc -shared -Wl,-soname,${DYLIBNAME} -o ${DYLIBNAME} ${OBJ}
+  STLIBNAME?=libhiredis.a
+  STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ}
+else
   CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF)
   CCLINK?=-lm -pthread
   LDFLAGS?=-L. -Wl,-rpath,.
@@ -35,6 +44,7 @@ else
   STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ}
 endif
 endif
+endif
 
 CCOPT= $(CFLAGS) $(CCLINK)
 DEBUG?= -g -ggdb
diff --git a/src/Makefile redis/src/Makefile
index 292255c..e6a6d87 100644
--- a/src/Makefile
+++ redis/src/Makefile
@@ -15,12 +15,18 @@ endif
 ifeq ($(uname_S),SunOS)
   CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W -D__EXTENSIONS__ -D_XPG6
   CCLINK?=-ldl -lnsl -lsocket -lm -lpthread
-  DEBUG?=-g -ggdb 
+  DEBUG?=-g -ggdb
+else
+ifeq ($(uname_S),Haiku)
+  CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W $(ARCH) $(PROF)
+  CCLINK?=-lroot -lnetwork
+  DEBUG?=-g -ggdb
 else
   CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W $(ARCH) $(PROF)
   CCLINK?=-lm -pthread
   DEBUG?=-g -rdynamic -ggdb 
 endif
+endif
 
 ifeq ($(USE_TCMALLOC),yes)
   ALLOD_DEPS=
diff --git a/src/aof.c redis/src/aof.c
index dbd0468..7a5d21f 100644
--- a/src/aof.c
+++ redis/src/aof.c
@@ -25,7 +25,7 @@ void stopAppendOnly(void) {
         int statloc;
 
         if (kill(server.bgrewritechildpid,SIGKILL) != -1)
-            wait3(&statloc,0,NULL);
+            waitpid(&statloc,0,NULL);
         /* reset the buffer accumulating changes while the child saves */
         sdsfree(server.bgrewritebuf);
         server.bgrewritebuf = sdsempty();
diff --git a/src/redis.c redis/src/redis.c
index 1a1f84f..4ecc873 100644
--- a/src/redis.c
+++ redis/src/redis.c
@@ -646,7 +646,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
         int statloc;
         pid_t pid;
 
-        if ((pid = wait3(&statloc,WNOHANG,NULL)) != 0) {
+        if ((pid = waitpid(&statloc,WNOHANG,NULL)) != 0) {
             int exitcode = WEXITSTATUS(statloc);
             int bysignal = 0;
             
diff --git a/src/sha1.c redis/src/sha1.c
index 26a5565..e90812e 100644
--- a/src/sha1.c
+++ redis/src/sha1.c
@@ -27,6 +27,9 @@ A million repetitions of "a"
 #if defined(__sun)
 #include "solarisfixes.h"
 #endif
+#ifdef __HAIKU__
+#include <stdint.h>
+#endif
 #include "sha1.h"
 #include "config.h"
 
diff --git a/src/util.c redis/src/util.c
index f5a23af..2a6d18d 100644
--- a/src/util.c
+++ redis/src/util.c
@@ -317,7 +317,7 @@ int d2string(char *buf, size_t len, double value) {
          * integer printing function that is much faster. */
         double min = -4503599627370495; /* (2^52)-1 */
         double max = 4503599627370496; /* -(2^52) */
-        if (val > min && val < max && value == ((double)((long long)value)))
+        if (value > min && value < max && value == ((double)((long long)value)))
             len = ll2string(buf,len,(long long)value);
         else
 #endif
<commit_msg>should finally put patch in its place<commit_after>diff --git redis-2.9.0-git/deps/hiredis/Makefile redis-2.9.0-git/deps/hiredis/Makefile
index 2a84b9b..1225539 100644
--- redis-2.9.0-git/deps/hiredis/Makefile
+++ redis-2.9.0-git/deps/hiredis/Makefile
@@ -26,6 +26,15 @@ ifeq ($(uname_S),Darwin)
   STLIBNAME?=libhiredis.a
   STLIB_MAKE_CMD?=libtool -static -o ${STLIBNAME} - ${OBJ}
 else
+ifeq ($(uname_S),Haiku)
+  CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF)
+  CCLINK?=-lroot -lnetwork
+  LDFLAGS?=-L. -Wl,-rpath,.
+  DYLIBNAME?=libhiredis.so
+  DYLIB_MAKE_CMD?=gcc -shared -Wl,-soname,${DYLIBNAME} -o ${DYLIBNAME} ${OBJ}
+  STLIBNAME?=libhiredis.a
+  STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ}
+else
   CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF)
   CCLINK?=-lm -pthread
   LDFLAGS?=-L. -Wl,-rpath,.
@@ -35,6 +44,7 @@ else
   STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ}
 endif
 endif
+endif
 
 CCOPT= $(CFLAGS) $(CCLINK)
 DEBUG?= -g -ggdb
diff --git redis-2.9.0-git/src/Makefile redis-2.9.0-git/src/Makefile
index 292255c..e6a6d87 100644
--- redis-2.9.0-git/src/Makefile
+++ redis-2.9.0-git/src/Makefile
@@ -15,12 +15,18 @@ endif
 ifeq ($(uname_S),SunOS)
   CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W -D__EXTENSIONS__ -D_XPG6
   CCLINK?=-ldl -lnsl -lsocket -lm -lpthread
-  DEBUG?=-g -ggdb 
+  DEBUG?=-g -ggdb
+else
+ifeq ($(uname_S),Haiku)
+  CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W $(ARCH) $(PROF)
+  CCLINK?=-lroot -lnetwork
+  DEBUG?=-g -ggdb
 else
   CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W $(ARCH) $(PROF)
   CCLINK?=-lm -pthread
   DEBUG?=-g -rdynamic -ggdb 
 endif
+endif
 
 ifeq ($(USE_TCMALLOC),yes)
   ALLOD_DEPS=
diff --git redis-2.9.0-git/src/aof.c redis-2.9.0-git/src/aof.c
index dbd0468..7a5d21f 100644
--- redis-2.9.0-git/src/aof.c
+++ redis-2.9.0-git/src/aof.c
@@ -25,7 +25,7 @@ void stopAppendOnly(void) {
         int statloc;
 
         if (kill(server.bgrewritechildpid,SIGKILL) != -1)
-            wait3(&statloc,0,NULL);
+            waitpid(&statloc,0,NULL);
         /* reset the buffer accumulating changes while the child saves */
         sdsfree(server.bgrewritebuf);
         server.bgrewritebuf = sdsempty();
diff --git redis-2.9.0-git/src/redis.c redis-2.9.0-git/src/redis.c
index 1a1f84f..4ecc873 100644
--- redis-2.9.0-git/src/redis.c
+++ redis-2.9.0-git/src/redis.c
@@ -646,7 +646,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
         int statloc;
         pid_t pid;
 
-        if ((pid = wait3(&statloc,WNOHANG,NULL)) != 0) {
+        if ((pid = waitpid(&statloc,WNOHANG,NULL)) != 0) {
             int exitcode = WEXITSTATUS(statloc);
             int bysignal = 0;
             
diff --git redis-2.9.0-git/src/sha1.c redis-2.9.0-git/src/sha1.c
index 26a5565..e90812e 100644
--- redis-2.9.0-git/src/sha1.c
+++ redis-2.9.0-git/src/sha1.c
@@ -27,6 +27,9 @@ A million repetitions of "a"
 #if defined(__sun)
 #include "solarisfixes.h"
 #endif
+#ifdef __HAIKU__
+#include <stdint.h>
+#endif
 #include "sha1.h"
 #include "config.h"
 
diff --git redis-2.9.0-git/src/util.c redis-2.9.0-git/src/util.c
index f5a23af..2a6d18d 100644
--- redis-2.9.0-git/src/util.c
+++ redis-2.9.0-git/src/util.c
@@ -317,7 +317,7 @@ int d2string(char *buf, size_t len, double value) {
          * integer printing function that is much faster. */
         double min = -4503599627370495; /* (2^52)-1 */
         double max = 4503599627370496; /* -(2^52) */
-        if (val > min && val < max && value == ((double)((long long)value)))
+        if (value > min && value < max && value == ((double)((long long)value)))
             len = ll2string(buf,len,(long long)value);
         else
 #endif

{'fraction_non_alphanumeric': 0.18594476346732294, 'fraction_numerical': 0.0659010117582718, 'mean_word_length': 2.977705274605764, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1678607', 'n_tokens_mistral': 3419, 'n_tokens_neox': 3088, 'n_words': 596}