fixed msvc6 warnings

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1895 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Lance 2006-01-27 08:06:48 +00:00
parent 80d7e00dbb
commit 20ef474862
12 changed files with 163 additions and 60 deletions

View file

@ -686,8 +686,6 @@ int sizeofcoord=2;
int sizeofangle=1;
float MSG_FromCoord(coorddata c, int bytes)
{
#pragma warning(disable:4701)
switch(bytes)
{
case 2: //encode 1/8th precision, giving -4096 to 4096 map sizes
@ -1145,9 +1143,7 @@ char *MSG_ReadStringLine (void)
float MSG_ReadCoord (void)
{
#pragma warning(disable:4701)
coorddata c;
coorddata c = {0};
MSG_ReadData(&c, sizeofcoord);
return MSG_FromCoord(c, sizeofcoord);
}
@ -2696,6 +2692,87 @@ void Info_SetValueForStarKey (char *s, const char *key, const char *value, int m
*s = 0;
}
void Info_SetValueForStarKeyMoodles (char *s, const char *key, int value, int maxsize)
{
char newv[1024], *v;
int c;
#ifdef SERVERONLY
extern cvar_t sv_highchars;
#endif
if (strstr (key, "\\"))
{
Con_TPrintf (TL_KEYHASSLASH);
return;
}
if (strstr (key, "\"") )
{
Con_TPrintf (TL_KEYHASQUOTE);
return;
}
if (strlen(key) >= MAX_INFO_KEY)
{
Con_TPrintf (TL_KEYTOOLONG);
return;
}
// this next line is kinda trippy
if (*(v = Info_ValueForKey(s, key)))
{
if (*Info_ValueForKey(s, "*ver")) //quick hack to kill off unneeded info on overflow. We can't simply increase the quantity of this stuff.
{
Info_RemoveKey(s, "*ver");
Info_SetValueForStarKeyMoodles (s, key, value, maxsize);
return;
}
Con_TPrintf (TL_INFOSTRINGTOOLONG);
return;
}
Info_RemoveKey (s, key);
if (!value)
return;
_snprintf (newv, sizeof(newv), "\\%s\\%s", key, value);
if ((int)(strlen(newv) + strlen(s) + 1) > maxsize)
{
Con_TPrintf (TL_INFOSTRINGTOOLONG);
return;
}
// only copy ascii values
s += strlen(s);
v = newv;
while (*v)
{
c = (unsigned char)*v++;
#ifndef SERVERONLY
// client only allows highbits on name
if (stricmp(key, "name") != 0) {
c &= 127;
if (c < 32 || c > 127)
continue;
// auto lowercase team
if (stricmp(key, "team") == 0)
c = tolower(c);
}
#else
if (!sv_highchars.value) {
c &= 127;
if (c < 32 || c > 127)
continue;
}
#endif
// c &= 127; // strip high bits
if (c > 13) // && c < 127)
*s++ = c;
}
*s = 0;
}
void Info_SetValueForKey (char *s, const char *key, const char *value, int maxsize)
{
if (key[0] == '*')
@ -2707,6 +2784,17 @@ void Info_SetValueForKey (char *s, const char *key, const char *value, int maxsi
Info_SetValueForStarKey (s, key, value, maxsize);
}
void Info_SetValueForKeyMoodles (char *s, const char *key, int value, int maxsize) //modified to accept an integer in svq3_game.c
{
if (key[0] == '*')
{
Con_TPrintf (TL_STARKEYPROTECTED);
return;
}
Info_SetValueForStarKeyMoodles (s, key, value, maxsize);
}
void Info_Print (char *s)
{
char key[1024];

View file

@ -803,7 +803,7 @@ static void *FSZIP_LoadZipFile (vfsfile_t *packhandle, char *desc)
zipfile_t *zip;
packfile_t *newfiles;
unz_global_info globalinf;
unz_global_info globalinf = {0};
unz_file_info file_info;

View file

@ -1365,7 +1365,7 @@ void NET_GetLocalAddress (int socket, netadr_t *out)
char buff[512];
struct sockaddr_qstorage address;
int namelen;
netadr_t adr;
netadr_t adr = {0};
qboolean notvalid = false;
strcpy(buff, "localhost");

View file

@ -213,15 +213,15 @@ local unsigned long unzlocal_SearchCentralDir(vfsfile_t *fin) {
of this unzip package.
*/
extern unzFile ZEXPORT unzOpen (vfsfile_t *fin) {
unz_s us;
unz_s us = {0};
unz_s *s;
unsigned long central_pos,uL;
unsigned long number_disk; /* number of the current dist, used for
unsigned long number_disk = 0; /* number of the current dist, used for
spaning ZIP, unsupported, always 0*/
unsigned long number_disk_with_CD; /* number the the disk with central dir, used
unsigned long number_disk_with_CD = 0; /* number the the disk with central dir, used
for spaning ZIP, unsupported, always 0*/
unsigned long number_entry_CD; /* total number of entries in
unsigned long number_entry_CD = 0; /* total number of entries in
the central dir
(same than number_entry on nospan) */
@ -335,9 +335,9 @@ local int unzlocal_GetCurrentFileInfoInternal (unzFile file,
char *szComment, unsigned long commentBufferSize) {
unz_s* s;
unz_file_info file_info;
unz_file_info_internal file_info_internal;
unz_file_info_internal file_info_internal = {0};
int err=UNZ_OK;
unsigned long uMagic;
unsigned long uMagic = 0;
long lSeek=0;
if (!file) return UNZ_PARAMERROR;
@ -515,9 +515,9 @@ extern int ZEXPORT unzLocateFileMy (unzFile file, unsigned long num, unsigned lo
local int unzlocal_CheckCurrentFileCoherencyHeader (unz_s *s, unsigned int *piSizeVar,
unsigned long *poffset_local_extrafield,
unsigned int *psize_local_extrafield) {
unsigned long uMagic,uData,uFlags;
unsigned long size_filename;
unsigned long size_extra_field;
unsigned long uMagic = 0,uData = 0,uFlags = 0;
unsigned long size_filename = 0;
unsigned long size_extra_field = 0;
int err=UNZ_OK;
*piSizeVar = 0;

View file

@ -1845,6 +1845,10 @@ void R_DrawGAliasModel (entity_t *e)
}
#ifdef Q3SHADERS
//if they're in different files it's probably just the compiler not knowing the return type when it reaches that line so it guesses int
//timeserv thinks we need a prototype (whatever that is) ~ Moodles
#pragma warning(disable:4047)
fog = CM_FogForOrigin(currententity->origin);
#endif
@ -4697,7 +4701,8 @@ void GLMod_LoadDarkPlacesModel(model_t *mod, void *buffer)
galiasbone_t *outbone;
dpmbone_t *inbone;
float *inst, *outst;
float *inst; //unreferenced local variable in the dedicated server
float *outst = 0;
float *outposedata;

View file

@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//#define GL_USE8BITTEX
int gl_anisotropy_factor = 1;
int glx, gly, glwidth, glheight;
mesh_t draw_mesh;
@ -109,7 +110,6 @@ int gl_alpha_format = 4;
int gl_filter_min = GL_LINEAR_MIPMAP_NEAREST;
int gl_filter_max = GL_LINEAR;
int gl_anisotropy_factor = 1;
int gl_anisotropy_factor_max = 0;
@ -3092,6 +3092,8 @@ done:
if (gl_config.sgis_generate_mipmap&&mipmap)
qglTexParameterf(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE);
qglTexParameterf(GL_TEXTURE_2D, GL_MULTISAMPLE_ARB, GL_FALSE);
if (gl_config.ext_texture_filter_anisotropic)
{
qglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,gl_anisotropy_factor); // without this, you could loose anisotropy on mapchange

View file

@ -2017,7 +2017,7 @@ void Shader_Default2D(char *shortname, shader_t *s)
int R_LoadShader ( char *name, void(*defaultgen)(char *name, shader_t*))
{
int i, f = -1;
unsigned int offset, length = 0;
unsigned int offset = 0, length = 0;
char shortname[MAX_QPATH], path[MAX_QPATH];
char *buf = NULL, *ts = NULL;
shader_t *s;

View file

@ -526,6 +526,10 @@ typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei
#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
#endif
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
#define WGL_SAMPLES_ARB 0x2042
#define GL_MULTISAMPLE_ARB 0x809D

View file

@ -40,6 +40,7 @@ crosses a waterline.
int needcleanup;
int fatbytes;
int glowsize, glowcolor; // made it a global variable, to suppress msvc warning.
qbyte fatpvs[(MAX_MAP_LEAFS+1)/4];
@ -1810,8 +1811,6 @@ int i, eff;
float miss;
unsigned int bits=0;
int glowsize, glowcolor;
for (i=0 ; i<3 ; i++)
{
miss = ent->v->origin[i] - ent->baseline.origin[i];

View file

@ -171,7 +171,7 @@ qboolean Rank_OpenRankings(void)
void LINKUN(int id)
{
int idnext, idprev;
rankheader_t hnext, hprev, info;
rankheader_t hnext = {0}, hprev = {0}, info;
READ_PLAYERHEADER(id, &info);
@ -211,7 +211,7 @@ void LINKUN(int id)
void LINKBEFORE(int bef, int id, rankheader_t *info)
{
int idnext, idprev;
rankheader_t hnext, hprev;
rankheader_t hnext, hprev = {0};
if (!bef)
Sys_Error("Cannot link before no entry\n");
@ -250,7 +250,7 @@ void LINKBEFORE(int bef, int id, rankheader_t *info)
void LINKAFTER(int aft, int id, rankheader_t *info)
{
int idnext, idprev;
rankheader_t hnext, hprev;
rankheader_t hnext = {0}, hprev = {0};
idprev = aft;
if (idprev)
@ -793,7 +793,7 @@ void Rank_Refresh_f(void)
if (host_client->rankid)
{
rankstats_t rs;
rankstats_t rs = {0};
Rank_GetPlayerStats(host_client->rankid, &rs);
rs.timeonserver += realtime - host_client->stats_started;
host_client->stats_started = realtime;
@ -815,7 +815,7 @@ void Rank_RCon_f(void)
{
int gofor, num, id;
int newlevel;
rankstats_t rs;
rankstats_t rs = {0};
rankinfo_t ri;
if (!Rank_OpenRankings())

View file

@ -1873,7 +1873,8 @@ SV_Say
void SV_Say (qboolean team)
{
client_t *client;
int j, tmp;
int j;
//int tmp; //unreferenced
char *p;
char text[1024];
char t1[32], *t2;

View file

@ -1824,7 +1824,7 @@ void SV_InitBotLib()
qboolean SVQ3_InitGame(void)
{
char buffer[8192];
char *str;
int str;
char sysinfo[8192];
extern cvar_t progs;
@ -1859,14 +1859,18 @@ qboolean SVQ3_InitGame(void)
sysinfo[0] = '\0';
Info_SetValueForKey(sysinfo, "sv_serverid", va("%i", svs.spawncount), MAX_SERVERINFO_STRING);
str = FS_GetPackHashes(buffer, sizeof(buffer), false);
Info_SetValueForKey(sysinfo, "sv_paks", str, MAX_SERVERINFO_STRING);
Info_SetValueForKeyMoodles(sysinfo, "sv_paks", str, MAX_SERVERINFO_STRING); // modified to accept an integer
str = FS_GetPackNames(buffer, sizeof(buffer), false);
Info_SetValueForKey(sysinfo, "sv_pakNames", str, MAX_SERVERINFO_STRING);
Info_SetValueForKeyMoodles(sysinfo, "sv_pakNames", str, MAX_SERVERINFO_STRING); // modified to accept an integer
str = FS_GetPackHashes(buffer, sizeof(buffer), true);
Info_SetValueForKey(sysinfo, "sv_referencedPaks", str, MAX_SERVERINFO_STRING);
Info_SetValueForKeyMoodles(sysinfo, "sv_referencedPaks", str, MAX_SERVERINFO_STRING); // modified to accept an integer
str = FS_GetPackNames(buffer, sizeof(buffer), true);
Info_SetValueForKey(sysinfo, "sv_referencedPakNames", str, MAX_SERVERINFO_STRING);
Info_SetValueForKeyMoodles(sysinfo, "sv_referencedPakNames", str, MAX_SERVERINFO_STRING); // modified to accept an integer
Info_SetValueForKey(sysinfo, "sv_pure", "1", MAX_SERVERINFO_STRING);
@ -1968,7 +1972,7 @@ void SVQ3_CreateBaseline(void)
//Writes the entities to the clients
void SVQ3_EmitPacketEntities(client_t *client, q3client_frame_t *from, q3client_frame_t *to, sizebuf_t *msg)
{
q3entityState_t *oldent, *newent;
q3entityState_t *oldent = {0}, *newent = {0};
int oldindex, newindex;
int oldnum, newnum;
int from_num_entities;