Added Ivos fixes for IA64.
authorFlorian Schulze <crow@icculus.org>
Wed, 13 Nov 2002 19:27:00 +0000 (19:27 +0000)
committerFlorian Schulze <crow@icculus.org>
Wed, 13 Nov 2002 19:27:00 +0000 (19:27 +0000)
dj.h
main.c
modify/Makefile
sdl/sound.c

diff --git a/dj.h b/dj.h
index 66a786e..f821a5b 100644 (file)
--- a/dj.h
+++ b/dj.h
@@ -69,7 +69,7 @@ typedef struct sfx_data {
   unsigned long length;
   char loop;
   unsigned long loop_start, loop_length;
-  char *buf;
+  unsigned char *buf;
 } sfx_data;
 
 typedef struct dj_mod_info {
diff --git a/main.c b/main.c
index 91b1b00..c5957f2 100644 (file)
--- a/main.c
+++ b/main.c
@@ -29,6 +29,9 @@
 
 #include "globals.h"
 #include <fcntl.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
 
 #ifdef USE_NET
 #include "SDL_net.h"
index 2d4822b..9286e02 100644 (file)
@@ -1,6 +1,6 @@
 CFLAGS = -Wall -ansi -pedantic -O2 -ffast-math -funroll-loops \
        -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNDEBUG \
-       -I. -I.. -DUSE_NET
+       -I. -I.. -DUSE_NET -D_BSD_SOURCE
 LIBS = -lm
 SRCS = gobpack.c jnbpack.c jnbunpack.c
 OBJS = gobpack.o jnbpack.o jnbunpack.o
index 19cd97f..48d7b72 100644 (file)
@@ -29,6 +29,9 @@
 
 #include "globals.h"
 #include <limits.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
 #include "SDL.h"
 
 #ifndef NO_SDL_MIXER
@@ -208,12 +211,13 @@ void mix_sound(void *unused, Uint8 *stream, int len)
                                channelinfo[chan].stepremainder &= 0xffff;
 
                                /* Check whether we are done. */
-                               if (channelinfo[chan].data >= channelinfo[chan].enddata)
+                               if (channelinfo[chan].data >= channelinfo[chan].enddata) {
                                        if (channelinfo[chan].loop) {
                                                channelinfo[chan].data = channelinfo[chan].startdata;
                                        } else {
                                                stopchan(chan);
                                        }
+                               }
                        }
                }
   
@@ -468,7 +472,7 @@ char dj_ready_mod(char mod_num)
 # else
        char filename[] = "/tmp/jnb.tmpmusic.mod";
 # endif
-       char *fp;
+       unsigned char *fp;
        int len;
 
        if (main_info.no_sound)