diff --git a/source/src/bot/bot.cpp b/source/src/bot/bot.cpp index 3eb46344..95203080 100644 --- a/source/src/bot/bot.cpp +++ b/source/src/bot/bot.cpp @@ -469,6 +469,8 @@ void CBot::ResetCurrentTask() case STATE_NORMAL: m_iStrafeTime = m_iMoveDir = 0; break; + default: + break; } } diff --git a/source/src/client.cpp b/source/src/client.cpp index b0f22612..dec39da1 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -363,5 +363,8 @@ void gets2c() // get updates from the server if(!disconnecting || event.data) conoutf("\fserver network error, disconnecting (%s) ...", disc_reasons[event.data]); disconnect(); return; + + default: + break; } }; diff --git a/source/src/command.cpp b/source/src/command.cpp index 78289b39..14f5c181 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -284,7 +284,7 @@ void concat(char *s) { alias("s", s); }; void concatword(char *s) { - for(char *a = s, *b = s; *a = *b; b++) if(*a!=' ') a++; + for(char *a = s, *b = s; (*a = *b); b++) if(*a!=' ') a++; concat(s); }; @@ -299,7 +299,11 @@ int listlen(char *a) void at(char *s, char *pos) { int n = atoi(pos); - loopi(n) s += strspn(s += strcspn(s, " \0"), " "); + loopi(n) + { + s += strcspn(s, " \0"); + s += strspn(s, " "); + }; s[strcspn(s, " \0")] = 0; concat(s); }; diff --git a/source/src/main.cpp b/source/src/main.cpp index 38342f0f..899c6c14 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -43,9 +43,9 @@ void screenshot() SDL_Surface *image; SDL_Surface *temp; int idx; - if(image = SDL_CreateRGBSurface(SDL_SWSURFACE, scr_w, scr_h, 24, 0x0000FF, 0x00FF00, 0xFF0000, 0)) + if((image = SDL_CreateRGBSurface(SDL_SWSURFACE, scr_w, scr_h, 24, 0x0000FF, 0x00FF00, 0xFF0000, 0))) { - if(temp = SDL_CreateRGBSurface(SDL_SWSURFACE, scr_w, scr_h, 24, 0x0000FF, 0x00FF00, 0xFF0000, 0)) + if((temp = SDL_CreateRGBSurface(SDL_SWSURFACE, scr_w, scr_h, 24, 0x0000FF, 0x00FF00, 0xFF0000, 0))) { glReadPixels(0, 0, scr_w, scr_h, GL_RGB, GL_UNSIGNED_BYTE, image->pixels); for (idx = 0; idxid); - for(sphere *p, **pp = &slist; p = *pp;) + for(sphere *p, **pp = &slist; (p = *pp);) { glPushMatrix(); float size = p->size/p->max; diff --git a/source/src/renderparticles.cpp b/source/src/renderparticles.cpp index a80907e5..5cfef367 100644 --- a/source/src/renderparticles.cpp +++ b/source/src/renderparticles.cpp @@ -79,7 +79,7 @@ void render_particles(int time) int numrender = 0; parttype *lastpt = NULL; - for(particle *p, **pp = &parlist; p = *pp;) + for(particle *p, **pp = &parlist; (p = *pp);) { // if(p->type==9 && p->tex!=-1) parttypes[9].tex = p->tex; // hack, AH parttype &pt = parttypes[p->type]; diff --git a/source/src/savegamedemo.cpp b/source/src/savegamedemo.cpp index db97b623..cbc71a37 100644 --- a/source/src/savegamedemo.cpp +++ b/source/src/savegamedemo.cpp @@ -267,7 +267,7 @@ void demoplaybackstep() ASSERT(target); int extras; - if(extras = gzget()) // read additional client side state not present in normal network stream + if((extras = gzget())) // read additional client side state not present in normal network stream { target->gunselect = gzget(); target->lastattackgun = gzget(); @@ -279,8 +279,8 @@ void demoplaybackstep() loopi(NUMGUNS) target->ammo[i] = gzget(); target->state = gzget(); target->lastmove = playbacktime; - if(bdamage = gzgeti()) damageblend(bdamage); - if(ddamage = gzgeti()) { gzgetv(dorig); particle_splash(3, ddamage, 1000, dorig); }; + if((bdamage = gzgeti())) damageblend(bdamage); + if((ddamage = gzgeti())) { gzgetv(dorig); particle_splash(3, ddamage, 1000, dorig); }; // FIXME: set more client state here }; diff --git a/source/src/server.cpp b/source/src/server.cpp index c82b669f..6be12fe4 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -1275,6 +1275,9 @@ void serverslice(int seconds, unsigned int timeout) // main server update, cal event.peer->data = (void *)-1; break; }; + + default: + break; }; }; sendworldstate(); diff --git a/source/src/sound.cpp b/source/src/sound.cpp index ac23a436..9ad27ffa 100644 --- a/source/src/sound.cpp +++ b/source/src/sound.cpp @@ -98,18 +98,18 @@ void music(char *name) s_strcpy(sn, "packages/audio/songs/"); s_strcat(sn, name); #ifdef USE_MIXER - if(mod = Mix_LoadMUS(path(sn))) + if((mod = Mix_LoadMUS(path(sn)))) { Mix_PlayMusic(mod, -1); Mix_VolumeMusic((musicvol*MAXVOL)/255); } #else - if(mod = FMUSIC_LoadSong(path(sn))) + if((mod = FMUSIC_LoadSong(path(sn)))) { FMUSIC_PlaySong(mod); FMUSIC_SetMasterVolume(mod, musicvol); } - else if(stream = FSOUND_Stream_Open(path(sn), FSOUND_LOOP_NORMAL, 0, 0)) + else if((stream = FSOUND_Stream_Open(path(sn), FSOUND_LOOP_NORMAL, 0, 0))) { int chan = FSOUND_Stream_Play(FSOUND_FREE, stream); if(chan>=0) { FSOUND_SetVolume(chan, (musicvol*MAXVOL)/255); FSOUND_SetPaused(chan, false); }; diff --git a/source/src/tools.cpp b/source/src/tools.cpp index 21bbe814..f72cf951 100644 --- a/source/src/tools.cpp +++ b/source/src/tools.cpp @@ -8,7 +8,7 @@ char *path(char *s) { - for(char *t = s; t = strpbrk(t, "/\\"); *t++ = PATHDIV); + for(char *t = s; (t = strpbrk(t, "/\\")); *t++ = PATHDIV); return s; };