Fix new compiler warnings.

This commit is contained in:
Marco Cawthorne 2020-05-30 23:08:11 +02:00
parent fcb99ad427
commit 828a41eff8
9 changed files with 28 additions and 27 deletions

View File

@ -29,7 +29,7 @@ string Colors_RGB8_to_HEX(vector color)
string out = "^x";
for (int i = 0; i < 3; i++) {
string a;
string a = "";
float b = rint(color[i] * 15);
switch (b) {

View File

@ -87,7 +87,7 @@ string
Sentences_GetSamples(string word)
{
int len;
int gc;
int gc = 0;
/* you never know what NPCs might do */
if (word == "") {

View File

@ -48,7 +48,7 @@ CSEv_TeamJoin_f(float f)
}
player pl = (player)self;
entity spot;
entity spot = world;
pl.classname = "player";
pl.health = self.max_health = 100;

View File

@ -43,7 +43,7 @@ int Weapons_AddItem(base_player pl, int w, int startammo)
maxit = rules.MaxItemPerSlot(g_weapons[w].slot);
if (maxit > 0) {
int wantslot = g_weapons[w].slot;
int c;
int c = 0;
for (int i = 0; i < g_weapons.length; i++) {
if (pl.g_items & g_weapons[i].id && g_weapons[i].slot == wantslot) {
c++;

View File

@ -51,10 +51,10 @@ w_displacer_precache(void)
precache_sound("weapons/displacer_teleport.wav");
precache_sound("weapons/displacer_teleport_player.wav");
precache_model("models/w_displacer.mdl");
precache_model("sprites/exit1.spr");
#else
precache_model("models/v_displacer.mdl");
precache_model("models/p_displacer.mdl");
precache_model("sprites/exit1.spr");
#endif
}

View File

@ -255,7 +255,6 @@ Sound_Precache(string shader)
dprint("\n");
search_end(sh);
fclose(fh);
return -1;
}
@ -269,6 +268,7 @@ Sound_Play(entity target, int chan, string shader)
int flag;
int sample;
flag = 0;
sample = (int)hash_get(g_hashsounds, shader);
if (sample < 0) {
@ -351,9 +351,10 @@ Sound_PlayAt(vector pos, string shader)
int r;
float radius;
float pitch;
int flags;
int flag;
int sample;
flag = 0;
sample = (int)hash_get(g_hashsounds, shader);
if (sample < 0) {
@ -369,13 +370,13 @@ Sound_PlayAt(vector pos, string shader)
/* flags */
if (g_sounds[sample].flags & SNDFL_NOREVERB) {
flags |= SOUNDFLAG_NOREVERB;
flag |= SOUNDFLAG_NOREVERB;
}
if (g_sounds[sample].flags & SNDFL_GLOBAL) {
radius = 0;
}
if (g_sounds[sample].flags & SNDFL_LOOPING) {
flags |= SOUNDFLAG_FORCELOOP;
flag |= SOUNDFLAG_FORCELOOP;
}
if (g_sounds[sample].flags & SNDFL_NODUPS) {
if (g_sounds[sample].playc >= g_sounds[sample].sample_count) {
@ -385,7 +386,7 @@ Sound_PlayAt(vector pos, string shader)
}
#ifdef CLIENT
if (g_sounds[sample].flags & SNDFL_OMNI) {
flags |= SOUNDFLAG_NOSPACIALISE;
flag |= SOUNDFLAG_NOSPACIALISE;
}
#endif
@ -400,7 +401,7 @@ Sound_Update(entity target, int channel, int sample, float volume)
int r;
float radius;
float pitch;
int flags;
int flag;
if (sample < 0) {
return;
@ -413,16 +414,17 @@ Sound_Update(entity target, int channel, int sample, float volume)
/* set pitch */
pitch = random(g_sounds[sample].pitch_min, g_sounds[sample].pitch_max);
radius = g_sounds[sample].dist_max;
flag = 0;
/* flags */
if (g_sounds[sample].flags & SNDFL_NOREVERB) {
flags |= SOUNDFLAG_NOREVERB;
flag |= SOUNDFLAG_NOREVERB;
}
if (g_sounds[sample].flags & SNDFL_GLOBAL) {
radius = ATTN_NONE;
}
if (g_sounds[sample].flags & SNDFL_LOOPING) {
flags |= SOUNDFLAG_FORCELOOP;
flag |= SOUNDFLAG_FORCELOOP;
}
if (g_sounds[sample].flags & SNDFL_NODUPS) {
if (g_sounds[sample].playc >= g_sounds[sample].sample_count) {
@ -431,7 +433,7 @@ Sound_Update(entity target, int channel, int sample, float volume)
r = g_sounds[sample].playc++;
}
if (g_sounds[sample].flags & SNDFL_OMNI) {
flags |= SOUNDFLAG_NOSPACIALISE;
flag |= SOUNDFLAG_NOSPACIALISE;
}
soundupdate(
@ -441,7 +443,7 @@ Sound_Update(entity target, int channel, int sample, float volume)
g_sounds[sample].volume * volume,
radius,
pitch,
flags,
flag,
g_sounds[sample].offset
);
}
@ -452,7 +454,7 @@ Sound_Speak(entity target, string shader)
int r;
float radius;
float pitch;
int flags;
int flag;
int sample;
sample = (int)hash_get(g_hashsounds, shader);
@ -468,16 +470,17 @@ Sound_Speak(entity target, string shader)
/* set pitch */
pitch = random(g_sounds[sample].pitch_min, g_sounds[sample].pitch_max);
radius = g_sounds[sample].dist_max;
flag = 0;
/* flags */
if (g_sounds[sample].flags & SNDFL_NOREVERB) {
flags |= SOUNDFLAG_NOREVERB;
flag |= SOUNDFLAG_NOREVERB;
}
if (g_sounds[sample].flags & SNDFL_GLOBAL) {
radius = ATTN_NONE;
}
if (g_sounds[sample].flags & SNDFL_LOOPING) {
flags |= SOUNDFLAG_FORCELOOP;
flag |= SOUNDFLAG_FORCELOOP;
}
if (g_sounds[sample].flags & SNDFL_NODUPS) {
if (g_sounds[sample].playc >= g_sounds[sample].sample_count) {
@ -486,11 +489,11 @@ Sound_Speak(entity target, string shader)
r = g_sounds[sample].playc++;
}
if (g_sounds[sample].flags & SNDFL_FOLLOW) {
flags |= SOUNDFLAG_FOLLOW;
flag |= SOUNDFLAG_FOLLOW;
}
if (g_sounds[sample].flags & SNDFL_PRIVATE) {
flags |= SOUNDFLAG_UNICAST;
flag |= SOUNDFLAG_UNICAST;
msg_entity = target;
}

View File

@ -67,7 +67,7 @@ FX_BreakModel(int count, vector vMins, vector vMaxs, vector vVel, float fStyle)
#else
static void FX_BreakModel_Remove(void) { remove(self) ; }
float fModelCount;
float fModelCount = 0;
vector vecPos;
string sModel = "";
@ -109,9 +109,7 @@ FX_BreakModel(int count, vector vMins, vector vMaxs, vector vVel, float fStyle)
}
vector vWorldPos;
vWorldPos[0] = vMins[0] + (0.5 * (vMaxs[0] - vMins[0]));
vWorldPos[1] = vMins[1] + (0.5 * (vMaxs[1] - vMins[1]));
vWorldPos[2] = vMins[2] + (0.5 * (vMaxs[2] - vMins[2]));
vWorldPos = vMins + (0.5 * (vMaxs - vMins));
switch (fStyle) {
case GSMATERIAL_GLASS:

View File

@ -131,9 +131,9 @@ void w_gauss_precache(void)
precache_sound("weapons/electro4.wav");
precache_sound("weapons/electro5.wav");
precache_sound("weapons/electro6.wav");
precache_sound("ambience/pulsemachine.wav");
precache_sound("weapons/gauss2.wav");
#else
precache_sound("ambience/pulsemachine.wav");
precache_model("models/v_gauss.mdl");
precache_model("models/p_gauss.mdl");
#endif

View File

@ -41,8 +41,8 @@ Font_Load (string strFile, font_s &fntNew)
fntNew.flAlpha = 1.0f;
fntNew.iFlags = 0;
#else
string strTemp;
string strFontPath;
string strTemp = "";
string strFontPath = "";
filestream fileFont = fopen(strFile, FILE_READ);
fntNew.iID = 0;
fntNew.iScale = 8;