fixes for zlib support, eliminated win32 FAR warnings and other warnings
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 30 May 2001 06:04:58 +0000 (06:04 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 30 May 2001 06:04:58 +0000 (06:04 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@219 d7cf8633-e32d-0410-b094-e92efae38249

common.c
in_win.c
quakeio.c
quakeio.h

index 142af2dc594ca73936bca2c4ccf60b0ba210c679..7b1fd49f4cce06d81a6d6a04d1a7c3a2eab3eec3 100644 (file)
--- a/common.c
+++ b/common.c
@@ -20,7 +20,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 // common.c -- misc functions used in client and server
 
 #include <fcntl.h>
-#ifndef WIN32
+#ifdef WIN32
+#include <io.h>
+#else
 #include <unistd.h>
 #endif
 #include <stdlib.h>
@@ -1550,7 +1552,7 @@ int COM_FindFile (char *filename, QFile **file, qboolean quiet, qboolean zip)
        int                             filenamelen;
 
        filenamelen = strlen (filename);
-       snprintf (gzfilename, sizeof (gzfilename), "%s.gz", filename);
+       sprintf (gzfilename, "%s.gz", filename);
 
        if (!file)
                Sys_Error ("COM_FindFile: file not set");
index 3114a90882dbe70bdcbd9e4b79a658ec84a9fb2a..5f0b731bc59759ae7e60d97466d342edebe16214 100644 (file)
--- a/in_win.c
+++ b/in_win.c
@@ -20,11 +20,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 // in_win.c -- windows 95 mouse and joystick code
 // 02/21/97 JCB Added extended DirectInput code to support external controllers.
 
-#include <dinput.h>
 #include "quakedef.h"
 #include "winquake.h"
 //#include "dosisms.h"
 
+#include <dinput.h>
+
 #define DINPUT_BUFFERSIZE           16
 #define iDirectInputCreate(a,b,c,d)    pDirectInputCreate(a,b,c,d)
 
index 710e856015dea1d79632ed6def52ac1b65d3d39d..9c75da1adb99c6ce25d2e49882ecd24e3644863c 100644 (file)
--- a/quakeio.c
+++ b/quakeio.c
@@ -28,6 +28,7 @@
        $Id$
 */
 
+#include "quakedef.h"
 #include <stdlib.h>
 #include <string.h>
 #ifdef WIN32
 # include <unistd.h>
 #endif
 
-#define HAVE_ZLIB
-
-#ifdef _MSC_VER
-# define _POSIX_
-#endif
+//#ifdef _MSC_VER
+//# define _POSIX_
+//#endif
 
 #include <stdarg.h>
 #include <stdlib.h>
 #include <limits.h>
 
-#include "QF/quakefs.h"
-#include "QF/quakeio.h"
+#ifndef PATH_MAX
+# define PATH_MAX 512
+#endif
+
+#include "quakeio.h"
 
 #ifdef WIN32
 # ifndef __BORLANDC__
index acb9a91577d77d563e04efe1e272c701d4a8be2c..d8319ba72c04a6959a83454ebd80fcdd5e1b102e 100644 (file)
--- a/quakeio.h
+++ b/quakeio.h
 #ifndef __quakeio_h
 #define __quakeio_h
 
+#define HAVE_ZLIB
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
 #include <stdio.h>
 
-#include <zlib.h>
+#ifdef HAVE_ZLIB
+# include <zlib.h>
+# ifdef WIN32
+#  undef FAR
+# endif
+#endif
 
 //#include "QF/gcc_attr.h"