]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
UNMERGE
authorhavoc havoc@d7cf8633-e32d-0410-b094-e92efae38249 <>
Thu, 19 Aug 2010 14:38:49 +0000 (14:38 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 24 Sep 2010 20:00:32 +0000 (22:00 +0200)
fix almost all g++ -pedantic warnings

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10402 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::unmerge=0f80ff51ff9f369233d17b3377d3a0d34b4c8e5a

46 files changed:
bih.h
cap_ogg.c
cl_parse.c
cl_screen.c
cl_video.c
client.h
cmd.c
common.c
common.h
csprogs.c
cvar.c
cvar.h
dpvsimpledecode.c
dpvsimpledecode.h
draw.h
filematch.c
gl_backend.c
gl_textures.c
glquake.h
host_cmd.c
image_png.c
lhnet.c
lhnet.h
libcurl.c
menu.c
menu.h
model_brush.c
model_shared.h
mvm_cmds.c
progsvm.h
prvm_cmds.c
prvm_edict.c
prvm_exec.c
r_modules.c
r_modules.h
r_shadow.c
r_textures.h
render.h
snd_ogg.c
snd_wav.c
sv_main.c
svvm_cmds.c
sys_linux.c
sys_shared.c
vid.h
vid_wgl.c

diff --git a/bih.h b/bih.h
index 810cf9ca9e87ad7e53be86ec7c5c333d6c4a7187..90ec71db7744c887f328ed51730586475443eeeb 100644 (file)
--- a/bih.h
+++ b/bih.h
@@ -9,7 +9,7 @@
 typedef enum biherror_e
 {
        BIHERROR_OK, // no error, be happy
-       BIHERROR_OUT_OF_NODES // could not produce complete hierarchy, maxnodes too low (should be roughly half of numleafs)
+       BIHERROR_OUT_OF_NODES, // could not produce complete hierarchy, maxnodes too low (should be roughly half of numleafs)
 }
 biherror_t;
 
@@ -17,7 +17,7 @@ typedef enum bih_nodetype_e
 {
        BIH_SPLITX = 0,
        BIH_SPLITY = 1,
-       BIH_SPLITZ = 2
+       BIH_SPLITZ = 2,
 }
 bih_nodetype_t;
 
@@ -25,7 +25,7 @@ typedef enum bih_leaftype_e
 {
        BIH_BRUSH = 3,
        BIH_COLLISIONTRIANGLE = 4,
-       BIH_RENDERTRIANGLE = 5
+       BIH_RENDERTRIANGLE = 5,
 }
 bih_leaftype_t;
 
index 3318c356c4119bb34e0465ed7307d3c4de7aa568..b3c29023c70053dec2d479d6894529a39d465abe 100644 (file)
--- a/cap_ogg.c
+++ b/cap_ogg.c
@@ -345,7 +345,7 @@ typedef enum {
   OC_PF_420,    /**< Chroma subsampling by 2 in each direction (4:2:0) */
   OC_PF_RSVD,   /**< Reserved value */
   OC_PF_422,    /**< Horizonatal chroma subsampling by 2 (4:2:2) */
-  OC_PF_444     /**< No chroma subsampling at all (4:4:4) */
+  OC_PF_444,    /**< No chroma subsampling at all (4:4:4) */
 } theora_pixelformat;
 /**
  * Theora bitstream info.
index 72e377da5158a02dea3e9604e93e35969d0f8aa8..0c6d1c314a8ef75ce4dae07c825b16ebca0e8868 100644 (file)
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "libcurl.h"
 #include "utf8lib.h"
 
-const char *svc_strings[128] =
+char *svc_strings[128] =
 {
        "svc_bad",
        "svc_nop",
@@ -100,7 +100,7 @@ const char *svc_strings[128] =
        "svc_pointparticles1", //       62              // [short] effectnum [vector] start, same as svc_pointparticles except velocity is zero and count is 1
 };
 
-const char *qw_svc_strings[128] =
+char *qw_svc_strings[128] =
 {
        "qw_svc_bad",                                   // 0
        "qw_svc_nop",                                   // 1
@@ -3288,7 +3288,7 @@ void CL_ParseServerMessage(void)
        int                     i;
        protocolversion_t protocol;
        unsigned char           cmdlog[32];
-       const char              *cmdlogname[32], *temp;
+       char            *cmdlogname[32], *temp;
        int                     cmdindex, cmdcount = 0;
        qboolean        qwplayerupdatereceived;
        qboolean        strip_pqc;
index 3236056d73eb89402f59bd718e82aabae6dcada1..5dbf4d2100b4b372fb31f67b82b7cc85f4343b13 100644 (file)
@@ -696,7 +696,7 @@ int speedstringcount, r_timereport_active;
 double r_timereport_temp = 0, r_timereport_current = 0, r_timereport_start = 0;
 int r_speeds_longestitem = 0;
 
-void R_TimeReport(const char *desc)
+void R_TimeReport(char *desc)
 {
        char tempbuf[256];
        int length;
@@ -1314,7 +1314,7 @@ Grab six views for environment mapping tests
 struct envmapinfo_s
 {
        float angles[3];
-       const char *name;
+       char *name;
        qboolean flipx, flipy, flipdiagonaly;
 }
 envmapinfo[12] =
index 59a5b6031c9713d5a85c05704f770d9ee1237b1b..a6a5e0ea5262b9f6a65c8535408e8dec90cc1953 100644 (file)
@@ -34,7 +34,7 @@ static clvideo_t *FindUnusedVid( void )
 
 static qboolean OpenStream( clvideo_t * video )
 {
-       const char *errorstring;
+       char *errorstring;
        video->stream = dpvsimpledecode_open( video->filename, &errorstring);
        if (!video->stream )
        {
index 2ab8079c991786b1683073dfa8fe5fe06695b319..b90ca35b512c6e821db2613fb9b1ed92a095a408 100644 (file)
--- a/client.h
+++ b/client.h
@@ -537,7 +537,7 @@ qw_downloadtype_t;
 typedef enum capturevideoformat_e
 {
        CAPTUREVIDEOFORMAT_AVI_I420,
-       CAPTUREVIDEOFORMAT_OGG_VORBIS_THEORA
+       CAPTUREVIDEOFORMAT_OGG_VORBIS_THEORA,
 }
 capturevideoformat_t;
 
diff --git a/cmd.c b/cmd.c
index 995473c6e6936a60695b13e8b1ac06d5fd28e1e9..18cb6a13fc366e63cf2ba34bc2e0bbfc17cb2cad 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -857,7 +857,6 @@ static const char *Cmd_GetCvarValue(const char *var, size_t varlen, cmdalias_t *
        static char varval[MAX_INPUTLINE];
        const char *varstr;
        char *varfunc;
-static char asis[] = "asis"; // just to suppress const char warnings
 
        if(varlen >= MAX_INPUTLINE)
                varlen = MAX_INPUTLINE - 1;
@@ -888,7 +887,7 @@ static char asis[] = "asis"; // just to suppress const char warnings
                varstr = Cmd_GetDirectCvarValue(varname, alias, &is_multiple);
                if(is_multiple)
                        if(!varfunc)
-                               varfunc = asis;
+                               varfunc = "asis";
        }
 
        if(!varstr)
index 9615b5a76997f36ed419142af73ef0e9d28095be..8c5e7dbd3df812de7b3d23f3a09224ebedb1ebd6 100644 (file)
--- a/common.c
+++ b/common.c
@@ -606,7 +606,7 @@ void SZ_Write (sizebuf_t *buf, const unsigned char *data, int length)
 // attention, it has been eradicated from here, its only (former) use in
 // all of darkplaces.
 
-static const char *hexchar = "0123456789ABCDEF";
+static char *hexchar = "0123456789ABCDEF";
 void Com_HexDumpToConsole(const unsigned char *data, int size)
 {
        int i, j, n;
@@ -1999,6 +1999,8 @@ void InfoString_GetValue(const char *buffer, const char *key, char *value, size_
        size_t keylength;
        if (!key)
                key = "";
+       if (!value)
+               value = "";
        keylength = strlen(key);
        if (valuelength < 1 || !value)
        {
index 0902ca775be323de68360f7b1bd331c229cf9f6f..104521fbf2b84b1951ee8bc5773f903e38a1edab 100644 (file)
--- a/common.h
+++ b/common.h
@@ -134,7 +134,7 @@ typedef enum protocolversion_e
        PROTOCOL_QUAKEWORLD, ///< quakeworld protocol
        PROTOCOL_NEHAHRABJP, ///< same as QUAKEDP but with 16bit modelindex
        PROTOCOL_NEHAHRABJP2, ///< same as NEHAHRABJP but with 16bit soundindex
-       PROTOCOL_NEHAHRABJP3 ///< same as NEHAHRABJP2 but with some changes
+       PROTOCOL_NEHAHRABJP3, ///< same as NEHAHRABJP2 but with some changes
 }
 protocolversion_t;
 
index 33f2987f5b1f72cea8a45ee3d26d2f43affc787e..8aac1a184020018c44f3ed34f0e533f3111b2053 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -30,7 +30,7 @@ void CL_VM_PreventInformationLeaks(void)
 }
 
 //[515]: these are required funcs
-static const char *cl_required_func[] =
+static char *cl_required_func[] =
 {
        "CSQC_Init",
        "CSQC_InputEvent",
diff --git a/cvar.c b/cvar.c
index 4696034acd21f58773313dc500add16f2f38f03e..c6f69360825f07765f71b485561f40370f17ae09 100644 (file)
--- a/cvar.c
+++ b/cvar.c
@@ -21,11 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "quakedef.h"
 
-const char *cvar_dummy_description = "custom cvar";
+char *cvar_dummy_description = "custom cvar";
 
 cvar_t *cvar_vars = NULL;
 cvar_t *cvar_hashtable[CVAR_HASHSIZE];
-const char *cvar_null_string = "";
+char *cvar_null_string = "";
 
 /*
 ============
@@ -324,11 +324,11 @@ void Cvar_SetQuick_Internal (cvar_t *var, const char *value)
        valuelen = strlen(value);
        if (!var->string || strlen(var->string) != valuelen)
        {
-               Z_Free ((char *)var->string);   // free the old value string
+               Z_Free (var->string);   // free the old value string
 
                var->string = (char *)Z_Malloc (valuelen + 1);
        }
-       memcpy ((char *)var->string, value, valuelen + 1);
+       memcpy (var->string, value, valuelen + 1);
        var->value = atof (var->string);
        var->integer = (int) var->value;
        if ((var->flags & CVAR_NOTIFY) && changed && sv.active)
@@ -504,7 +504,7 @@ void Cvar_RegisterVariable (cvar_t *variable)
 
                        // get rid of old allocated cvar
                        // (but not cvar->string and cvar->defstring, because we kept those)
-                       Z_Free((char *)cvar->name);
+                       Z_Free(cvar->name);
                        Z_Free(cvar);
                }
                else
@@ -520,12 +520,12 @@ void Cvar_RegisterVariable (cvar_t *variable)
        }
 
 // copy the value off, because future sets will Z_Free it
-       oldstr = (char *)variable->string;
+       oldstr = variable->string;
        alloclen = strlen(variable->string) + 1;
        variable->string = (char *)Z_Malloc (alloclen);
-       memcpy ((char *)variable->string, oldstr, alloclen);
+       memcpy (variable->string, oldstr, alloclen);
        variable->defstring = (char *)Z_Malloc (alloclen);
-       memcpy ((char *)variable->defstring, oldstr, alloclen);
+       memcpy (variable->defstring, oldstr, alloclen);
        variable->value = atof (variable->string);
        variable->integer = (int) variable->value;
 
@@ -571,13 +571,13 @@ cvar_t *Cvar_Get (const char *name, const char *value, int flags, const char *ne
                if(newdescription && (cvar->flags & CVAR_ALLOCATED))
                {
                        if(cvar->description != cvar_dummy_description)
-                               Z_Free((char *)cvar->description);
+                               Z_Free(cvar->description);
 
                        if(*newdescription)
                        {
                                alloclen = strlen(newdescription) + 1;
                                cvar->description = (char *)Z_Malloc(alloclen);
-                               memcpy((char *)cvar->description, newdescription, alloclen);
+                               memcpy(cvar->description, newdescription, alloclen);
                        }
                        else
                                cvar->description = cvar_dummy_description;
@@ -606,12 +606,12 @@ cvar_t *Cvar_Get (const char *name, const char *value, int flags, const char *ne
        cvar->flags = flags | CVAR_ALLOCATED;
        alloclen = strlen(name) + 1;
        cvar->name = (char *)Z_Malloc(alloclen);
-       memcpy((char *)cvar->name, name, alloclen);
+       memcpy(cvar->name, name, alloclen);
        alloclen = strlen(value) + 1;
        cvar->string = (char *)Z_Malloc(alloclen);
-       memcpy((char *)cvar->string, value, alloclen);
+       memcpy(cvar->string, value, alloclen);
        cvar->defstring = (char *)Z_Malloc(alloclen);
-       memcpy((char *)cvar->defstring, value, alloclen);
+       memcpy(cvar->defstring, value, alloclen);
        cvar->value = atof (cvar->string);
        cvar->integer = (int) cvar->value;
 
@@ -619,7 +619,7 @@ cvar_t *Cvar_Get (const char *name, const char *value, int flags, const char *ne
        {
                alloclen = strlen(newdescription) + 1;
                cvar->description = (char *)Z_Malloc(alloclen);
-               memcpy((char *)cvar->description, newdescription, alloclen);
+               memcpy(cvar->description, newdescription, alloclen);
        }
        else
                cvar->description = cvar_dummy_description; // actually checked by VM_cvar_type
@@ -702,10 +702,10 @@ void Cvar_LockDefaults_f (void)
 
                        //Con_Printf("locking cvar %s (%s -> %s)\n", var->name, var->string, var->defstring);
                        var->flags |= CVAR_DEFAULTSET;
-                       Z_Free((char *)var->defstring);
+                       Z_Free(var->defstring);
                        alloclen = strlen(var->string) + 1;
                        var->defstring = (char *)Z_Malloc(alloclen);
-                       memcpy((char *)var->defstring, var->string, alloclen);
+                       memcpy(var->defstring, var->string, alloclen);
                }
        }
 }
@@ -912,11 +912,11 @@ void Cvar_Del_f (void)
                        *link = cvar->nextonhashchain;
 
                if(cvar->description != cvar_dummy_description)
-                       Z_Free((char *)cvar->description);
+                       Z_Free(cvar->description);
 
-               Z_Free((char *)cvar->name);
-               Z_Free((char *)cvar->string);
-               Z_Free((char *)cvar->defstring);
+               Z_Free(cvar->name);
+               Z_Free(cvar->string);
+               Z_Free(cvar->defstring);
                Z_Free(cvar);
        }
 }
diff --git a/cvar.h b/cvar.h
index 1509f756f5ce405a7ff65a344541744c69bf02b0..3c94aae266b91b13e25b481e0162931256aee192 100644 (file)
--- a/cvar.h
+++ b/cvar.h
@@ -114,15 +114,15 @@ typedef struct cvar_s
 {
        int flags;
 
-       const char *name;
+       char *name;
 
-       const char *string;
-       const char *description;
+       char *string;
+       char *description;
        int integer;
        float value;
        float vector[3];
 
-       const char *defstring;
+       char *defstring;
 
        unsigned int globaldefindex_progid[3];
        int globaldefindex[3];
@@ -213,7 +213,7 @@ void Cvar_Del_f (void);
 /// or merely sets its value if it already exists.
 cvar_t *Cvar_Get (const char *name, const char *value, int flags, const char *newdescription);
 
-extern const char *cvar_dummy_description; // ALWAYS the same pointer
+extern char *cvar_dummy_description; // ALWAYS the same pointer
 extern cvar_t *cvar_vars; // used to list all cvars
 
 void Cvar_UpdateAllAutoCvars(void); // updates ALL autocvars of the active prog to the cvar values (savegame loading)
index 8ad43beab3736e9292b3106a26cdda7c4d88076d..3f6567bd3bd29d2991dc93857820e287628b61ae 100644 (file)
@@ -333,7 +333,7 @@ static int dpvsimpledecode_setpixelformat(dpvsimpledecodestream_t *s, unsigned i
 // opening and closing streams
 
 // opens a stream
-void *dpvsimpledecode_open(char *filename, const char **errorstring)
+void *dpvsimpledecode_open(char *filename, char **errorstring)
 {
        dpvsimpledecodestream_t *s;
        char t[8], *wavename;
@@ -437,7 +437,7 @@ void dpvsimpledecode_close(void *stream)
 // number to DPVSIMPLEDECODEERROR_NONE
 // if the supplied string pointer variable is not NULL, it will be set to the
 // error message
-int dpvsimpledecode_error(void *stream, const char **errorstring)
+int dpvsimpledecode_error(void *stream, char **errorstring)
 {
        dpvsimpledecodestream_t *s = (dpvsimpledecodestream_t *)stream;
        int e;
index 075f3652b45cbe923d5b4eb3a2d8bec18322457b..2d1f99c9cdee8b103cf35159e678d010aff41c76 100644 (file)
@@ -16,7 +16,7 @@
 // opening and closing streams
 
 // opens a stream
-void *dpvsimpledecode_open(char *filename, const char **errorstring);
+void *dpvsimpledecode_open(char *filename, char **errorstring);
 // closes a stream
 void dpvsimpledecode_close(void *stream);
 
@@ -26,7 +26,7 @@ void dpvsimpledecode_close(void *stream);
 // number to DPVDECODEERROR_NONE
 // if the supplied string pointer variable is not NULL, it will be set to the
 // error message
-int dpvsimpledecode_error(void *stream, const char **errorstring);
+int dpvsimpledecode_error(void *stream, char **errorstring);
 
 // returns the width of the image data
 unsigned int dpvsimpledecode_getwidth(void *stream);
diff --git a/draw.h b/draw.h
index cd220ce03a1ebef6a38d8edb522906dcfdecfeb3..ace96f8cb06425a7d28cdb8e53fad18fc01f9ad3 100644 (file)
--- a/draw.h
+++ b/draw.h
@@ -51,7 +51,7 @@ typedef enum cachepicflags_e
        CACHEPICFLAG_NOTPERSISTENT = 1,
        CACHEPICFLAG_QUIET = 2,
        CACHEPICFLAG_NOCOMPRESSION = 4,
-       CACHEPICFLAG_NOCLAMP = 8
+       CACHEPICFLAG_NOCLAMP = 8,
 }
 cachepicflags_t;
 
index 4bacbc15a1704029ff223c09b98a8c369bff8bf1..9ff8a767514a39667afb4f3c867a15b014ad7d8e 100644 (file)
@@ -1,10 +1,4 @@
 
-#ifdef WIN32
-#include <windows.h>
-#else
-#include <dirent.h>
-#endif
-
 #include "quakedef.h"
 
 // LordHavoc: some portable directory listing code I wrote for lmp2pcx, now used in darkplaces to load id1/*.pak and such...
@@ -147,6 +141,7 @@ static void adddirentry(stringlist_t *list, const char *path, const char *name)
        }
 }
 #ifdef WIN32
+#include <windows.h>
 void listdirectory(stringlist_t *list, const char *basepath, const char *path)
 {
        int i;
@@ -172,6 +167,7 @@ void listdirectory(stringlist_t *list, const char *basepath, const char *path)
                                *c += 'a' - 'A';
 }
 #else
+#include <dirent.h>
 void listdirectory(stringlist_t *list, const char *basepath, const char *path)
 {
        char fullpath[MAX_OSPATH];
index f91b54a3512096c970309409601b052da3ab471f..cbcab90dc4c1b2e977784969db11a068541b87a1 100644 (file)
@@ -45,7 +45,7 @@ int gl_maxdrawrangeelementsindices;
 #ifdef DEBUGGL
 int errornumber = 0;
 
-void GL_PrintError(int errornumber, const char *filename, int linenumber)
+void GL_PrintError(int errornumber, char *filename, int linenumber)
 {
        switch(errornumber)
        {
index d244f00636bcb88dea49cda730be11351c9c191a..7dc8dfb68f07e0aa1822ad344bfb42da2906898b 100644 (file)
@@ -341,7 +341,7 @@ void R_FreeTexturePool(rtexturepool_t **rtexturepool)
 
 typedef struct glmode_s
 {
-       const char *name;
+       char *name;
        int minification, magnification;
 }
 glmode_t;
@@ -359,7 +359,7 @@ static glmode_t modes[6] =
 #ifdef SUPPORTD3D
 typedef struct d3dmode_s
 {
-       const char *name;
+       char *name;
        int m1, m2;
 }
 d3dmode_t;
@@ -2161,7 +2161,7 @@ void R_UpdateTexture(rtexture_t *rt, const unsigned char *data, int x, int y, in
                Host_Error("R_UpdateTexture: no texture supplied");
        if (!glt->texnum && !glt->d3dtexture)
        {
-               Con_Printf("R_UpdateTexture: texture %p \"%s\" in pool %p has not been uploaded yet", (void *)glt, glt->identifier, (void *)glt->pool);
+               Con_Printf("R_UpdateTexture: texture %p \"%s\" in pool %p has not been uploaded yet", glt, glt->identifier, glt->pool);
                return;
        }
        // update part of the texture
index c1311f49e9f05b5f2e2ae9ea37b85fbc8256f35d..cd59c5ae9f4de2036d11fea84cebb32a9c2e65cf 100644 (file)
--- a/glquake.h
+++ b/glquake.h
@@ -964,7 +964,7 @@ extern void (GLAPIENTRY *qglGetQueryObjectuivARB)(GLuint qid, GLenum pname, GLui
 #ifdef DEBUGGL
 #define CHECKGLERROR {if (gl_paranoid.integer){if (gl_printcheckerror.integer) Con_Printf("CHECKGLERROR at %s:%d\n", __FILE__, __LINE__);errornumber = qglGetError();if (errornumber) GL_PrintError(errornumber, __FILE__, __LINE__);}}
 extern int errornumber;
-void GL_PrintError(int errornumber, const char *filename, int linenumber);
+void GL_PrintError(int errornumber, char *filename, int linenumber);
 #else
 #define CHECKGLERROR
 #endif
index b54559b87677f021cead53f9f7765319cc4bb1e0..0934d5959d0d3b57ad1f470fe9582e880b4a4c17 100644 (file)
@@ -1937,7 +1937,7 @@ Kicks a user off of the server
 */
 void Host_Kick_f (void)
 {
-       const char *who;
+       char *who;
        const char *message = NULL;
        client_t *save;
        int i;
index 4267331be738462ceaacfd07541f5bedab60861a..0d58d4a36f33e95e4b64163c08dd4aef42d3c972 100644 (file)
@@ -286,9 +286,7 @@ unsigned char *PNG_LoadImage_BGRA (const unsigned char *raw, int filesize, int *
        // NOTE: this relies on jmp_buf being the first thing in the png structure
        // created by libpng! (this is correct for libpng 1.2.x)
 #ifdef __cplusplus
-#ifdef WIN64
-       if (setjmp((_JBTYPE *)png))
-#elif defined(MACOSX) || defined(WIN32)
+#if defined(MACOSX) || defined(WIN32)
        if (setjmp((int *)png))
 #else
        if (setjmp((__jmp_buf_tag *)png))
@@ -481,9 +479,7 @@ qboolean PNG_SaveImage_preflipped (const char *filename, int width, int height,
        // NOTE: this relies on jmp_buf being the first thing in the png structure
        // created by libpng! (this is correct for libpng 1.2.x)
 #ifdef __cplusplus
-#ifdef WIN64
-       if (setjmp((_JBTYPE *)png))
-#elif defined(MACOSX) || defined(WIN32)
+#if defined(MACOSX) || defined(WIN32)
        if (setjmp((int *)png))
 #else
        if (setjmp((__jmp_buf_tag *)png))
diff --git a/lhnet.c b/lhnet.c
index aa6cbc94153b5f6c9f65f8960ed835515a61ce63..e2e513ee7bfdbc1d73b145a13f7ae7bb11ef889e 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -839,11 +839,7 @@ void LHNET_SleepUntilPacket_Microseconds(int microseconds)
                {
                        if (lastfd < s->inetsocket)
                                lastfd = s->inetsocket;
-#ifdef WIN32
-                       FD_SET((int)s->inetsocket, &fdreadset);
-#else
                        FD_SET((unsigned int)s->inetsocket, &fdreadset);
-#endif
                }
        }
        tv.tv_sec = microseconds / 1000000;
diff --git a/lhnet.h b/lhnet.h
index d46dbe99a859cfb6db3a2ad8ed095febcd79073c..701045e3aa384372275c79de522ef89a0fc85ac3 100644 (file)
--- a/lhnet.h
+++ b/lhnet.h
@@ -9,7 +9,7 @@ typedef enum lhnetaddresstype_e
        LHNETADDRESSTYPE_NONE,
        LHNETADDRESSTYPE_LOOP,
        LHNETADDRESSTYPE_INET4,
-       LHNETADDRESSTYPE_INET6
+       LHNETADDRESSTYPE_INET6,
 }
 lhnetaddresstype_t;
 
index c6e2b472e96ecce8284780e8931d77dc410d0686..48f5bf3579b98d7b054b4f7bc45f4263883755e0 100644 (file)
--- a/libcurl.c
+++ b/libcurl.c
@@ -55,7 +55,7 @@ typedef enum
        CINIT(LOW_SPEED_LIMIT, LONG , 19),
        CINIT(LOW_SPEED_TIME, LONG, 20),
        CINIT(PROTOCOLS, LONG, 181),
-       CINIT(REDIR_PROTOCOLS, LONG, 182)
+       CINIT(REDIR_PROTOCOLS, LONG, 182),
 }
 CURLoption;
 #define CURLPROTO_HTTP   (1<<0)
@@ -108,7 +108,7 @@ typedef enum
        CURLINFO_PROXYAUTH_AVAIL  = CURLINFO_LONG   + 24,
        CURLINFO_OS_ERRNO         = CURLINFO_LONG   + 25,
        CURLINFO_NUM_CONNECTS     = CURLINFO_LONG   + 26,
-       CURLINFO_SSL_ENGINES      = CURLINFO_SLIST  + 27
+       CURLINFO_SSL_ENGINES      = CURLINFO_SLIST  + 27,
 }
 CURLINFO;
 
diff --git a/menu.c b/menu.c
index 864dcbbb9ebafa02352c6b480feb6d1890668980..c9e8d1fa4801a28e58be71c3ffeada3166ac2ce0 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -107,7 +107,7 @@ static void M_ModList_Key (int key, int ascii);
 
 static qboolean        m_entersound;           ///< play after drawing a frame, so caching won't disrupt the sound
 
-void M_Update_Return_Reason(const char *s)
+void M_Update_Return_Reason(char *s)
 {
        strlcpy(m_return_reason, s, sizeof(m_return_reason));
        if (s)
@@ -121,8 +121,8 @@ void M_Update_Return_Reason(const char *s)
 #define NumberOfNehahraDemos 34
 typedef struct nehahrademonames_s
 {
-       const char *name;
-       const char *desc;
+       char *name;
+       char *desc;
 } nehahrademonames_t;
 
 static nehahrademonames_t NehahraDemos[NumberOfNehahraDemos] =
@@ -167,8 +167,8 @@ static float menu_x, menu_y, menu_width, menu_height;
 
 static void M_Background(int width, int height)
 {
-       menu_width = bound(1.0f, (float)width, vid_conwidth.value);
-       menu_height = bound(1.0f, (float)height, vid_conheight.value);
+       menu_width = bound(1, width, vid_conwidth.integer);
+       menu_height = bound(1, height, vid_conheight.integer);
        menu_x = (vid_conwidth.integer - menu_width) * 0.5;
        menu_y = (vid_conheight.integer - menu_height) * 0.5;
        //DrawQ_Fill(menu_x, menu_y, menu_width, menu_height, 0, 0, 0, 0.5, 0);
@@ -1266,7 +1266,7 @@ static unsigned int *menuplyr_translated;
 typedef struct ratetable_s
 {
        int rate;
-       const char *name;
+       char *name;
 }
 ratetable_t;
 
@@ -2315,7 +2315,7 @@ static void M_Options_ColorControl_Key (int k, int ascii)
 //=============================================================================
 /* KEYS MENU */
 
-static const char *quakebindnames[][2] =
+static char *quakebindnames[][2] =
 {
 {"+attack",            "attack"},
 {"impulse 10",                 "next weapon"},
@@ -2338,7 +2338,7 @@ static const char *quakebindnames[][2] =
 {"+movedown",          "swim down"}
 };
 
-static const char *transfusionbindnames[][2] =
+static char *transfusionbindnames[][2] =
 {
 {"",                           "Movement"},            // Movement commands
 {"+forward",           "walk forward"},
@@ -2396,7 +2396,7 @@ static const char *transfusionbindnames[][2] =
 {"impulse 79",         "taunt 9"}
 };
 
-static const char *goodvsbad2bindnames[][2] =
+static char *goodvsbad2bindnames[][2] =
 {
 {"impulse 69",         "Power 1"},
 {"impulse 70",         "Power 2"},
@@ -2420,7 +2420,7 @@ static const char *goodvsbad2bindnames[][2] =
 };
 
 static int numcommands;
-static const char *(*bindnames)[2];
+static char *(*bindnames)[2];
 
 /*
 typedef struct binditem_s
@@ -2525,10 +2525,10 @@ void M_Menu_Keys_f (void)
 
 #define NUMKEYS 5
 
-static void M_UnbindCommand (const char *command)
+static void M_UnbindCommand (char *command)
 {
        int             j;
-       const char      *b;
+       char    *b;
 
        for (j = 0; j < (int)sizeof (keybindings[0]) / (int)sizeof (keybindings[0][0]); j++)
        {
@@ -3107,12 +3107,12 @@ static void M_Credits_Key (int key, int ascii)
 //=============================================================================
 /* QUIT MENU */
 
-static const char *m_quit_message[9];
+static char *m_quit_message[9];
 static int             m_quit_prevstate;
 static qboolean        wasInMenus;
 
 
-static int M_QuitMessage(const char *line1, const char *line2, const char *line3, const char *line4, const char *line5, const char *line6, const char *line7, const char *line8)
+static int M_QuitMessage(char *line1, char *line2, char *line3, char *line4, char *line5, char *line6, char *line7, char *line8)
 {
        m_quit_message[0] = line1;
        m_quit_message[1] = line2;
@@ -3292,8 +3292,8 @@ static void M_LanConfig_Draw (void)
 {
        cachepic_t      *p;
        int             basex;
-       const char      *startJoin;
-       const char      *protocol;
+       char    *startJoin;
+       char    *protocol;
 
        M_Background(320, 200);
 
@@ -3456,20 +3456,20 @@ static void M_LanConfig_Key (int key, int ascii)
 
 typedef struct level_s
 {
-       const char      *name;
-       const char      *description;
+       char    *name;
+       char    *description;
 } level_t;
 
 typedef struct episode_s
 {
-       const char      *description;
+       char    *description;
        int             firstLevel;
        int             levels;
 } episode_t;
 
 typedef struct gamelevels_s
 {
-       const char *gamename;
+       char *gamename;
        level_t *levels;
        episode_t *episodes;
        int numepisodes;
@@ -3976,7 +3976,7 @@ void M_GameOptions_Draw (void)
                M_Print(0, 72, "        Teamplay");
                if (gamemode == GAME_ROGUE)
                {
-                       const char *msg;
+                       char *msg;
 
                        switch((int)teamplay.integer)
                        {
@@ -3992,7 +3992,7 @@ void M_GameOptions_Draw (void)
                }
                else
                {
-                       const char *msg;
+                       char *msg;
 
                        switch (teamplay.integer)
                        {
@@ -5029,7 +5029,7 @@ void M_Restart(void)
 //============================================================================
 // Menu prog handling
 
-static const char *m_required_func[] = {
+static char *m_required_func[] = {
 "m_init",
 "m_keydown",
 "m_draw",
diff --git a/menu.h b/menu.h
index 7fdf78bad073826dbf7b0092a799e1356088a3d9..cef87e2edb630827da03be08f4201807e1626dd9 100644 (file)
--- a/menu.h
+++ b/menu.h
@@ -53,7 +53,7 @@ enum m_state_e {
 
 extern enum m_state_e m_state;
 extern char m_return_reason[32];
-void M_Update_Return_Reason(const char *s);
+void M_Update_Return_Reason(char *s);
 
 /*
 // hard-coded menus
index e84a7ff9a3683b5c95b3140abcf5c89c3e352ee1..bb6b1888201a7e0eccb6d240a87b96d9f4efeeec 100644 (file)
@@ -7273,7 +7273,6 @@ void Mod_OBJ_Load(dp_model_t *mod, void *buffer, void *bufferend)
        // parse the OBJ text now
        for(;;)
        {
-               static char emptyarg[1] = "";
                if (!*text)
                        break;
                linenumber++;
@@ -7282,7 +7281,7 @@ void Mod_OBJ_Load(dp_model_t *mod, void *buffer, void *bufferend)
                        line[linelen] = text[linelen];
                line[linelen] = 0;
                for (argc = 0;argc < 4;argc++)
-                       argv[argc] = emptyarg;
+                       argv[argc] = "";
                argc = 0;
                s = line;
                while (*s == ' ' || *s == '\t')
index 73972184bd08ac0823528d684cd5a31800c33da2..65bc2b29b9f7acef86051dcb514792d07821711b 100644 (file)
@@ -488,7 +488,7 @@ typedef enum texturelayertype_e
        TEXTURELAYERTYPE_INVALID,
        TEXTURELAYERTYPE_LITTEXTURE,
        TEXTURELAYERTYPE_TEXTURE,
-       TEXTURELAYERTYPE_FOG
+       TEXTURELAYERTYPE_FOG,
 }
 texturelayertype_t;
 
index e9cc68a986177b5ffc1609f6a51acc9ee4f1596d..b7bbc8b0f5350df77913f5ff88f2f70582420564 100644 (file)
@@ -9,7 +9,7 @@
 //============================================================================
 // Menu
 
-const char *vm_m_extensions =
+char *vm_m_extensions =
 "BX_WAL_SUPPORT "
 "DP_CINEMATIC_DPV "
 "DP_CSQC_BINDMAPS "
index 5bf4080d78bcb60e18ffdab93ff700b6b0b65a95..53eb4d3154bd25c483689efacb3ed71624550293 100644 (file)
--- a/progsvm.h
+++ b/progsvm.h
@@ -487,12 +487,12 @@ typedef struct prvm_prog_s
        qboolean                        allowworldwrites;
 
        // name of the prog, e.g. "Server", "Client" or "Menu" (used for text output)
-       const char                      *name; // [INIT]
+       char                            *name; // [INIT]
 
        // flag - used to store general flags like PRVM_GE_SELF, etc.
        int                             flag;
 
-       const char                      *extensionstring; // [INIT]
+       char                            *extensionstring; // [INIT]
 
        qboolean                        loadintoworld; // [INIT]
 
@@ -557,8 +557,8 @@ extern const int vm_sv_numbuiltins;
 extern const int vm_cl_numbuiltins;
 extern const int vm_m_numbuiltins;
 
-extern const char * vm_sv_extensions; // client also uses this
-extern const char * vm_m_extensions;
+extern char * vm_sv_extensions; // client also uses this
+extern char * vm_m_extensions;
 
 void VM_SV_Cmd_Init(void);
 void VM_SV_Cmd_Reset(void);
@@ -632,7 +632,7 @@ void PRVM_ED_ParseGlobals (const char *data);
 
 void PRVM_ED_LoadFromFile (const char *data);
 
-unsigned int PRVM_EDICT_NUM_ERROR(unsigned int n, const char *filename, int fileline);
+unsigned int PRVM_EDICT_NUM_ERROR(unsigned int n, char *filename, int fileline);
 #define        PRVM_EDICT(n) (((unsigned)(n) < (unsigned int)prog->max_edicts) ? (unsigned int)(n) : PRVM_EDICT_NUM_ERROR((unsigned int)(n), __FILE__, __LINE__))
 #define        PRVM_EDICT_NUM(n) (prog->edicts + PRVM_EDICT(n))
 
@@ -715,7 +715,7 @@ Load a program with LoadProgs
 */
 void PRVM_InitProg(int prognr);
 // LoadProgs expects to be called right after InitProg
-void PRVM_LoadProgs (const char *filename, int numrequiredfunc, const char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, char **required_global);
+void PRVM_LoadProgs (const char *filename, int numrequiredfunc, char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, char **required_global);
 void PRVM_ResetProg(void);
 
 qboolean PRVM_ProgLoaded(int prognr);
index 391f9e27cf91e7e802a718b2bb545ff4af2d9ae4..20f06119cdf96879b73baafeced6edaf75ad924c 100644 (file)
@@ -269,7 +269,7 @@ checkextension(extensionname)
 static qboolean checkextension(const char *name)
 {
        int len;
-       const char *e, *start;
+       char *e, *start;
        len = (int)strlen(name);
 
        for (e = prog->extensionstring;*e;e++)
index 7a81d008c498be1caa1ba29c08dafce5311f9294..701487946cbd53cdad976e9c70e92afb1acb579e 100644 (file)
@@ -2074,7 +2074,7 @@ void PRVM_LoadLNO( const char *progname ) {
 PRVM_LoadProgs
 ===============
 */
-void PRVM_LoadProgs (const char * filename, int numrequiredfunc, const char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, char **required_global)
+void PRVM_LoadProgs (const char * filename, int numrequiredfunc, char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, char **required_global)
 {
        int i;
        dstatement_t *st;
@@ -2808,7 +2808,7 @@ void _PRVM_FreeAll(const char *filename, int fileline)
 }
 
 // LordHavoc: turned PRVM_EDICT_NUM into a #define for speed reasons
-unsigned int PRVM_EDICT_NUM_ERROR(unsigned int n, const char *filename, int fileline)
+unsigned int PRVM_EDICT_NUM_ERROR(unsigned int n, char *filename, int fileline)
 {
        PRVM_ERROR ("PRVM_EDICT_NUM: %s: bad number %i (called at %s:%i)", PRVM_NAME, n, filename, fileline);
        return 0;
index ca1c191cb04c6835578a2ce421aec3fe60d1e385..ea85df9e9cb33c5088730874fa1b4fbbcf13c78b 100644 (file)
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 #include "progsvm.h"
 
-const char *prvm_opnames[] =
+char *prvm_opnames[] =
 {
 "^5DONE",
 
index 818637e8467d67100f0e75e6291d403403a40c8e..541ef0439ea11ef6b811d0017c1c754b7a40c1d6 100644 (file)
@@ -6,7 +6,7 @@
 typedef struct rendermodule_s
 {
        int active; // set by start, cleared by shutdown
-       const char *name;
+       char *name;
        void(*start)(void);
        void(*shutdown)(void);
        void(*newmap)(void);
@@ -22,7 +22,7 @@ void R_Modules_Init(void)
        Cmd_AddCommand("r_restart", R_Modules_Restart, "restarts renderer");
 }
 
-void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
+void R_RegisterModule(char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
 {
        int i;
        for (i = 0;i < MAXRENDERMODULES;i++)
index ad838d17046de527a6ed15197c6b56ced1c1298f..9316515c36796c934db814159defea43f948206f 100644 (file)
@@ -3,7 +3,7 @@
 #define R_MODULES_H
 
 void R_Modules_Init(void);
-void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void));
+void R_RegisterModule(char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void));
 void R_Modules_Start(void);
 void R_Modules_Shutdown(void);
 void R_Modules_NewMap(void);
index 899c14544fff79a150db4d3fe26c6f985fb42be9..4392b2ed94df92d384d1d51fc2e90a7908dc15cc 100644 (file)
@@ -165,7 +165,7 @@ typedef enum r_shadow_rendermode_e
        R_SHADOW_RENDERMODE_VISIBLELIGHTING,
        R_SHADOW_RENDERMODE_SHADOWMAP2D,
        R_SHADOW_RENDERMODE_SHADOWMAPRECTANGLE,
-       R_SHADOW_RENDERMODE_SHADOWMAPCUBESIDE
+       R_SHADOW_RENDERMODE_SHADOWMAPCUBESIDE,
 }
 r_shadow_rendermode_t;
 
index c89811833fe56733224b610afc26fab97e9b71ac..85e7dfb6b4ed9e831ea55fbdd8443645c97981c7 100644 (file)
@@ -54,7 +54,7 @@ typedef enum textype_e
        // 4x4 block compressed 15bit color plus 8bit alpha (8 bits per pixel)
        TEXTYPE_DXT5,
        // this represents the same format as the framebuffer, for fast copies
-       TEXTYPE_COLORBUFFER
+       TEXTYPE_COLORBUFFER,
 }
 textype_t;
 
index b5dea8db55022347372c356f2d82975a14da15db..7f85446b448c885f9dc57cf52b92daf8be1c3dec 100644 (file)
--- a/render.h
+++ b/render.h
@@ -220,7 +220,7 @@ extern unsigned int r_queries[MAX_OCCLUSION_QUERIES];
 extern unsigned int r_numqueries;
 extern unsigned int r_maxqueries;
 
-void R_TimeReport(const char *name);
+void R_TimeReport(char *name);
 
 // r_stain
 void R_Stain(const vec3_t origin, float radius, int cr1, int cg1, int cb1, int ca1, int cr2, int cg2, int cb2, int ca2);
@@ -462,7 +462,7 @@ typedef enum rsurfacepass_e
        RSURFPASS_BASE,
        RSURFPASS_BACKGROUND,
        RSURFPASS_RTLIGHT,
-       RSURFPASS_DEFERREDGEOMETRY
+       RSURFPASS_DEFERREDGEOMETRY,
 }
 rsurfacepass_t;
 
index 2431430b0af7ae84f0fb9ca83f1980904a69ba74..66ad014dc82106947a18bf1599a4e01b745daf74 100644 (file)
--- a/snd_ogg.c
+++ b/snd_ogg.c
@@ -222,7 +222,7 @@ typedef struct
 static int (*qov_clear) (OggVorbis_File *vf);
 static vorbis_info* (*qov_info) (OggVorbis_File *vf,int link);
 static vorbis_comment* (*qov_comment) (OggVorbis_File *vf,int link);
-static char * (*qvorbis_comment_query) (vorbis_comment *vc, const char *tag, int count);
+static char * (*qvorbis_comment_query) (vorbis_comment *vc, char *tag, int count);
 static int (*qov_open_callbacks) (void *datasource, OggVorbis_File *vf,
                                                                  char *initial, long ibytes,
                                                                  ov_callbacks callbacks);
index 7eb118d7a1c2b64563c037dba1f8282d59f1d13a..438db2ba8a0a95a189b5ac66f23b883c0496b453 100644 (file)
--- a/snd_wav.c
+++ b/snd_wav.c
@@ -65,7 +65,7 @@ static int GetLittleLong(void)
        return val;
 }
 
-static void FindNextChunk(const char *name)
+static void FindNextChunk(char *name)
 {
        while (1)
        {
@@ -91,7 +91,7 @@ static void FindNextChunk(const char *name)
        }
 }
 
-static void FindChunk(const char *name)
+static void FindChunk(char *name)
 {
        last_chunk = iff_data;
        FindNextChunk (name);
index bb2722318dd929e8fbb822307c8e92673b41307f..34b0593301d3e6096d16f436925674c81aa30aa8 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -979,19 +979,14 @@ void SV_ConnectClient (int clientnum, netconn_t *netconnection)
 {
        client_t                *client;
        int                             i;
+       float                   spawn_parms[NUM_SPAWN_PARMS];
 
        client = svs.clients + clientnum;
 
 // set up the client_t
        if (sv.loadgame)
-       {
-               float backupparms[NUM_SPAWN_PARMS];
-               memcpy(backupparms, client->spawn_parms, sizeof(backupparms));
-               memset(client, 0, sizeof(*client));
-               memcpy(client->spawn_parms, backupparms, sizeof(backupparms));
-       }
-       else
-               memset(client, 0, sizeof(*client));
+               memcpy (spawn_parms, client->spawn_parms, sizeof(spawn_parms));
+       memset (client, 0, sizeof(*client));
        client->active = true;
        client->netconnection = netconnection;
 
@@ -1013,7 +1008,9 @@ void SV_ConnectClient (int clientnum, netconn_t *netconnection)
                client->rate = 1000000000;
        client->connecttime = realtime;
 
-       if (!sv.loadgame)
+       if (sv.loadgame)
+               memcpy (client->spawn_parms, spawn_parms, sizeof(spawn_parms));
+       else
        {
                // call the progs to get default spawn parms for the new client
                // set self to world to intentionally cause errors with broken SetNewParms code in some mods
index 459c73f4e745ffc797d6fbe142d7694158075fce..35cb8beed1a93bd463875344772d14e7ad04847d 100644 (file)
@@ -8,7 +8,7 @@
 
 
 
-const char *vm_sv_extensions =
+char *vm_sv_extensions =
 "BX_WAL_SUPPORT "
 "DP_BUTTONCHAT "
 "DP_BUTTONUSE "
index bddb5d7d153a565201bc239178d936d65ef7e14d..167121a83bd9381f4fc1541de1268b826b3e3bfe 100644 (file)
@@ -1,3 +1,4 @@
+#include "quakedef.h"
 
 #ifdef WIN32
 #include <windows.h>
@@ -12,7 +13,6 @@
 
 #include <signal.h>
 
-#include "quakedef.h"
 
 // =======================================================================
 // General routines
index dd00b48b01cafcaced429677d894d6ba41c22fc2..903bee1e6868edbe8363ea1791f2f5fdefccfcd8 100644 (file)
@@ -4,9 +4,7 @@
 
 #ifdef WIN32
 # ifdef _WIN64
-#  ifndef _WIN32_WINNT
-#   define _WIN32_WINNT 0x0502
-#  endif
+#  define _WIN32_WINNT 0x0502
    // for SetDllDirectory
 # endif
 # include <windows.h>
diff --git a/vid.h b/vid.h
index 7eecb29592303009e0dfa5ad00521ee284c5cd4f..900628071844dd7e757952dc50028d6bef40d3e5 100644 (file)
--- a/vid.h
+++ b/vid.h
@@ -36,7 +36,7 @@ typedef enum renderpath_e
        RENDERPATH_CGGL,
        RENDERPATH_D3D9,
        RENDERPATH_D3D10,
-       RENDERPATH_D3D11
+       RENDERPATH_D3D11,
 }
 renderpath_t;
 
index fb98973c15116f187f61aeabb0559bf853157181..53153e02d5ee267c094db0dccaf842f32f11ec6e 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -1208,7 +1208,7 @@ qboolean VID_InitModeGL(viddef_mode_t *mode)
                mainwindow = CreateWindowEx (ExWindowStyle, "DarkPlacesWindowClass", gamename, WindowStyle, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, global_hInstance, NULL);
                if (!mainwindow)
                {
-                       Con_Printf("CreateWindowEx(%d, %s, %s, %d, %d, %d, %d, %d, %p, %p, %p, %p) failed\n", (int)ExWindowStyle, "DarkPlacesWindowClass", gamename, (int)WindowStyle, (int)(rect.left), (int)(rect.top), (int)(rect.right - rect.left), (int)(rect.bottom - rect.top), (void *)NULL, (void *)NULL, (void *)global_hInstance, (void *)NULL);
+                       Con_Printf("CreateWindowEx(%d, %s, %s, %d, %d, %d, %d, %d, %p, %p, %p, %p) failed\n", (int)ExWindowStyle, "DarkPlacesWindowClass", gamename, (int)WindowStyle, (int)(rect.left), (int)(rect.top), (int)(rect.right - rect.left), (int)(rect.bottom - rect.top), NULL, NULL, global_hInstance, NULL);
                        VID_Shutdown();
                        return false;
                }
@@ -1221,14 +1221,14 @@ qboolean VID_InitModeGL(viddef_mode_t *mode)
                if (!pixelformat)
                {
                        VID_Shutdown();
-                       Con_Printf("ChoosePixelFormat(%p, %p) failed\n", (void *)baseDC, (void *)&pfd);
+                       Con_Printf("ChoosePixelFormat(%p, %p) failed\n", baseDC, &pfd);
                        return false;
                }
 
                if (SetPixelFormat(baseDC, pixelformat, &pfd) == false)
                {
                        VID_Shutdown();
-                       Con_Printf("SetPixelFormat(%p, %d, %p) failed\n", (void *)baseDC, pixelformat, (void *)&pfd);
+                       Con_Printf("SetPixelFormat(%p, %d, %p) failed\n", baseDC, pixelformat, &pfd);
                        return false;
                }
 
@@ -1249,7 +1249,7 @@ qboolean VID_InitModeGL(viddef_mode_t *mode)
                if (!qwglMakeCurrent(baseDC, baseRC))
                {
                        VID_Shutdown();
-                       Con_Printf("wglMakeCurrent(%p, %p) failed\n", (void *)baseDC, (void *)baseRC);
+                       Con_Printf("wglMakeCurrent(%p, %p) failed\n", baseDC, baseRC);
                        return false;
                }
 
@@ -1430,7 +1430,7 @@ qboolean VID_InitModeDX(viddef_mode_t *mode, int version)
        mainwindow = CreateWindowEx (ExWindowStyle, "DarkPlacesWindowClass", gamename, WindowStyle, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, global_hInstance, NULL);
        if (!mainwindow)
        {
-               Con_Printf("CreateWindowEx(%d, %s, %s, %d, %d, %d, %d, %d, %p, %p, %p, %p) failed\n", (int)ExWindowStyle, "DarkPlacesWindowClass", gamename, (int)WindowStyle, (int)(rect.left), (int)(rect.top), (int)(rect.right - rect.left), (int)(rect.bottom - rect.top), (void *)NULL, (void *)NULL, global_hInstance, (void *)NULL);
+               Con_Printf("CreateWindowEx(%d, %s, %s, %d, %d, %d, %d, %d, %p, %p, %p, %p) failed\n", (int)ExWindowStyle, "DarkPlacesWindowClass", gamename, (int)WindowStyle, (int)(rect.left), (int)(rect.top), (int)(rect.right - rect.left), (int)(rect.bottom - rect.top), NULL, NULL, global_hInstance, NULL);
                VID_Shutdown();
                return false;
        }
@@ -1513,10 +1513,10 @@ qboolean VID_InitModeDX(viddef_mode_t *mode, int version)
 
        Con_Printf("D3D9 adapter info:\n");
        Con_Printf("Description: %s\n", d3d9adapteridentifier.Description);
-       Con_Printf("DeviceId: %x\n", (unsigned int)d3d9adapteridentifier.DeviceId);
-       Con_Printf("DeviceName: %p\n", d3d9adapteridentifier.DeviceName);
+       Con_Printf("DeviceId: %x\n", d3d9adapteridentifier.DeviceId);
+       Con_Printf("DeviceName: %x\n", d3d9adapteridentifier.DeviceName);
        Con_Printf("Driver: %s\n", d3d9adapteridentifier.Driver);
-       Con_Printf("DriverVersion: %08x%08x\n", (unsigned int)d3d9adapteridentifier.DriverVersion.u.HighPart, (unsigned int)d3d9adapteridentifier.DriverVersion.u.LowPart);
+       Con_Printf("DriverVersion: %x\n", d3d9adapteridentifier.DriverVersion);
        Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions);
        Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
 
@@ -1904,31 +1904,57 @@ static void IN_MouseMove (void)
 
                        /* Look at the element to see what happened */
 
-                       if ((int)od.dwOfs == DIMOFS_X)
-                               in_mouse_x += (LONG) od.dwData;
-                       if ((int)od.dwOfs == DIMOFS_Y)
-                               in_mouse_y += (LONG) od.dwData;
-                       if ((int)od.dwOfs == DIMOFS_Z)
+                       switch (od.dwOfs)
                        {
-                               if((LONG)od.dwData < 0)
-                               {
-                                       Key_Event(K_MWHEELDOWN, 0, true);
-                                       Key_Event(K_MWHEELDOWN, 0, false);
-                               }
-                               else if((LONG)od.dwData > 0)
-                               {
-                                       Key_Event(K_MWHEELUP, 0, true);
-                                       Key_Event(K_MWHEELUP, 0, false);
-                               }
+                               case DIMOFS_X:
+                                       in_mouse_x += (LONG) od.dwData;
+                                       break;
+
+                               case DIMOFS_Y:
+                                       in_mouse_y += (LONG) od.dwData;
+                                       break;
+
+                               case DIMOFS_Z:
+                                       if((LONG) od.dwData < 0)
+                                       {
+                                               Key_Event (K_MWHEELDOWN, 0, true);
+                                               Key_Event (K_MWHEELDOWN, 0, false);
+                                       }
+                                       else if((LONG) od.dwData > 0)
+                                       {
+                                               Key_Event (K_MWHEELUP, 0, true);
+                                               Key_Event (K_MWHEELUP, 0, false);
+                                       }
+                                       break;
+
+                               case DIMOFS_BUTTON0:
+                                       if (od.dwData & 0x80)
+                                               mstate_di |= 1;
+                                       else
+                                               mstate_di &= ~1;
+                                       break;
+
+                               case DIMOFS_BUTTON1:
+                                       if (od.dwData & 0x80)
+                                               mstate_di |= (1<<1);
+                                       else
+                                               mstate_di &= ~(1<<1);
+                                       break;
+
+                               case DIMOFS_BUTTON2:
+                                       if (od.dwData & 0x80)
+                                               mstate_di |= (1<<2);
+                                       else
+                                               mstate_di &= ~(1<<2);
+                                       break;
+
+                               case DIMOFS_BUTTON3:
+                                       if (od.dwData & 0x80)
+                                               mstate_di |= (1<<3);
+                                       else
+                                               mstate_di &= ~(1<<3);
+                                       break;
                        }
-                       if ((int)od.dwOfs == DIMOFS_BUTTON0)
-                               mstate_di = (mstate_di & ~1) | ((od.dwData & 0x80) >> 7);
-                       if ((int)od.dwOfs == DIMOFS_BUTTON1)
-                               mstate_di = (mstate_di & ~2) | ((od.dwData & 0x80) >> 6);
-                       if ((int)od.dwOfs == DIMOFS_BUTTON2)
-                               mstate_di = (mstate_di & ~4) | ((od.dwData & 0x80) >> 5);
-                       if ((int)od.dwOfs == DIMOFS_BUTTON3)
-                               mstate_di = (mstate_di & ~8) | ((od.dwData & 0x80) >> 4);
                }
 
                // perform button actions