]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
gcc 4.0 signedness warning fixes and uninitialized vector fixes
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 20 Oct 2005 22:14:19 +0000 (22:14 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 20 Oct 2005 22:14:19 +0000 (22:14 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5741 d7cf8633-e32d-0410-b094-e92efae38249

25 files changed:
cl_particles.c
cl_screen.c
collision.c
gl_backend.c
gl_draw.c
gl_rmain.c
gl_textures.c
host.c
host_cmd.c
lhnet.c
model_brush.c
model_shared.c
model_sprite.c
netconn.c
polygon.c
polygon.h
prvm_cmds.c
snd_coreaudio.c
snd_mix.c
snd_ogg.c
snd_wav.c
sv_main.c
vid_agl.c
vid_sdl.c
view.c

index 25d90792310494f33d6399195cc65dd88c9a0e05..cb3cf0c8dcabca55cb89dc36d1c66ae09b3a38d9 100644 (file)
@@ -558,7 +558,7 @@ void CL_ReadPointFile_f (void)
 #if WORKINGLQUAKE
        pointfile = COM_LoadTempFile (name);
 #else
-       pointfile = FS_LoadFile(name, tempmempool, true);
+       pointfile = (char *)FS_LoadFile(name, tempmempool, true);
 #endif
        if (!pointfile)
        {
@@ -567,6 +567,7 @@ void CL_ReadPointFile_f (void)
        }
 
        Con_Printf("Reading %s...\n", name);
+       VectorClear(leakorg);
        c = 0;
        s = 0;
        pointfilepos = pointfile;
index 917ddab5ba758f0f74a258610a209a75d316c18a..687f6113d3333755dd75834bdd67070db4afff49 100644 (file)
@@ -1299,7 +1299,7 @@ showlmp_t showlmp[SHOWLMP_MAXLABELS];
 void SHOWLMP_decodehide(void)
 {
        int i;
-       qbyte *lmplabel;
+       char *lmplabel;
        lmplabel = MSG_ReadString();
        for (i = 0;i < SHOWLMP_MAXLABELS;i++)
                if (showlmp[i].isactive && strcmp(showlmp[i].label, lmplabel) == 0)
@@ -1312,7 +1312,7 @@ void SHOWLMP_decodehide(void)
 void SHOWLMP_decodeshow(void)
 {
        int i, k;
-       qbyte lmplabel[256], picname[256];
+       char lmplabel[256], picname[256];
        float x, y;
        strlcpy (lmplabel,MSG_ReadString(), sizeof (lmplabel));
        strlcpy (picname, MSG_ReadString(), sizeof (picname));
index 693d653d84de6ca7ed635f4def66cea597c252c8..6fc28f0aa9106062e96f17e780e31ff746ab7dc1 100644 (file)
@@ -522,6 +522,7 @@ void Collision_TraceBrushBrushFloat(trace_t *trace, const colbrushf_t *thisbrush
        float enterfrac, leavefrac, d1, d2, f, imove, newimpactnormal[3], enterfrac2;
        const colplanef_t *startplane, *endplane;
 
+       VectorClear(newimpactnormal);
        enterfrac = -1;
        enterfrac2 = -1;
        leavefrac = 1;
@@ -662,6 +663,7 @@ void Collision_TraceLineBrushFloat(trace_t *trace, const vec3_t linestart, const
        float enterfrac, leavefrac, d1, d2, f, imove, newimpactnormal[3], enterfrac2;
        const colplanef_t *startplane, *endplane;
 
+       VectorClear(newimpactnormal);
        enterfrac = -1;
        enterfrac2 = -1;
        leavefrac = 1;
index 8ad00d63cd16d33ad661d21154c0ff18bf9d9c3f..38c4707319c657179b4db7e73624aa33e38a0993 100644 (file)
@@ -174,9 +174,9 @@ static void gl_backend_start(void)
        if (gl_support_fragment_shader)
        {
                CHECKGLERROR
-               qglGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &backendimageunits);
+               qglGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, (int *)&backendimageunits);
                CHECKGLERROR
-               qglGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, &backendarrayunits);
+               qglGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, (int *)&backendarrayunits);
                CHECKGLERROR
                Con_Printf("GLSL shader support detected: texture units = %i texenv, %i image, %i array\n", backendunits, backendimageunits, backendarrayunits);
        }
index ecd5154d6fd999a597d5e0499cd971a381ffba15..c0aa4f38a0e721ff1a52548a76f7f5c29600391f 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -147,8 +147,9 @@ static rtexture_t *draw_generatemousepointer(void)
 // must match NUMCROSSHAIRS in r_crosshairs.c
 #define NUMCROSSHAIRS 6
 
-static qbyte *crosshairtexdata[NUMCROSSHAIRS] =
+static qbyte crosshairtexdata[NUMCROSSHAIRS][16*16] =
 {
+       {
        "................"
        "................"
        "................"
@@ -165,7 +166,8 @@ static qbyte *crosshairtexdata[NUMCROSSHAIRS] =
        "................"
        "................"
        "................"
-       ,
+       },
+       {
        "................"
        "................"
        "................"
@@ -182,7 +184,8 @@ static qbyte *crosshairtexdata[NUMCROSSHAIRS] =
        "................"
        "................"
        "................"
-       ,
+       },
+       {
        "................"
        ".......77......."
        ".......77......."
@@ -199,7 +202,8 @@ static qbyte *crosshairtexdata[NUMCROSSHAIRS] =
        ".......77......."
        ".......77......."
        "................"
-       ,
+       },
+       {
        "................"
        "................"
        "................"
@@ -216,7 +220,8 @@ static qbyte *crosshairtexdata[NUMCROSSHAIRS] =
        "........7......."
        "........7......."
        "................"
-       ,
+       },
+       {
        "................"
        "................"
        "................"
@@ -233,7 +238,8 @@ static qbyte *crosshairtexdata[NUMCROSSHAIRS] =
        "................"
        "................"
        "................"
-       ,
+       },
+       {
        "................"
        "................"
        "................"
@@ -250,6 +256,7 @@ static qbyte *crosshairtexdata[NUMCROSSHAIRS] =
        "................"
        "................"
        "................"
+       }
 };
 
 static rtexture_t *draw_generatecrosshair(int num)
@@ -323,7 +330,7 @@ cachepic_t  *Draw_CachePic (const char *path, qboolean persistent)
                        return &video->cpif;
        }
 
-       crc = CRC_Block(path, strlen(path));
+       crc = CRC_Block((qbyte *)path, strlen(path));
        hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
        for (pic = cachepichash[hashkey];pic;pic = pic->chain)
                if (!strcmp (path, pic->name))
@@ -407,7 +414,7 @@ cachepic_t *Draw_NewPic(const char *picname, int width, int height, int alpha, q
        int crc, hashkey;
        cachepic_t *pic;
 
-       crc = CRC_Block(picname, strlen(picname));
+       crc = CRC_Block((qbyte *)picname, strlen(picname));
        hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
        for (pic = cachepichash[hashkey];pic;pic = pic->chain)
                if (!strcmp (picname, pic->name))
@@ -453,7 +460,7 @@ void Draw_FreePic(const char *picname)
        int hashkey;
        cachepic_t *pic;
        // this doesn't really free the pic, but does free it's texture
-       crc = CRC_Block(picname, strlen(picname));
+       crc = CRC_Block((qbyte *)picname, strlen(picname));
        hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
        for (pic = cachepichash[hashkey];pic;pic = pic->chain)
        {
index deaa8db42a0eaaecb661103bc8a06612dd512d9d..6a1693e32ba92ffa46fd4b6facee09c0dd95e8ea 100644 (file)
@@ -297,6 +297,7 @@ static void R_BuildNormalizationCube(void)
                                t = (y + 0.5f) * (2.0f / NORMSIZE) - 1.0f;
                                switch(side)
                                {
+                               default:
                                case 0:
                                        v[0] = 1;
                                        v[1] = -t;
@@ -379,7 +380,7 @@ void gl_main_newmap(void)
                if (l >= 0 && !strcmp(entname + l, ".bsp"))
                {
                        strcpy(entname + l, ".ent");
-                       if ((entities = FS_LoadFile(entname, tempmempool, true)))
+                       if ((entities = (char *)FS_LoadFile(entname, tempmempool, true)))
                        {
                                CL_ParseEntityLump(entities);
                                Mem_Free(entities);
index 9c69e2998ada6c4acbb1cd9e4f80ed548b4aed7c..51ae4f6e2b3c603aea6acef44ae0b5bd64eb9a02 100644 (file)
@@ -238,7 +238,7 @@ void R_FreeTexture(rtexture_t *rt)
                        else
                                Host_Error("R_FreeTexture: image not linked in pool\n");
                        if (image->texnum)
-                               qglDeleteTextures(1, &image->texnum);
+                               qglDeleteTextures(1, (GLuint *)&image->texnum);
                        if (image->blockallocation)
                                Mem_Free(image->blockallocation);
                        Mem_Free(image);
@@ -986,7 +986,7 @@ static void R_FindImageForTexture(gltexture_t *glt)
        image->bytesperpixel = texinfo->internalbytesperpixel;
        image->sides = image->texturetype == GLTEXTURETYPE_CUBEMAP ? 6 : 1;
        // get a texture number to use
-       qglGenTextures(1, &image->texnum);
+       qglGenTextures(1, (GLuint *)&image->texnum);
        *imagechainpointer = image;
        image->texturecount++;
 
diff --git a/host.c b/host.c
index 0fae48ff0a45a53d1d74e93e93824ee797278d80..99a1adcb36a95dde39bbc7e620dbbb5169e37b17 100644 (file)
--- a/host.c
+++ b/host.c
@@ -477,7 +477,7 @@ void Host_ShutdownServer(qboolean crash)
 {
        int i, count;
        sizebuf_t buf;
-       char message[4];
+       qbyte message[4];
 
        Con_DPrintf("Host_ShutdownServer\n");
 
index 65d516a7d8098afa9ef9c16b6da4d747666380ea..303ea0348263b6322861a737478284693d2e88a3 100644 (file)
@@ -586,7 +586,7 @@ void Host_Loadgame_f (void)
 
        cls.demonum = -1;               // stop demo loop in case this fails
 
-       t = text = FS_LoadFile (filename, tempmempool, false);
+       t = text = (char *)FS_LoadFile (filename, tempmempool, false);
        if (!text)
        {
                Con_Print("ERROR: couldn't open.\n");
@@ -904,7 +904,7 @@ void Host_Say(qboolean teamonly)
        const char *p1;
        char *p2;
        // LordHavoc: 256 char say messages
-       unsigned char text[256];
+       char text[256];
        qboolean fromServer = false;
 
        if (cmd_source == src_command)
diff --git a/lhnet.c b/lhnet.c
index f2f7b570146296627419cd32aa19cbbb47e81037..b80f09866b326622cb6e3d9b3f3147a35a5357b9 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -634,7 +634,7 @@ int LHNET_Read(lhnetsocket_t *lhnetsocket, void *content, int maxcontentlength,
        }
        else if (lhnetsocket->address.addresstype == LHNETADDRESSTYPE_INET4)
        {
-               int inetaddresslength;
+               unsigned int inetaddresslength;
                address->addresstype = LHNETADDRESSTYPE_NONE;
                inetaddresslength = sizeof(address->addressdata.inet4);
                value = recvfrom(lhnetsocket->inetsocket, content, maxcontentlength, 0, (struct sockaddr *)&address->addressdata.inet4, &inetaddresslength);
@@ -669,7 +669,7 @@ int LHNET_Read(lhnetsocket_t *lhnetsocket, void *content, int maxcontentlength,
        }
        else if (lhnetsocket->address.addresstype == LHNETADDRESSTYPE_INET6)
        {
-               int inetaddresslength;
+               unsigned int inetaddresslength;
                address->addresstype = LHNETADDRESSTYPE_NONE;
                inetaddresslength = sizeof(address->addressdata.inet6);
                value = recvfrom(lhnetsocket->inetsocket, content, maxcontentlength, 0, (struct sockaddr *)&address->addressdata.inet6, &inetaddresslength);
index 02b137db42c7caa185084d9433690d4170a51e95..2c3a0e95adfd6c0246b0eb39850c483ee3c1b99b 100644 (file)
@@ -3733,7 +3733,7 @@ static void Mod_Q3BSP_LoadTextures(lump_t *l)
        {
                for (i = 0;i < search->numfilenames;i++)
                {
-                       if ((f = FS_LoadFile(search->filenames[i], tempmempool, false)))
+                       if ((f = (char *)FS_LoadFile(search->filenames[i], tempmempool, false)))
                        {
                                text = f;
                                while (COM_ParseToken(&text, false))
index 684be2765c4851aeee7ebcbb384406bb15b6bf1f..7ff896c7a4a9791accf2597e41d19d9011390faa 100644 (file)
@@ -851,6 +851,8 @@ void Mod_ShadowMesh_CalcBBox(shadowmesh_t *firstmesh, vec3_t mins, vec3_t maxs,
        shadowmesh_t *mesh;
        vec3_t nmins, nmaxs, ncenter, temp;
        float nradius2, dist2, *v;
+       VectorClear(nmins);
+       VectorClear(nmaxs);
        // calculate bbox
        for (mesh = firstmesh;mesh;mesh = mesh->next)
        {
@@ -1075,7 +1077,7 @@ tag_torso,
 */
        memset(tagsets, 0, sizeof(tagsets));
        memset(word, 0, sizeof(word));
-       for (i = 0;i < MAX_SKINS && (data = text = FS_LoadFile(va("%s_%i.skin", loadmodel->name, i), tempmempool, true));i++)
+       for (i = 0;i < MAX_SKINS && (data = text = (char *)FS_LoadFile(va("%s_%i.skin", loadmodel->name, i), tempmempool, true));i++)
        {
                numtags = 0;
 
index a74f9bb985d10f31755d2ff4b2565b12e2ea37c7..ec41b6e4dbe1acc9775c7d52e529c0af629a7313 100644 (file)
@@ -38,7 +38,7 @@ void Mod_SpriteInit (void)
 }
 
 static int alphaonlytable[4] = {255 | 0x80000000, 255 | 0x80000000, 255 | 0x80000000, 3};
-static void Mod_Sprite_SharedSetup(const qbyte *datapointer, int version, const int *palette, const int *alphapalette)
+static void Mod_Sprite_SharedSetup(const qbyte *datapointer, int version, const unsigned int *palette, const unsigned int *alphapalette)
 {
        int                                     i, j, groupframes, realframes, x, y, origin[2], width, height;
        dspriteframetype_t      *pinframetype;
@@ -310,7 +310,7 @@ void Mod_IDSP_Load(model_t *mod, void *buffer, void *bufferend)
                        alphapalette[i][3] = palette[i][3];
                }
 
-               Mod_Sprite_SharedSetup(datapointer, LittleLong (pinhlsprite->version), (int *)(&palette[0][0]), (int *)(&alphapalette[0][0]));
+               Mod_Sprite_SharedSetup(datapointer, LittleLong (pinhlsprite->version), (unsigned int *)(&palette[0][0]), (unsigned int *)(&alphapalette[0][0]));
        }
        else
                Host_Error("Mod_IDSP_Load: %s has wrong version number (%i). Only %i (quake), %i (HalfLife), and %i (sprite32) supported",
index a82f977470f42546c82d0d0b9358e3cbfe119bd6..748db1b6e926098b7a2d7a9a0f5506d3470cab3e 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -1169,7 +1169,7 @@ int NetConn_ClientParsePacket(lhnetsocket_t *mysocket, qbyte *data, int length,
                        if (developer.integer)
                                Con_Printf("Datagram_ParseConnectionless: received CCREP_REJECT from %s.\n", addressstring2);
                        cls.connect_trying = false;
-                       M_Update_Return_Reason(data);
+                       M_Update_Return_Reason((char *)data);
                        break;
 #if 0
                case CCREP_SERVER_INFO:
index 9a11365be152dcfa2956f8acfe3815b79e0f611c..403dca3520922c2f846c4085a94477397ce431ab 100644 (file)
--- a/polygon.c
+++ b/polygon.c
@@ -96,9 +96,9 @@ void PolygonD_QuadForPlane(double *outpoints, double planenormalx, double planen
        outpoints[11] = planedist * planenormalz - quadsize * quadright[2] - quadsize * quadup[2];
 }
 
-void PolygonF_Divide(unsigned int innumpoints, const float *inpoints, float planenormalx, float planenormaly, float planenormalz, float planedist, float epsilon, unsigned int outfrontmaxpoints, float *outfrontpoints, unsigned int *neededfrontpoints, unsigned int outbackmaxpoints, float *outbackpoints, unsigned int *neededbackpoints)
+void PolygonF_Divide(int innumpoints, const float *inpoints, float planenormalx, float planenormaly, float planenormalz, float planedist, float epsilon, int outfrontmaxpoints, float *outfrontpoints, int *neededfrontpoints, int outbackmaxpoints, float *outbackpoints, int *neededbackpoints)
 {
-       unsigned int i, frontcount, backcount;
+       int i, frontcount, backcount;
        const float *n, *p;
        float frac, pdist, ndist;
        frontcount = 0;
@@ -154,9 +154,9 @@ void PolygonF_Divide(unsigned int innumpoints, const float *inpoints, float plan
                *neededbackpoints = backcount;
 }
 
-void PolygonD_Divide(unsigned int innumpoints, const double *inpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double epsilon, unsigned int outfrontmaxpoints, double *outfrontpoints, unsigned int *neededfrontpoints, unsigned int outbackmaxpoints, double *outbackpoints, unsigned int *neededbackpoints)
+void PolygonD_Divide(int innumpoints, const double *inpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double epsilon, int outfrontmaxpoints, double *outfrontpoints, int *neededfrontpoints, int outbackmaxpoints, double *outbackpoints, int *neededbackpoints)
 {
-       unsigned int i, frontcount, backcount;
+       int i, frontcount, backcount;
        const double *n, *p;
        double frac, pdist, ndist;
        frontcount = 0;
index d4a21064e2cf8c92083a996267f4e89aeadd6bd1..e5826b8af559264b568984aabc49a8f979232254 100644 (file)
--- a/polygon.h
+++ b/polygon.h
@@ -8,7 +8,7 @@ Polygon clipping routines written by Forest Hale and placed into public domain.
 
 void PolygonF_QuadForPlane(float *outpoints, float planenormalx, float planenormaly, float planenormalz, float planedist, float quadsize);
 void PolygonD_QuadForPlane(double *outpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double quadsize);
-void PolygonF_Divide(unsigned int innumpoints, const float *inpoints, float planenormalx, float planenormaly, float planenormalz, float planedist, float epsilon, unsigned int outfrontmaxpoints, float *outfrontpoints, unsigned int *neededfrontpoints, unsigned int outbackmaxpoints, float *outbackpoints, unsigned int *neededbackpoints);
-void PolygonD_Divide(unsigned int innumpoints, const double *inpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double epsilon, unsigned int outfrontmaxpoints, double *outfrontpoints, unsigned int *neededfrontpoints, unsigned int outbackmaxpoints, double *outbackpoints, unsigned int *neededbackpoints);
+void PolygonF_Divide(int innumpoints, const float *inpoints, float planenormalx, float planenormaly, float planenormalz, float planedist, float epsilon, int outfrontmaxpoints, float *outfrontpoints, int *neededfrontpoints, int outbackmaxpoints, float *outbackpoints, int *neededbackpoints);
+void PolygonD_Divide(int innumpoints, const double *inpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double epsilon, int outfrontmaxpoints, double *outfrontpoints, int *neededfrontpoints, int outbackmaxpoints, double *outbackpoints, int *neededbackpoints);
 
 #endif
index fbb54af8c51edbd360552703c9a8e2203c42da5b..44872affd1d54177f3239436aea3763dbdfd9bc5 100644 (file)
@@ -2104,7 +2104,7 @@ loadfromfile(string file)
 void VM_loadfromfile(void)
 {
        const char *filename;
-       qbyte *data;
+       char *data;
 
        VM_SAFEPARMCOUNT(1,VM_loadfromfile);
 
@@ -2121,7 +2121,7 @@ void VM_loadfromfile(void)
        }
 
        // not conform with VM_fopen
-       data = FS_LoadFile(filename, tempmempool, false);
+       data = (char *)FS_LoadFile(filename, tempmempool, false);
        if (data == NULL)
                PRVM_G_FLOAT(OFS_RETURN) = -1;
 
index 3a132f98658741b9222e53be57437c089f18fd2c..5788387e939edb5bb2b5e140d5e17c2e0c65d117 100644 (file)
@@ -63,12 +63,12 @@ OSStatus audioDeviceIOProc(AudioDeviceID inDevice,
        unsigned int sampleIndex;
        float *outBuffer;
        float scale;
-       
+
        offset = (s_chunkCount * submissionChunk) % maxMixedSamples;
        samples = s_mixedSamples + offset;
-       
+
        outBuffer = (float *)outOutputData->mBuffers[0].mData;
-       
+
        // If we have run out of samples, return silence
        if (s_chunkCount * submissionChunk > shm->format.channels * paintedtime)
        {
@@ -83,7 +83,7 @@ OSStatus audioDeviceIOProc(AudioDeviceID inDevice,
 
                s_chunkCount++; // this is the next buffer we will submit
        }
-       
+
        return 0;
 }
 
@@ -110,14 +110,14 @@ qboolean SNDDMA_Init(void)
                Con_Printf("AudioHardwareGetProperty returned %d\n", status);
                return false;
        }
-       
+
        if (outputDeviceID == kAudioDeviceUnknown)
        {
                Con_Printf("AudioHardwareGetProperty: outputDeviceID is kAudioDeviceUnknown\n");
                return false;
        }
 
-       // Configure the output device  
+       // Configure the output device
        // TODO: support "-sndspeed", "-sndmono" and "-sndstereo"
        propertySize = sizeof(bufferByteCount);
        bufferByteCount = CHUNK_SIZE * sizeof(float);
@@ -127,7 +127,7 @@ qboolean SNDDMA_Init(void)
                Con_Printf("AudioDeviceSetProperty: returned %d when setting kAudioDevicePropertyBufferSize to %d\n", status, CHUNK_SIZE);
                return false;
        }
-       
+
        propertySize = sizeof(bufferByteCount);
        status = AudioDeviceGetProperty(outputDeviceID, 0, false, kAudioDevicePropertyBufferSize, &propertySize, &bufferByteCount);
        if (status)
@@ -164,7 +164,7 @@ qboolean SNDDMA_Init(void)
                Con_Printf("Default Audio Device doesn't support Linear PCM!\n");
                return false;
        }
-       
+
        // Start sound running
        status = AudioDeviceAddIOProc(outputDeviceID, audioDeviceIOProc, NULL);
        if (status)
@@ -200,7 +200,7 @@ qboolean SNDDMA_Init(void)
        s_isRunning = true;
 
        Con_Printf("   Initialization successful\n");
-       
+
        return true;
 }
 
@@ -228,29 +228,29 @@ Reset the sound device for exiting
 void SNDDMA_Shutdown(void)
 {
        OSStatus status;
-       
+
        if (!s_isRunning)
                return;
-               
+
        status = AudioDeviceStop(outputDeviceID, audioDeviceIOProc);
        if (status)
        {
                Con_Printf("AudioDeviceStop: returned %d\n", status);
                return;
        }
-       
+
        s_isRunning = false;
-       
+
        status = AudioDeviceRemoveIOProc(outputDeviceID, audioDeviceIOProc);
        if (status)
        {
                Con_Printf("AudioDeviceRemoveIOProc: returned %d\n", status);
                return;
        }
-       
+
        Mem_Free(s_mixedSamples);
        s_mixedSamples = NULL;
-       shm->samples = NULL;
+       shm->buffer = NULL;
 }
 
 /*
index 76614bfad0ab89b9d85db27b11418b366cded533..80363c80274f1a9d9bc727569c9aaa73641afa11 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -355,7 +355,7 @@ qboolean SND_PaintChannelFrom8 (channel_t *ch, int count)
        // Stereo sound support
        if (ch->sfx->format.channels == 2)
        {
-               sfx = sb->data + (ch->pos - sb->offset) * 2;
+               sfx = (signed char *)sb->data + (ch->pos - sb->offset) * 2;
                for (i = 0;i < count;i++)
                {
                        paintbuffer[i].left += (*sfx++ * leftvol) >> 8;
@@ -364,13 +364,12 @@ qboolean SND_PaintChannelFrom8 (channel_t *ch, int count)
        }
        else
        {
-               sfx = sb->data + ch->pos - sb->offset;
+               sfx = (signed char *)sb->data + ch->pos - sb->offset;
                for (i = 0;i < count;i++)
                {
                        paintbuffer[i].left += (*sfx * leftvol) >> 8;
                        paintbuffer[i].right += (*sfx++ * rightvol) >> 8;
                }
-
        }
        ch->pos += count;
        return true;
index a95ce2319e3f3a3c59ed439f6b88d925cfb1b29c..7cba800bb8de0704a32cb67105cb36a46fa9e37b 100644 (file)
--- a/snd_ogg.c
+++ b/snd_ogg.c
@@ -498,7 +498,7 @@ static const sfxbuffer_t* OGG_FetchSound (channel_t* ch, unsigned int start, uns
        bigendian = 0;
 #endif
        done = 0;
-       while ((ret = qov_read (&per_ch->vf, &resampling_buffer[done], (int)(newlength - done), bigendian, 2, 1, &per_ch->bs)) > 0)
+       while ((ret = qov_read (&per_ch->vf, (char *)&resampling_buffer[done], (int)(newlength - done), bigendian, 2, 1, &per_ch->bs)) > 0)
                done += ret;
 
        // Resample in the sfxbuffer
@@ -529,7 +529,7 @@ static void OGG_FetchEnd (channel_t* ch)
 
                Mem_Free (per_ch);
                ch->fetcher_data = NULL;
-               
+
                format = &ch->sfx->format;
                buff_len = STREAM_BUFFER_SIZE(format);
                ch->sfx->memsize -= sizeof (*per_ch) - sizeof (per_ch->sb.data) + buff_len;
@@ -678,7 +678,7 @@ qboolean OGG_LoadVorbisFile (const char *filename, sfx_t *s)
                s->loopstart = -1;
                s->flags &= ~SFXFLAG_STREAMED;
 
-               sb->length = (unsigned int)ResampleSfx (buff, (size_t)done / (vi->channels * 2), &s->format, sb->data, s->name);
+               sb->length = (unsigned int)ResampleSfx ((qbyte *)buff, (size_t)done / (vi->channels * 2), &s->format, sb->data, s->name);
                s->format.speed = shm->format.speed;
                s->total_length = sb->length;
                sb->offset = 0;
index d8af145438f82936a48b894b86bb201ec9b59a0d..1aa9690ec4f64a9c332ab7a5d9a58562872252ff 100644 (file)
--- a/snd_wav.c
+++ b/snd_wav.c
@@ -86,7 +86,7 @@ static void FindNextChunk(char *name)
                }
                data_p -= 8;
                last_chunk = data_p + 8 + ( (iff_chunk_len + 1) & ~1 );
-               if (!strncmp(data_p, name, 4))
+               if (!strncmp((const char *)data_p, name, 4))
                        return;
        }
 }
@@ -139,7 +139,7 @@ static wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength)
 
        // find "RIFF" chunk
        FindChunk("RIFF");
-       if (!(data_p && !strncmp(data_p+8, "WAVE", 4)))
+       if (!(data_p && !strncmp((const char *)data_p+8, "WAVE", 4)))
        {
                Con_Print("Missing RIFF/WAVE chunks\n");
                return info;
@@ -179,7 +179,7 @@ static wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength)
                FindNextChunk ("LIST");
                if (data_p)
                {
-                       if (!strncmp (data_p + 28, "mark", 4))
+                       if (!strncmp ((const char *)data_p + 28, "mark", 4))
                        {       // this is not a proper parse, but it works with cooledit...
                                data_p += 24;
                                i = GetLittleLong ();   // samples in loop
index cf61df4cb89305dafeb8a9a7e4646693eab0c22f..4cb6c957ca5dc2ca1ab96688bcf797024412a24a 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -1524,8 +1524,8 @@ Tell all the clients that the server is changing levels
 */
 void SV_SendReconnect (void)
 {
-       char    data[128];
-       sizebuf_t       msg;
+       qbyte data[128];
+       sizebuf_t msg;
 
        msg.data = data;
        msg.cursize = 0;
@@ -1623,7 +1623,7 @@ void SV_SpawnServer (const char *server)
 {
        prvm_edict_t *ent;
        int i;
-       qbyte *entities;
+       char *entities;
        model_t *worldmodel;
        char modelname[sizeof(sv.modelname)];
 
@@ -1793,7 +1793,7 @@ void SV_SpawnServer (const char *server)
        // load replacement entity file if found
        entities = NULL;
        if (sv_entpatch.integer)
-               entities = FS_LoadFile(va("maps/%s.ent", sv.name), tempmempool, true);
+               entities = (char *)FS_LoadFile(va("maps/%s.ent", sv.name), tempmempool, true);
        if (entities)
        {
                Con_Printf("Loaded maps/%s.ent\n", sv.name);
index 6e3f566392f0b9c709a113d1fe2290d010ee9a44..6fa1e75a921b4e0de2998b5325e0909855ef36e3 100644 (file)
--- a/vid_agl.c
+++ b/vid_agl.c
@@ -198,16 +198,16 @@ void VID_Shutdown(void)
 {
        if (context == NULL || window == NULL)
                return;
-       
+
        IN_Activate(false);
        VID_RestoreSystemGamma();
-       
+
        if (context != NULL)
        {
                qaglDestroyContext(context);
                context = NULL;
        }
-       
+
        if (window != NULL)
        {
                DisposeWindow(window);
@@ -227,7 +227,7 @@ static qboolean AsyncEvent_Collapsed = false;
 static OSStatus MainWindowEventHandler (EventHandlerCallRef nextHandler, EventRef event, void *userData)
 {
        OSStatus err = noErr;
-       
+
        switch (GetEventKind (event))
        {
                case kEventWindowClosed:
@@ -271,7 +271,7 @@ static void VID_ProcessPendingAsyncEvents (void)
                vid_activewindow = false;
                VID_RestoreSystemGamma();
        }
-       
+
        // Closed
        if (AsyncEvent_Quitting)
        {
@@ -347,7 +347,7 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
                Con_Printf("Unable to create window (error %d)\n", carbonError);
                return false;
        }
-       
+
        // Set the window title
        CFStringRef windowTitle = CFSTR("DarkPlaces AGL");
        SetWindowTitleWithCFString(window, windowTitle);
@@ -356,7 +356,7 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
        // Install the callback function for the window events we can't get
        // through ReceiveNextEvent (i.e. close, collapse, and expand)
        InstallWindowEventHandler (window, NewEventHandlerUPP (MainWindowEventHandler),
-                                                          GetEventTypeCount(winEvents), winEvents, window, NULL); 
+                                                          GetEventTypeCount(winEvents), winEvents, window, NULL);
 
        screen = GetGWorldDevice(GetWindowPort(window));
        if (screen == NULL)
@@ -385,7 +385,7 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
                Sys_Error ("aglSetDrawable failed\n");
        if (!qaglSetCurrentContext(context))
                Sys_Error ("aglSetCurrentContext failed\n");
-       
+
        scr_width = width;
        scr_height = height;
 
@@ -399,10 +399,10 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
                vid_isfullscreen = true;
        }
 
-       gl_renderer = qglGetString(GL_RENDERER);
-       gl_vendor = qglGetString(GL_VENDOR);
-       gl_version = qglGetString(GL_VERSION);
-       gl_extensions = qglGetString(GL_EXTENSIONS);
+       gl_renderer = (const char *)qglGetString(GL_RENDERER);
+       gl_vendor = (const char *)qglGetString(GL_VENDOR);
+       gl_version = (const char *)qglGetString(GL_VERSION);
+       gl_extensions = (const char *)qglGetString(GL_EXTENSIONS);
        gl_platform = "AGL";
        gl_videosyncavailable = false;
 
@@ -529,8 +529,8 @@ void Sys_SendKeyEvents(void)
 {
        EventRef theEvent;
        EventTargetRef theTarget;
-       
-       // Start by processing the asynchronous events we received since the previous frame 
+
+       // Start by processing the asynchronous events we received since the previous frame
        VID_ProcessPendingAsyncEvents();
 
        theTarget = GetEventDispatcherTarget();
@@ -573,7 +573,7 @@ void Sys_SendKeyEvents(void)
                                        case kEventMouseMoved:
                                        {
                                                HIPoint deltaPos;
-                                               
+
                                                GetEventParameter(theEvent, kEventParamMouseDelta, typeHIPoint, NULL, sizeof(deltaPos), NULL, &deltaPos);
                                                //Con_Printf(">> kEventMouseMoved (%f, %f) <<\n", deltaPos.x, deltaPos.y);
 
@@ -627,7 +627,7 @@ void Sys_SendKeyEvents(void)
                                                Handle_Key(keycode, false);
                                                //Con_Printf(">> kEventRawKeyUp (%d) <<\n", keycode);
                                                break;
-                                       
+
                                        case kEventRawKeyModifiersChanged:
                                        {
                                                UInt32 keymod = 0;
index 295d8bca9174781c5b6f611c03af3a58f2bb2bc0..940f57df7c0f662fc25ae79f7584940c6d31aa88 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -426,10 +426,10 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
        // enable key repeat since everyone expects it
        SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
 
-       gl_renderer = qglGetString(GL_RENDERER);
-       gl_vendor = qglGetString(GL_VENDOR);
-       gl_version = qglGetString(GL_VERSION);
-       gl_extensions = qglGetString(GL_EXTENSIONS);
+       gl_renderer = (const char *)qglGetString(GL_RENDERER);
+       gl_vendor = (const char *)qglGetString(GL_VENDOR);
+       gl_version = (const char *)qglGetString(GL_VERSION);
+       gl_extensions = (const char *)qglGetString(GL_EXTENSIONS);
        gl_platform = "SDL";
        // Knghtbrd: should assign platform-specific extensions here
        //TODO: maybe ;)
diff --git a/view.c b/view.c
index bc02ec6ad1e088460e549b33a71e611228438c4c..60da3e3dfdf007f4bdf4d4c732300c5637b68ca0 100644 (file)
--- a/view.c
+++ b/view.c
@@ -321,6 +321,7 @@ void V_CalcRefdef (void)
        entity_t *ent;
        float vieworg[3], gunorg[3], viewangles[3];
        trace_t trace;
+       VectorClear(gunorg);
        Matrix4x4_CreateIdentity(&viewmodelmatrix);
        Matrix4x4_CreateIdentity(&r_refdef.viewentitymatrix);
        if (cls.state == ca_connected && cls.signon == SIGNONS)