compiler warning/error fixes

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5202 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2018-01-23 01:22:29 +00:00
parent 5fcc3d5524
commit 999d677515
7 changed files with 18 additions and 22 deletions

View file

@ -2126,7 +2126,7 @@ void CL_SendCmd (double frametime, qboolean mainloop)
else else
{ {
// don't count this message when calculating PL // don't count this message when calculating PL
cl.outframes[i].latency = -3; cl.outframes[(cl.movesequence-1) & UPDATE_MASK].latency = -3;
// drop this message // drop this message
cls.netchan.outgoing_sequence++; cls.netchan.outgoing_sequence++;
dropcount++; dropcount++;

View file

@ -6212,6 +6212,7 @@ static void Image_LoadHiResTextureWorker(void *ctx, void *data, size_t a, size_t
if (!tex_path[i].enabled) if (!tex_path[i].enabled)
continue; continue;
buf = NULL; buf = NULL;
fsize = 0;
if (tex_path[i].args == 3 && tex->subpath) if (tex_path[i].args == 3 && tex->subpath)
{ {
char subpath[MAX_QPATH]; char subpath[MAX_QPATH];

View file

@ -39,14 +39,14 @@ This file came to FTE via EzQuake.
typedef struct typedef struct
{ {
unsigned int state[5]; unsigned int state[5];
unsigned int count[2]; size_t count[2];
unsigned char buffer[64]; unsigned char buffer[64];
} SHA1_CTX; } SHA1_CTX;
#define DIGEST_SIZE 20 #define DIGEST_SIZE 20
void SHA1Transform(unsigned int state[5], const unsigned char buffer[64]); void SHA1Transform(unsigned int state[5], const unsigned char buffer[64]);
void SHA1Init(SHA1_CTX* context); void SHA1Init(SHA1_CTX* context);
void SHA1Update(SHA1_CTX* context, const unsigned char* data, unsigned int len); void SHA1Update(SHA1_CTX* context, const unsigned char* data, size_t len);
void SHA1Final(unsigned char digest[DIGEST_SIZE], SHA1_CTX* context); void SHA1Final(unsigned char digest[DIGEST_SIZE], SHA1_CTX* context);
@ -122,9 +122,9 @@ void SHA1Init(SHA1_CTX* context)
/* Run your data through this. */ /* Run your data through this. */
void SHA1Update(SHA1_CTX* context, const unsigned char* data, unsigned int len) void SHA1Update(SHA1_CTX* context, const unsigned char* data, size_t len)
{ {
unsigned int i, j; size_t i, j;
j = (context->count[0] >> 3) & 63; j = (context->count[0] >> 3) & 63;
if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++; if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
@ -250,7 +250,7 @@ size_t HMAC(hashfunc_t *hashfunc, unsigned char *digest, size_t maxdigestsize,
char innerhash[HMAC_DIGEST_MAXSIZE]; char innerhash[HMAC_DIGEST_MAXSIZE];
char block[64]; char block[64];
int innerhashsize; size_t innerhashsize;
/* Reduce the key's size, so that it is never larger than a block. */ /* Reduce the key's size, so that it is never larger than a block. */

View file

@ -2246,7 +2246,7 @@ static void Sh_GenShadowFace(dlight_t *l, vec3_t axis[3], int lighttype, shadowm
qboolean Sh_GenShadowMap (dlight_t *l, int lighttype, vec3_t axis[3], qbyte *lvis, int smsize) qboolean Sh_GenShadowMap (dlight_t *l, int lighttype, vec3_t axis[3], qbyte *lvis, int smsize)
{ {
int restorefbo; int restorefbo = 0;
int f,lf; int f,lf;
float oprojs[16], oprojv[16], oview[16]; float oprojs[16], oprojv[16], oview[16];
pxrect_t oprect; pxrect_t oprect;

View file

@ -97,8 +97,8 @@ void ExtractFileExtension (char *path, char *dest);
long ParseNum (char *str); long ParseNum (char *str);
unsigned short *QCC_makeutf16(char *mem, unsigned int len, int *outlen, pbool *errors); unsigned short *QCC_makeutf16(char *mem, size_t len, int *outlen, pbool *errors);
char *QCC_SanitizeCharSet(char *mem, unsigned int *len, pbool *freeresult, int *origfmt); char *QCC_SanitizeCharSet(char *mem, size_t *len, pbool *freeresult, int *origfmt);
char *QCC_COM_Parse (const char *data); char *QCC_COM_Parse (const char *data);

View file

@ -966,7 +966,7 @@ unsigned int utf8_check(const void *in, unsigned int *value)
//read utf-16 chars and output the 'native' utf-8. //read utf-16 chars and output the 'native' utf-8.
//we don't expect essays written in code, so we don't need much actual support for utf-8. //we don't expect essays written in code, so we don't need much actual support for utf-8.
static char *decodeUTF(int type, unsigned char *inputf, unsigned int inbytes, unsigned int *outlen, pbool usemalloc) static char *decodeUTF(int type, unsigned char *inputf, size_t inbytes, size_t *outlen, pbool usemalloc)
{ {
char *utf8, *start; char *utf8, *start;
unsigned int inc; unsigned int inc;
@ -1079,7 +1079,7 @@ static char *decodeUTF(int type, unsigned char *inputf, unsigned int inbytes, un
//the gui is a windows program. //the gui is a windows program.
//this means that its fucked. //this means that its fucked.
//on the plus side, its okay with a bom... //on the plus side, its okay with a bom...
unsigned short *QCC_makeutf16(char *mem, unsigned int len, int *outlen, pbool *errors) unsigned short *QCC_makeutf16(char *mem, size_t len, int *outlen, pbool *errors)
{ {
unsigned int code; unsigned int code;
int l; int l;
@ -1272,13 +1272,8 @@ void QCC_AddFile (char *filename)
qcc_cachedsourcefile_t *sfile; qcc_cachedsourcefile_t *sfile;
progfuncs_t *progfuncs = qccprogfuncs; progfuncs_t *progfuncs = qccprogfuncs;
char *mem; char *mem;
int len; size_t len;
len = externs->FileSize(filename);
if (len < 0)
externs->Abort("failed to find file %s", filename);
mem = qccHunkAlloc(sizeof(qcc_cachedsourcefile_t) + len+1);
mem = externs->ReadFile(filename, QCC_LoadFileHunk, NULL, &len); mem = externs->ReadFile(filename, QCC_LoadFileHunk, NULL, &len);
if (!mem) if (!mem)
externs->Abort("failed to find file %s", filename); externs->Abort("failed to find file %s", filename);

View file

@ -1261,7 +1261,7 @@ static void QCC_GenerateFieldDefs(QCC_def_t *def, char *fieldname, int ofs, QCC_
{ //the qcvm cannot cope with struct fields. so we need to generate lots of fake ones. { //the qcvm cannot cope with struct fields. so we need to generate lots of fake ones.
char sub[256]; char sub[256];
unsigned int p, a; unsigned int p, a;
int parms = type->num_parms; unsigned int parms = type->num_parms;
if (type->type == ev_union) if (type->type == ev_union)
parms = 1; //unions only generate the first element. it simplifies things (should really just be the biggest). parms = 1; //unions only generate the first element. it simplifies things (should really just be the biggest).
for (p = 0; p < parms; p++) for (p = 0; p < parms; p++)
@ -1560,7 +1560,7 @@ pbool QCC_WriteData (int crc)
funcs[i].parm_start = functions[i].merged->parm_start; funcs[i].parm_start = functions[i].merged->parm_start;
funcs[i].locals = functions[i].merged->locals; funcs[i].locals = functions[i].merged->locals;
funcs[i].numparms = functions[i].merged->numparms; funcs[i].numparms = functions[i].merged->numparms;
for(p = 0; p < funcs[i].numparms; p++) for(p = 0; p < (unsigned)funcs[i].numparms; p++)
funcs[i].parm_size[p] = functions[i].merged->parm_size[p]; funcs[i].parm_size[p] = functions[i].merged->parm_size[p];
} }
else if (functions[i].code == -1) else if (functions[i].code == -1)
@ -2756,7 +2756,7 @@ static unsigned char *QCC_LoadFileHunkAlloc(void *ctx, size_t size)
/*load a progs into the current compile state.*/ /*load a progs into the current compile state.*/
void QCC_ImportProgs(const char *filename) void QCC_ImportProgs(const char *filename)
{ {
int flen; size_t flen;
dprograms_t *prog; dprograms_t *prog;
//these keywords are implicitly enabled by #merge //these keywords are implicitly enabled by #merge
@ -3681,7 +3681,7 @@ Copy a file into the pak file
*/ */
void QCC_PackFile (char *src, char *name) void QCC_PackFile (char *src, char *name)
{ {
int remaining; size_t remaining;
#if 1 #if 1
char *f; char *f;
#else #else
@ -4613,7 +4613,7 @@ pbool QCC_main (int argc, char **argv) //as part of the quake engine
time_t long_time; time_t long_time;
extern QCC_type_t *pr_classtype; extern QCC_type_t *pr_classtype;
int p; size_t p;
extern int qccpersisthunk; extern int qccpersisthunk;
char *s; char *s;