make qf gcc 3.3 clean

This commit is contained in:
Bill Currie 2003-04-17 00:01:48 +00:00
parent 7ca2aae6f0
commit eb099ae0d3
119 changed files with 407 additions and 392 deletions

View file

@ -48,13 +48,13 @@ typedef struct inputline_s
{ {
char **lines; // array of lines for input history char **lines; // array of lines for input history
int num_lines; // number of lines in arry. 1 == no history int num_lines; // number of lines in arry. 1 == no history
int line_size; // space available in each line. includes \0 size_t line_size; // space available in each line. includes \0
char prompt_char; // char placed at the beginning of the line char prompt_char; // char placed at the beginning of the line
int edit_line; // current line being edited int edit_line; // current line being edited
int history_line; // current history line int history_line; // current history line
int linepos; // cursor position within the current edit line size_t linepos; // cursor position within the current edit line
int scroll; // beginning of displayed line size_t scroll; // beginning of displayed line
int width; // viewable widht for horizontal scrolling size_t width; // viewable widht for horizontal scrolling
void *user_data; // eg: window pointer void *user_data; // eg: window pointer
void (*complete)(struct inputline_s *); // tab key pressed void (*complete)(struct inputline_s *); // tab key pressed
void (*enter)(const char *line); // enter key pressed void (*enter)(const char *line); // enter key pressed

View file

@ -38,7 +38,7 @@
typedef struct info_s { typedef struct info_s {
struct hashtab_s *tab; struct hashtab_s *tab;
int maxsize; size_t maxsize;
int cursize; int cursize;
} info_t; } info_t;

View file

@ -266,7 +266,7 @@ typedef struct opcode_s {
pr_opcode_e opcode; pr_opcode_e opcode;
qboolean right_associative; qboolean right_associative;
etype_t type_a, type_b, type_c; etype_t type_a, type_b, type_c;
int min_version; unsigned int min_version;
} opcode_t; } opcode_t;
extern opcode_t pr_opcodes[]; extern opcode_t pr_opcodes[];
@ -322,28 +322,28 @@ typedef struct pr_va_list_s {
#define PROG_VERSION 0x00fff002 // MMmmmRRR 0.fff.002 (hex) #define PROG_VERSION 0x00fff002 // MMmmmRRR 0.fff.002 (hex)
typedef struct dprograms_s { typedef struct dprograms_s {
int version; unsigned int version;
int crc; // check of header file unsigned int crc; // check of header file
int ofs_statements; unsigned int ofs_statements;
int numstatements; // statement 0 is an error unsigned int numstatements; // statement 0 is an error
int ofs_globaldefs; unsigned int ofs_globaldefs;
int numglobaldefs; unsigned int numglobaldefs;
int ofs_fielddefs; unsigned int ofs_fielddefs;
int numfielddefs; unsigned int numfielddefs;
int ofs_functions; unsigned int ofs_functions;
int numfunctions; // function 0 is an empty int numfunctions; // function 0 is an empty
int ofs_strings; unsigned int ofs_strings;
int numstrings; // first string is a null string int numstrings; // first string is a null string
int ofs_globals; unsigned int ofs_globals;
int numglobals; unsigned int numglobals;
int entityfields; unsigned int entityfields;
} dprograms_t; } dprograms_t;
#endif // __pr_comp_h #endif // __pr_comp_h

View file

@ -293,7 +293,7 @@ struct progs_s {
strref_t *static_strings; strref_t *static_strings;
strref_t **dynamic_strings; strref_t **dynamic_strings;
strref_t *free_string_refs; strref_t *free_string_refs;
int dyn_str_size; unsigned int dyn_str_size;
struct hashtab_s *strref_hash; struct hashtab_s *strref_hash;
int num_strings; int num_strings;

View file

@ -46,8 +46,8 @@ struct sfx_s
{ {
const char *name; const char *name;
int length; unsigned int length;
int loopstart; unsigned int loopstart;
void *data; void *data;
@ -111,8 +111,8 @@ void S_EndPrecaching (void);
extern qboolean fakedma; extern qboolean fakedma;
extern int fakedma_updates; extern int fakedma_updates;
extern int paintedtime; extern unsigned paintedtime;
extern int soundtime; extern unsigned soundtime;
extern vec3_t listener_origin; extern vec3_t listener_origin;
extern vec3_t listener_forward; extern vec3_t listener_forward;
extern vec3_t listener_right; extern vec3_t listener_right;

View file

@ -41,24 +41,24 @@ typedef struct portable_samplepair_s {
} portable_samplepair_t; } portable_samplepair_t;
typedef struct wavinfo_s { typedef struct wavinfo_s {
int rate; unsigned int rate;
int width; unsigned int width;
int channels; unsigned int channels;
int loopstart; unsigned int loopstart;
int samples; unsigned int samples;
int dataofs; // chunk starts this many bytes from file start unsigned int dataofs; // chunk starts this many bytes from file start
int datalen; // chunk bytes unsigned int datalen; // chunk bytes
} wavinfo_t; } wavinfo_t;
typedef struct channel_s channel_t; typedef struct channel_s channel_t;
typedef struct sfxbuffer_s sfxbuffer_t; typedef struct sfxbuffer_s sfxbuffer_t;
struct sfxbuffer_s { struct sfxbuffer_s {
int head; // ring buffer head position in sampels unsigned int head; // ring buffer head position in sampels
int tail; // ring buffer tail position in sampels unsigned int tail; // ring buffer tail position in sampels
int length; // length of buffer in samples unsigned int length; // length of buffer in samples
int pos; // position of tail within full stream unsigned int pos; // position of tail within full stream
void (*paint) (channel_t *ch, sfxbuffer_t *buffer, int count); void (*paint) (channel_t *ch, sfxbuffer_t *buffer, int count);
void (*advance) (sfxbuffer_t *buffer, int count); void (*advance) (sfxbuffer_t *buffer, unsigned int count);
sfx_t *sfx; sfx_t *sfx;
byte data[4]; byte data[4];
}; };
@ -85,9 +85,9 @@ struct channel_s {
sfx_t *sfx; // sfx number sfx_t *sfx; // sfx number
int leftvol; // 0-255 volume int leftvol; // 0-255 volume
int rightvol; // 0-255 volume int rightvol; // 0-255 volume
int end; // end time in global paintsamples unsigned int end; // end time in global paintsamples
int pos; // sample position in sfx unsigned int pos; // sample position in sfx
int looping; // where to loop, -1 = no looping unsigned int looping; // where to loop, -1 = no looping
int entnum; // to allow overriding a specific sound int entnum; // to allow overriding a specific sound
int entchannel; // int entchannel; //
vec3_t origin; // origin of sound effect vec3_t origin; // origin of sound effect
@ -97,7 +97,7 @@ struct channel_s {
int oldphase; // phase shift between l-r in samples int oldphase; // phase shift between l-r in samples
}; };
void SND_PaintChannels(int endtime); void SND_PaintChannels(unsigned int endtime);
void SND_Init (void); void SND_Init (void);
void SND_Shutdown (void); void SND_Shutdown (void);
void SND_AmbientOff (void); void SND_AmbientOff (void);
@ -144,7 +144,7 @@ sfxbuffer_t *SND_CacheRetain (sfx_t *sfx);
void SND_CacheRelease (sfx_t *sfx); void SND_CacheRelease (sfx_t *sfx);
sfxbuffer_t *SND_StreamRetain (sfx_t *sfx); sfxbuffer_t *SND_StreamRetain (sfx_t *sfx);
void SND_StreamRelease (sfx_t *sfx); void SND_StreamRelease (sfx_t *sfx);
void SND_StreamAdvance (sfxbuffer_t *buffer, int count); void SND_StreamAdvance (sfxbuffer_t *buffer, unsigned int count);
void SND_WriteLinearBlastStereo16 (void); void SND_WriteLinearBlastStereo16 (void);
void SND_PaintChannelFrom8 (channel_t *ch, sfxbuffer_t *sc, int count); void SND_PaintChannelFrom8 (channel_t *ch, sfxbuffer_t *sc, int count);

View file

@ -174,7 +174,7 @@ I_CDAudio_Play (int track, qboolean looping)
return; return;
} }
if (track < 0 || track >= sizeof (remap)) { if (track < 0 || track >= (int) sizeof (remap)) {
Sys_Printf ("CDAudio: invalid track number\n"); Sys_Printf ("CDAudio: invalid track number\n");
return; return;
} }

View file

@ -68,7 +68,7 @@ vec3_t listener_right;
vec3_t listener_up; vec3_t listener_up;
vec_t sound_nominal_clip_dist = 1000.0; vec_t sound_nominal_clip_dist = 1000.0;
int soundtime; // sample PAIRS unsigned soundtime; // sample PAIRS
#define MAX_SFX 512 #define MAX_SFX 512
sfx_t *known_sfx; // hunk allocated [MAX_SFX] sfx_t *known_sfx; // hunk allocated [MAX_SFX]
@ -229,7 +229,8 @@ SND_PrecacheSound (const char *name)
channel_t * channel_t *
SND_PickChannel (int entnum, int entchannel) SND_PickChannel (int entnum, int entchannel)
{ {
int ch_idx, first_to_die, life_left; int ch_idx, first_to_die;
unsigned life_left;
// Check for replacement sound, or find the best one to replace // Check for replacement sound, or find the best one to replace
first_to_die = -1; first_to_die = -1;
@ -250,6 +251,11 @@ SND_PickChannel (int entnum, int entchannel)
&& channels[ch_idx].sfx) && channels[ch_idx].sfx)
continue; continue;
if (channels[ch_idx].end < paintedtime) {
first_to_die = ch_idx;
break;
}
if (channels[ch_idx].end - paintedtime < life_left) { if (channels[ch_idx].end - paintedtime < life_left) {
life_left = channels[ch_idx].end - paintedtime; life_left = channels[ch_idx].end - paintedtime;
first_to_die = ch_idx; first_to_die = ch_idx;
@ -316,7 +322,8 @@ void
SND_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin, SND_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin,
float fvol, float attenuation) float fvol, float attenuation)
{ {
int ch_idx, skip, vol; int ch_idx, vol;
unsigned int skip;
channel_t *target_chan, *check; channel_t *target_chan, *check;
if (!sound_started) if (!sound_started)
@ -459,7 +466,7 @@ SND_StaticSound (sfx_t *sfx, const vec3_t origin, float vol,
if (!sfx->retain (sfx)) if (!sfx->retain (sfx))
return; return;
if (sfx->loopstart == -1) { if (sfx->loopstart == (unsigned int)-1) {
Sys_Printf ("Sound %s not looped\n", sfx->name); Sys_Printf ("Sound %s not looped\n", sfx->name);
sfx->release (sfx); sfx->release (sfx);
return; return;
@ -559,8 +566,7 @@ SND_GetSoundtime (void)
static void static void
SND_Update_ (void) SND_Update_ (void)
{ {
int samps; unsigned int endtime, samps;
unsigned int endtime;
if (!sound_started || (snd_blocked > 0)) if (!sound_started || (snd_blocked > 0))
return; return;

View file

@ -141,11 +141,11 @@ read_samples (sfxbuffer_t *buffer, int count)
} }
void void
SND_StreamAdvance (sfxbuffer_t *buffer, int count) SND_StreamAdvance (sfxbuffer_t *buffer, unsigned int count)
{ {
float stepscale; float stepscale;
int headpos, samples; unsigned int headpos, samples;
int loop_samples = 0; unsigned int loop_samples = 0;
sfx_t *sfx = buffer->sfx; sfx_t *sfx = buffer->sfx;
sfxstream_t *stream = (sfxstream_t *) sfx->data; sfxstream_t *stream = (sfxstream_t *) sfx->data;
wavinfo_t *info = &stream->wavinfo; wavinfo_t *info = &stream->wavinfo;
@ -153,14 +153,16 @@ SND_StreamAdvance (sfxbuffer_t *buffer, int count)
stepscale = (float) info->rate / shm->speed; // usually 0.5, 1, or 2 stepscale = (float) info->rate / shm->speed; // usually 0.5, 1, or 2
// find out how many samples the buffer currently holds // find out how many samples the buffer currently holds
samples = buffer->head - buffer->tail; if (buffer->head < buffer->tail) {
if (samples < 0) samples = buffer->length + buffer->head - buffer->tail;
samples += buffer->length; } else {
samples = buffer->head - buffer->tail;
}
// find out where head points to in the stream // find out where head points to in the stream
headpos = buffer->pos + samples; headpos = buffer->pos + samples;
if (headpos >= sfx->length) { if (headpos >= sfx->length) {
if (sfx->loopstart == -1) if (sfx->loopstart == (unsigned int)-1)
headpos = sfx->length; headpos = sfx->length;
else else
headpos -= sfx->length - sfx->loopstart; headpos -= sfx->length - sfx->loopstart;
@ -170,7 +172,7 @@ SND_StreamAdvance (sfxbuffer_t *buffer, int count)
buffer->head = buffer->tail = 0; buffer->head = buffer->tail = 0;
buffer->pos += count; buffer->pos += count;
if (buffer->pos > sfx->length) { if (buffer->pos > sfx->length) {
if (sfx->loopstart == -1) { if (sfx->loopstart == (unsigned int)-1) {
// reset the buffer and fill it incase it's needed again // reset the buffer and fill it incase it's needed again
headpos = buffer->pos = 0; headpos = buffer->pos = 0;
} else { } else {
@ -183,7 +185,7 @@ SND_StreamAdvance (sfxbuffer_t *buffer, int count)
} else { } else {
buffer->pos += count; buffer->pos += count;
if (buffer->pos >= sfx->length) { if (buffer->pos >= sfx->length) {
if (sfx->loopstart == -1) { if (sfx->loopstart == (unsigned int)-1) {
// reset the buffer and fill it incase it's needed again // reset the buffer and fill it incase it's needed again
buffer->pos = 0; buffer->pos = 0;
buffer->head = buffer->tail = 0; buffer->head = buffer->tail = 0;
@ -204,7 +206,7 @@ SND_StreamAdvance (sfxbuffer_t *buffer, int count)
samples += buffer->length; samples += buffer->length;
if (headpos + samples > sfx->length) { if (headpos + samples > sfx->length) {
if (sfx->loopstart == -1) { if (sfx->loopstart == (unsigned int)-1) {
samples = sfx->length - headpos; samples = sfx->length - headpos;
} else { } else {
loop_samples = headpos + samples - sfx->length; loop_samples = headpos + samples - sfx->length;
@ -317,10 +319,10 @@ SND_ResampleMono (sfxbuffer_t *sc, byte *data, int length)
//printf ("%d %d\n", length, outcount); //printf ("%d %d\n", length, outcount);
sc->sfx->length = info->samples / stepscale; sc->sfx->length = info->samples / stepscale;
if (info->loopstart != -1) if (info->loopstart != (unsigned int)-1)
sc->sfx->loopstart = info->loopstart / stepscale; sc->sfx->loopstart = info->loopstart / stepscale;
else else
sc->sfx->loopstart = -1; sc->sfx->loopstart = (unsigned int)-1;
if (snd_loadas8bit->int_val) { if (snd_loadas8bit->int_val) {
outwidth = 1; outwidth = 1;
@ -436,10 +438,10 @@ SND_ResampleStereo (sfxbuffer_t *sc, byte *data, int length)
outcount = length / stepscale; outcount = length / stepscale;
sc->sfx->length = info->samples / stepscale; sc->sfx->length = info->samples / stepscale;
if (info->loopstart != -1) if (info->loopstart != (unsigned int)-1)
sc->sfx->loopstart = info->loopstart / stepscale; sc->sfx->loopstart = info->loopstart / stepscale;
else else
sc->sfx->loopstart = -1; sc->sfx->loopstart = (unsigned int)-1;
if (snd_loadas8bit->int_val) { if (snd_loadas8bit->int_val) {
outwidth = 1; outwidth = 1;

View file

@ -166,9 +166,10 @@ SND_TransferPaintBuffer (int endtime)
/* CHANNEL MIXING */ /* CHANNEL MIXING */
void void
SND_PaintChannels (int endtime) SND_PaintChannels (unsigned int endtime)
{ {
int end, ltime, count, i; unsigned int end, ltime, count;
int i;
channel_t *ch; channel_t *ch;
sfxbuffer_t *sc; sfxbuffer_t *sc;
@ -251,10 +252,11 @@ SND_InitScaletable (void)
} }
static void static void
snd_paint_mono_8 (int offs, channel_t *ch, void *bytes, int count) snd_paint_mono_8 (int offs, channel_t *ch, void *bytes, unsigned int count)
{ {
unsigned char *sfx; unsigned char *sfx;
int data, i; int data;
unsigned int i;
int *lscale, *rscale; int *lscale, *rscale;
portable_samplepair_t *pair; portable_samplepair_t *pair;
@ -277,7 +279,7 @@ snd_paint_mono_8 (int offs, channel_t *ch, void *bytes, int count)
} }
static void static void
snd_paint_mono_16 (int offs, channel_t *ch, void *bytes, int count) snd_paint_mono_16 (int offs, channel_t *ch, void *bytes, unsigned int count)
{ {
int leftvol, rightvol; int leftvol, rightvol;
unsigned int left_phase, right_phase; // Never allowed < 0 anyway unsigned int left_phase, right_phase; // Never allowed < 0 anyway
@ -374,7 +376,7 @@ snd_paint_mono_16 (int offs, channel_t *ch, void *bytes, int count)
} }
static void static void
snd_paint_stereo_8 (int offs, channel_t *ch, void *bytes, int count) snd_paint_stereo_8 (int offs, channel_t *ch, void *bytes, unsigned int count)
{ {
byte *samp; byte *samp;
portable_samplepair_t *pair; portable_samplepair_t *pair;
@ -398,7 +400,7 @@ snd_paint_stereo_8 (int offs, channel_t *ch, void *bytes, int count)
} }
static void static void
snd_paint_stereo_16 (int offs, channel_t *ch, void *bytes, int count) snd_paint_stereo_16 (int offs, channel_t *ch, void *bytes, unsigned int count)
{ {
short *samp; short *samp;
portable_samplepair_t *pair; portable_samplepair_t *pair;
@ -417,7 +419,7 @@ snd_paint_stereo_16 (int offs, channel_t *ch, void *bytes, int count)
void void
SND_PaintChannelFrom8 (channel_t *ch, sfxbuffer_t *sc, int count) SND_PaintChannelFrom8 (channel_t *ch, sfxbuffer_t *sc, int count)
{ {
int pos; unsigned int pos;
byte *samps; byte *samps;
pos = (ch->pos - sc->pos + sc->tail) % sc->length; pos = (ch->pos - sc->pos + sc->tail) % sc->length;
@ -440,7 +442,7 @@ SND_PaintChannelFrom8 (channel_t *ch, sfxbuffer_t *sc, int count)
void void
SND_PaintChannelFrom16 (channel_t *ch, sfxbuffer_t *sc, int count) SND_PaintChannelFrom16 (channel_t *ch, sfxbuffer_t *sc, int count)
{ {
int pos; unsigned int pos;
short *samps; short *samps;
pos = (ch->pos - sc->pos + sc->tail) % sc->length; pos = (ch->pos - sc->pos + sc->tail) % sc->length;
@ -451,7 +453,7 @@ SND_PaintChannelFrom16 (channel_t *ch, sfxbuffer_t *sc, int count)
samps = (short *) sc->data + pos; samps = (short *) sc->data + pos;
if (pos + count > sc->length) { if (pos + count > sc->length) {
int sub = sc->length - pos; unsigned int sub = sc->length - pos;
snd_paint_mono_16 (0, ch, samps, sub); snd_paint_mono_16 (0, ch, samps, sub);
snd_paint_mono_16 (sub, ch, sc->data, count - sub); snd_paint_mono_16 (sub, ch, sc->data, count - sub);
} else { } else {
@ -463,7 +465,7 @@ SND_PaintChannelFrom16 (channel_t *ch, sfxbuffer_t *sc, int count)
void void
SND_PaintChannelStereo8 (channel_t *ch, sfxbuffer_t *sc, int count) SND_PaintChannelStereo8 (channel_t *ch, sfxbuffer_t *sc, int count)
{ {
int pos; unsigned int pos;
short *samps; short *samps;
pos = (ch->pos - sc->pos + sc->tail) % sc->length; pos = (ch->pos - sc->pos + sc->tail) % sc->length;
@ -474,7 +476,7 @@ SND_PaintChannelStereo8 (channel_t *ch, sfxbuffer_t *sc, int count)
samps = (short *) sc->data + pos; samps = (short *) sc->data + pos;
if (pos + count > sc->length) { if (pos + count > sc->length) {
int sub = sc->length - pos; unsigned int sub = sc->length - pos;
snd_paint_stereo_8 (0, ch, samps, sub); snd_paint_stereo_8 (0, ch, samps, sub);
snd_paint_stereo_8 (sub, ch, sc->data, count - sub); snd_paint_stereo_8 (sub, ch, sc->data, count - sub);
} else { } else {
@ -486,7 +488,7 @@ SND_PaintChannelStereo8 (channel_t *ch, sfxbuffer_t *sc, int count)
void void
SND_PaintChannelStereo16 (channel_t *ch, sfxbuffer_t *sc, int count) SND_PaintChannelStereo16 (channel_t *ch, sfxbuffer_t *sc, int count)
{ {
int pos; unsigned int pos;
int *samps; int *samps;
pos = (ch->pos - sc->pos + sc->tail) % sc->length; pos = (ch->pos - sc->pos + sc->tail) % sc->length;
@ -497,7 +499,7 @@ SND_PaintChannelStereo16 (channel_t *ch, sfxbuffer_t *sc, int count)
samps = (int *) sc->data + pos; samps = (int *) sc->data + pos;
if (pos + count > sc->length) { if (pos + count > sc->length) {
int sub = sc->length - pos; unsigned int sub = sc->length - pos;
snd_paint_stereo_16 (0, ch, samps, sub); snd_paint_stereo_16 (0, ch, samps, sub);
snd_paint_stereo_16 (sub, ch, sc->data, count - sub); snd_paint_stereo_16 (sub, ch, sc->data, count - sub);
} else { } else {

View file

@ -44,7 +44,7 @@ static __attribute__ ((unused)) const char rcsid[] =
// FIXME - should be put in one place // FIXME - should be put in one place
// ======================================================================= // =======================================================================
volatile dma_t *shm = 0; volatile dma_t *shm = 0;
int paintedtime; // sample PAIRS unsigned int paintedtime; // sample PAIRS
qboolean snd_initialized = false; qboolean snd_initialized = false;
cvar_t *snd_loadas8bit; cvar_t *snd_loadas8bit;

View file

@ -186,7 +186,7 @@ SNDDMA_Init (void)
if (snd_rate->int_val) { if (snd_rate->int_val) {
shm->speed = snd_rate->int_val; shm->speed = snd_rate->int_val;
} else { } else {
for (i = 0; i < (sizeof (tryrates) / 4); i++) for (i = 0; i < ((int) sizeof (tryrates) / 4); i++)
if (!ioctl (audio_fd, SNDCTL_DSP_SPEED, &tryrates[i])) if (!ioctl (audio_fd, SNDCTL_DSP_SPEED, &tryrates[i]))
break; break;
shm->speed = tryrates[i]; shm->speed = tryrates[i];

View file

@ -95,7 +95,7 @@ Con_BufferAddText (con_buffer_t *buf, const char *text)
} }
while (len--) { while (len--) {
byte c = *pos++ = *text++; byte c = *pos++ = *text++;
if (pos - buf->buffer >= buf->buffer_size) if ((size_t) (pos - buf->buffer) >= buf->buffer_size)
pos = buf->buffer; pos = buf->buffer;
cur_line->len++; cur_line->len++;
if (pos == tail_line->text) { if (pos == tail_line->text) {

View file

@ -598,7 +598,7 @@ C_KeyEvent (knum_t key, short unicode, qboolean down)
} }
il = input_line; il = input_line;
} }
Con_ProcessInputLine (il, key >= 256 ? key : unicode); Con_ProcessInputLine (il, key >= 256 ? (int) key : unicode);
} }
/* DRAWING */ /* DRAWING */
@ -744,7 +744,7 @@ DrawDownload (int lines)
{ {
char dlbar[1024]; char dlbar[1024];
const char *text; const char *text;
int i, j, x, y, n; size_t i, j, x, y, n;
if (!con_data.dl_name || !*con_data.dl_name) if (!con_data.dl_name || !*con_data.dl_name)
return; return;

View file

@ -47,10 +47,12 @@ int con_linewidth; // characters across screen
plugin_t *con_module; plugin_t *con_module;
static con_buffer_t *(*const buffer) (size_t, int) = Con_CreateBuffer; #define U __attribute__ ((unused))
static void (*const complete)(inputline_t *) = Con_BasicCompleteCommandLine; static U con_buffer_t *(*const buffer) (size_t, int) = Con_CreateBuffer;
static inputline_t *(*const create)(int, int, char) = Con_CreateInputLine; static U void (*const complete)(inputline_t *) = Con_BasicCompleteCommandLine;
static void (*const display)(const char **, int) = Con_DisplayList; static U inputline_t *(*const create)(int, int, char) = Con_CreateInputLine;
static U void (*const display)(const char **, int) = Con_DisplayList;
#undef U
void void
Con_Init (const char *plugin_name) Con_Init (const char *plugin_name)

View file

@ -100,7 +100,7 @@ Con_ClearTyping (inputline_t *il, int save)
void void
Con_ProcessInputLine (inputline_t *il, int ch) Con_ProcessInputLine (inputline_t *il, int ch)
{ {
int i; size_t i;
char *text; char *text;
switch (ch) { switch (ch) {
@ -182,7 +182,7 @@ Con_ProcessInputLine (inputline_t *il, int ch)
if (il->scroll < i - (il->width - 2) + 1) if (il->scroll < i - (il->width - 2) + 1)
il->scroll = i - (il->width - 2) + 1; il->scroll = i - (il->width - 2) + 1;
text = il->lines[il->edit_line] + il->scroll; text = il->lines[il->edit_line] + il->scroll;
if ((int)strlen (text + 1) < il->width - 2) { if (strlen (text + 1) < il->width - 2) {
text = il->lines[il->edit_line]; text = il->lines[il->edit_line];
il->scroll = strlen (text + 1) - (il->width - 2); il->scroll = strlen (text + 1) - (il->width - 2);
il->scroll = max (il->scroll, 0); il->scroll = max (il->scroll, 0);

View file

@ -191,7 +191,7 @@ static void
C_DrawInput (inputline_t *il) C_DrawInput (inputline_t *il)
{ {
WINDOW *win = (WINDOW *) il->user_data; WINDOW *win = (WINDOW *) il->user_data;
int i; size_t i;
const char *text; const char *text;
text = il->lines[il->edit_line] + il->scroll; text = il->lines[il->edit_line] + il->scroll;

View file

@ -54,7 +54,7 @@ get_cbuf (progs_t *pr, int arg, const char *func)
cbuf = res->cbuf; cbuf = res->cbuf;
} else { } else {
if (arg <= ((pr_type_t *) pr->zone - pr->pr_globals) if (arg <= ((pr_type_t *) pr->zone - pr->pr_globals)
|| arg >= (pr->zone_size / sizeof (pr_type_t))) || (size_t) arg >= (pr->zone_size / sizeof (pr_type_t)))
PR_RunError (pr, "%s: Invalid cbuf_t", func); PR_RunError (pr, "%s: Invalid cbuf_t", func);
handle = pr->pr_globals + arg; handle = pr->pr_globals + arg;

View file

@ -80,7 +80,7 @@ bi_gib_builtin_f (void)
{ {
bi_gib_builtin_t *builtin = Hash_Find (bi_gib_builtins, GIB_Argv(0)); bi_gib_builtin_t *builtin = Hash_Find (bi_gib_builtins, GIB_Argv(0));
pr_type_t *pr_list; pr_type_t *pr_list;
unsigned int i; int i;
if (!builtin) if (!builtin)
Sys_Error ("bi_gib_bultin_f: unexpected call %s", GIB_Argv (0)); Sys_Error ("bi_gib_bultin_f: unexpected call %s", GIB_Argv (0));

View file

@ -34,16 +34,18 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/csqc.h" #include "QF/csqc.h"
#include "QF/progs.h" #include "QF/progs.h"
static void (*const cbuf_progs_init)(progs_t *) = Cbuf_Progs_Init; #define U __attribute__ ((unused))
static void (*const cmd_progs_init)(progs_t *) = Cmd_Progs_Init; static U void (*const cbuf_progs_init)(progs_t *) = Cbuf_Progs_Init;
static void (*const gib_progs_init)(progs_t *) = GIB_Progs_Init; static U void (*const cmd_progs_init)(progs_t *) = Cmd_Progs_Init;
static void (*const cvar_progs_init)(progs_t *) = Cvar_Progs_Init; static U void (*const gib_progs_init)(progs_t *) = GIB_Progs_Init;
static void (*const file_progs_init)(progs_t *) = File_Progs_Init; static U void (*const cvar_progs_init)(progs_t *) = Cvar_Progs_Init;
static void (*const hash_progs_init)(progs_t *) = Hash_Progs_Init; static U void (*const file_progs_init)(progs_t *) = File_Progs_Init;
static void (*const inputline_progs_init)(progs_t *) = InputLine_Progs_Init; static U void (*const hash_progs_init)(progs_t *) = Hash_Progs_Init;
static void (*const plist_progs_init)(progs_t *) = Plist_Progs_Init; static U void (*const inputline_progs_init)(progs_t *) = InputLine_Progs_Init;
static void (*const qfile_progs_init)(progs_t *, int) = QFile_Progs_Init; static U void (*const plist_progs_init)(progs_t *) = Plist_Progs_Init;
static void (*const qfs_progs_init)(progs_t *) = QFS_Progs_Init; static U void (*const qfile_progs_init)(progs_t *, int) = QFile_Progs_Init;
static U void (*const qfs_progs_init)(progs_t *) = QFS_Progs_Init;
#undef U
void void
BI_Init () BI_Init ()

View file

@ -62,7 +62,7 @@ get_inputline (progs_t *pr, int arg, const char *func)
inputline_t *line; inputline_t *line;
if (arg <= ((pr_type_t *) pr->zone - pr->pr_globals) if (arg <= ((pr_type_t *) pr->zone - pr->pr_globals)
|| arg >= (pr->zone_size / sizeof (pr_type_t))) || (size_t) arg >= (pr->zone_size / sizeof (pr_type_t)))
PR_RunError (pr, "%s: Invalid inputline_t", func); PR_RunError (pr, "%s: Invalid inputline_t", func);
handle = pr->pr_globals + arg; handle = pr->pr_globals + arg;
@ -137,7 +137,7 @@ bi_InputLine_Destroy (progs_t *pr)
inputline_t *line; inputline_t *line;
if (arg <= ((pr_type_t *) pr->zone - pr->pr_globals) if (arg <= ((pr_type_t *) pr->zone - pr->pr_globals)
|| arg >= (pr->zone_size / sizeof (pr_type_t))) || (size_t) arg >= (pr->zone_size / sizeof (pr_type_t)))
PR_RunError (pr, "InputLine_Destroy: Invalid inputline_t"); PR_RunError (pr, "InputLine_Destroy: Invalid inputline_t");
handle = pr->pr_globals + arg; handle = pr->pr_globals + arg;

View file

@ -609,7 +609,8 @@ PF_sprintf (progs_t *pr)
char new_format[INT_WIDTH * 2 + 9]; // "%0-+ #." and conversion char new_format[INT_WIDTH * 2 + 9]; // "%0-+ #." and conversion
int fmt_alternate, fmt_leadzero, fmt_leftjust, fmt_minwidth, int fmt_alternate, fmt_leadzero, fmt_leftjust, fmt_minwidth,
fmt_precision, fmt_signed, fmt_space, fmt_type, looping, fmt_precision, fmt_signed, fmt_space, fmt_type, looping,
new_format_i, ret; ret;
size_t new_format_i;
int curarg = 3, out_max = 32, out_size = 0; int curarg = 3, out_max = 32, out_size = 0;
format = P_STRING (pr, 0); format = P_STRING (pr, 0);

View file

@ -64,7 +64,7 @@ typedef struct {
char *name; char *name;
char *text; char *text;
line_t *lines; line_t *lines;
int num_lines; unsigned int num_lines;
progs_t *pr; progs_t *pr;
} file_t; } file_t;
@ -190,7 +190,7 @@ PR_LoadDebug (progs_t *pr)
{ {
char *sym_path; char *sym_path;
const char *path_end, *sym_file; const char *path_end, *sym_file;
int i; unsigned int i;
int start = Hunk_LowMark (); int start = Hunk_LowMark ();
ddef_t *def; ddef_t *def;
pr_type_t *str = 0; pr_type_t *str = 0;
@ -386,7 +386,7 @@ PR_Get_Source_Line (progs_t *pr, unsigned int addr)
ddef_t * ddef_t *
PR_Get_Local_Def (progs_t *pr, int offs) PR_Get_Local_Def (progs_t *pr, int offs)
{ {
int i; unsigned int i;
dfunction_t *func = pr->pr_xfunction; dfunction_t *func = pr->pr_xfunction;
pr_auxfunction_t *aux_func; pr_auxfunction_t *aux_func;

View file

@ -108,7 +108,7 @@ const char *pr_type_name[ev_type_count] = {
void void
ED_ClearEdict (progs_t *pr, edict_t *e, int val) ED_ClearEdict (progs_t *pr, edict_t *e, int val)
{ {
int i; unsigned int i;
if (NUM_FOR_EDICT(pr,e)<*pr->reserved_edicts) if (NUM_FOR_EDICT(pr,e)<*pr->reserved_edicts)
Sys_Printf("clearing reserved edict %d\n", NUM_FOR_EDICT(pr,e)); Sys_Printf("clearing reserved edict %d\n", NUM_FOR_EDICT(pr,e));
@ -296,7 +296,7 @@ PR_GlobalString (progs_t *pr, int ofs, etype_t type)
if (type == ev_void) if (type == ev_void)
type = def->type; type = def->type;
name = PR_GetString (pr, def->s_name); name = PR_GetString (pr, def->s_name);
if (type != (def->type & ~DEF_SAVEGLOBAL)) if (type != (etype_t) (def->type & ~DEF_SAVEGLOBAL))
oi = "?"; oi = "?";
} }
@ -359,7 +359,7 @@ void
ED_Print (progs_t *pr, edict_t *ed) ED_Print (progs_t *pr, edict_t *ed)
{ {
int l; int l;
int i; unsigned int i;
char *name; char *name;
int type; int type;
ddef_t *d; ddef_t *d;

View file

@ -177,7 +177,7 @@ PR_LeaveFunction (progs_t * pr)
This gets around the problem of needing to test for -0.0 but denormals This gets around the problem of needing to test for -0.0 but denormals
causing exceptions (or wrong results for what we need) on the alpha. causing exceptions (or wrong results for what we need) on the alpha.
*/ */
#define FNZ(x) ((x).integer_var && (x).integer_var != 0x80000000) #define FNZ(x) ((x).uinteger_var && (x).uinteger_var != 0x80000000u)
static int static int
@ -225,7 +225,7 @@ void
PR_ExecuteProgram (progs_t * pr, func_t fnum) PR_ExecuteProgram (progs_t * pr, func_t fnum)
{ {
int exitdepth, profile, startprofile; int exitdepth, profile, startprofile;
int pointer; unsigned int pointer;
dfunction_t *f, *newf; dfunction_t *f, *newf;
dstatement_t *st; dstatement_t *st;
edict_t *ed; edict_t *ed;
@ -454,8 +454,7 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
"of bounds edict"); "of bounds edict");
if (OPA.entity_var == 0 && pr->null_bad) if (OPA.entity_var == 0 && pr->null_bad)
PR_RunError (pr, "assignment to world entity"); PR_RunError (pr, "assignment to world entity");
if (OPB.integer_var < 0 if (OPB.uinteger_var >= pr->progs->entityfields)
|| OPB.integer_var >= pr->progs->entityfields)
PR_RunError (pr, "Progs attempted to address an " PR_RunError (pr, "Progs attempted to address an "
"invalid field in an edict"); "invalid field in an edict");
} }
@ -485,8 +484,7 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
|| OPA.entity_var >= pr->pr_edictareasize) || OPA.entity_var >= pr->pr_edictareasize)
PR_RunError (pr, "Progs attempted to read an out of " PR_RunError (pr, "Progs attempted to read an out of "
"bounds edict number"); "bounds edict number");
if (OPB.integer_var < 0 if (OPB.uinteger_var >= pr->progs->entityfields)
|| OPB.integer_var >= pr->progs->entityfields)
PR_RunError (pr, "Progs attempted to read an invalid " PR_RunError (pr, "Progs attempted to read an invalid "
"field in an edict"); "field in an edict");
} }
@ -499,8 +497,7 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
|| OPA.entity_var >= pr->pr_edictareasize) || OPA.entity_var >= pr->pr_edictareasize)
PR_RunError (pr, "Progs attempted to read an out of " PR_RunError (pr, "Progs attempted to read an out of "
"bounds edict number"); "bounds edict number");
if (OPB.integer_var < 0 if (OPB.uinteger_var + 2 >= pr->progs->entityfields)
|| OPB.integer_var + 2 >= pr->progs->entityfields)
PR_RunError (pr, "Progs attempted to read an invalid " PR_RunError (pr, "Progs attempted to read an invalid "
"field in an edict"); "field in an edict");
} }

View file

@ -98,7 +98,7 @@ free_progs_mem (progs_t *pr, void *mem)
void void
PR_LoadProgsFile (progs_t * pr, QFile *file, int size, int edicts, int zone) PR_LoadProgsFile (progs_t * pr, QFile *file, int size, int edicts, int zone)
{ {
int i; unsigned int i;
dprograms_t progs; dprograms_t progs;
pr->progs = 0; pr->progs = 0;
@ -231,7 +231,7 @@ PR_LoadProgsFile (progs_t * pr, QFile *file, int size, int edicts, int zone)
pr->pr_statements[i].c = LittleShort (pr->pr_statements[i].c); pr->pr_statements[i].c = LittleShort (pr->pr_statements[i].c);
} }
for (i = 0; i < pr->progs->numfunctions; i++) { for (i = 0; i < (unsigned int) pr->progs->numfunctions; i++) {
pr->pr_functions[i].first_statement = pr->pr_functions[i].first_statement =
LittleLong (pr->pr_functions[i].first_statement); LittleLong (pr->pr_functions[i].first_statement);
pr->pr_functions[i].parm_start = pr->pr_functions[i].parm_start =

View file

@ -969,7 +969,7 @@ static struct {
void void
PR_Obj_Progs_Init (progs_t *pr) PR_Obj_Progs_Init (progs_t *pr)
{ {
int i; size_t i;
for (i = 0; i < sizeof (obj_methods) / sizeof (obj_methods[0]); i++) { for (i = 0; i < sizeof (obj_methods) / sizeof (obj_methods[0]); i++) {
PR_AddBuiltin (pr, obj_methods[i].name, obj_methods[i].func, -1); PR_AddBuiltin (pr, obj_methods[i].name, obj_methods[i].func, -1);

View file

@ -299,7 +299,7 @@ check_branch (progs_t *pr, dstatement_t *st, opcode_t *op, short offset)
int address = st - pr->pr_statements; int address = st - pr->pr_statements;
address += offset; address += offset;
if (address < 0 || address >= pr->progs->numstatements) if (address < 0 || (unsigned int) address >= pr->progs->numstatements)
PR_Error (pr, "PR_Check_Opcodes: invalid branch (statement %ld: %s)", PR_Error (pr, "PR_Check_Opcodes: invalid branch (statement %ld: %s)",
(long)(st - pr->pr_statements), op->opname); (long)(st - pr->pr_statements), op->opname);
} }
@ -342,7 +342,7 @@ PR_Check_Opcodes (progs_t *pr)
if (!pr_boundscheck->int_val) if (!pr_boundscheck->int_val)
return; return;
for (st = pr->pr_statements; for (st = pr->pr_statements;
st - pr->pr_statements < pr->progs->numstatements; (unsigned long) (st - pr->pr_statements) < pr->progs->numstatements;
st++) { st++) {
op = PR_Opcode (st->op); op = PR_Opcode (st->op);
if (!op) { if (!op) {

View file

@ -115,7 +115,8 @@ PR_UglyValueString (progs_t *pr, etype_t type, pr_type_t *val)
void void
ED_Write (progs_t *pr, QFile *f, edict_t *ed) ED_Write (progs_t *pr, QFile *f, edict_t *ed)
{ {
int i, j; unsigned int i;
int j;
int type; int type;
char *name; char *name;
ddef_t *d; ddef_t *d;
@ -164,7 +165,7 @@ void
ED_WriteGlobals (progs_t *pr, QFile *f) ED_WriteGlobals (progs_t *pr, QFile *f)
{ {
ddef_t *def; ddef_t *def;
int i; unsigned int i;
char *name; char *name;
int type; int type;

View file

@ -62,7 +62,7 @@ ddef_t *
ED_GlobalAtOfs (progs_t * pr, int ofs) ED_GlobalAtOfs (progs_t * pr, int ofs)
{ {
ddef_t *def; ddef_t *def;
int i; unsigned int i;
for (i = 0; i < pr->progs->numglobaldefs; i++) { for (i = 0; i < pr->progs->numglobaldefs; i++) {
def = &pr->pr_globaldefs[i]; def = &pr->pr_globaldefs[i];
@ -79,7 +79,7 @@ ddef_t *
ED_FieldAtOfs (progs_t * pr, int ofs) ED_FieldAtOfs (progs_t * pr, int ofs)
{ {
ddef_t *def; ddef_t *def;
int i; unsigned int i;
for (i = 0; i < pr->progs->numfielddefs; i++) { for (i = 0; i < pr->progs->numfielddefs; i++) {
def = &pr->pr_fielddefs[i]; def = &pr->pr_fielddefs[i];

View file

@ -81,9 +81,10 @@ free_string_ref (progs_t *pr, strref_t *sr)
static int static int
string_index (progs_t *pr, strref_t *sr) string_index (progs_t *pr, strref_t *sr)
{ {
int i = sr - pr->static_strings; long o = (long) (sr - pr->static_strings);
unsigned int i;
if (i >= 0 && i < pr->num_strings) if (o >= 0 && o < pr->num_strings)
return sr->string - pr->pr_strings; return sr->string - pr->pr_strings;
for (i = 0; i < pr->dyn_str_size; i++) { for (i = 0; i < pr->dyn_str_size; i++) {
int d = sr - pr->dynamic_strings[i]; int d = sr - pr->dynamic_strings[i];
@ -153,7 +154,8 @@ void
PR_GarbageCollect (progs_t *pr) PR_GarbageCollect (progs_t *pr)
{ {
char *str; char *str;
int i, j; unsigned int i;
int j;
ddef_t *def; ddef_t *def;
strref_t *sr; strref_t *sr;
@ -196,9 +198,9 @@ PR_GarbageCollect (progs_t *pr)
} }
static inline char * static inline char *
get_string (progs_t *pr, unsigned int num) get_string (progs_t *pr, int num)
{ {
if ((int) num < 0) { if (num < 0) {
unsigned int row = ~num / 1024; unsigned int row = ~num / 1024;
num = ~num % 1024; num = ~num % 1024;

View file

@ -117,7 +117,8 @@ EXP_FindIndexByFunc (opfunc func)
static optable_t * static optable_t *
EXP_FindOpByStr (const char *str) EXP_FindOpByStr (const char *str)
{ {
int i, len, fi; size_t i, len;
int fi;
for (i = 0, len = 0, fi = -1; optable[i].func; i++) for (i = 0, len = 0, fi = -1; optable[i].func; i++)
if (!strncmp (str, optable[i].str, strlen (optable[i].str)) if (!strncmp (str, optable[i].str, strlen (optable[i].str))
@ -134,7 +135,8 @@ EXP_FindOpByStr (const char *str)
static functable_t * static functable_t *
EXP_FindFuncByStr (const char *str) EXP_FindFuncByStr (const char *str)
{ {
int i, len, fi; size_t i, len;
int fi;
for (i = 0, len = 0, fi = -1; functable[i].func; i++) for (i = 0, len = 0, fi = -1; functable[i].func; i++)
if (!strncmp (str, functable[i].str, strlen (functable[i].str)) if (!strncmp (str, functable[i].str, strlen (functable[i].str))
@ -222,7 +224,7 @@ EXP_ParseString (char *str)
char buf[256]; char buf[256];
token *chain, *new, *cur; token *chain, *new, *cur;
int i, m; size_t i, m;
optable_t *op; optable_t *op;
functable_t *func; functable_t *func;

View file

@ -214,7 +214,8 @@ static void
GIB_Local_f (void) GIB_Local_f (void)
{ {
gib_var_t *var; gib_var_t *var;
unsigned int index, i; unsigned int index;
int i;
static hashtab_t *zero = 0; static hashtab_t *zero = 0;
if (GIB_Argc () < 2) if (GIB_Argc () < 2)
@ -238,7 +239,8 @@ static void
GIB_Global_f (void) GIB_Global_f (void)
{ {
gib_var_t *var; gib_var_t *var;
unsigned int index, i; unsigned int index;
int i;
static hashtab_t *zero = 0; static hashtab_t *zero = 0;
if (GIB_Argc () < 2) if (GIB_Argc () < 2)
@ -261,7 +263,8 @@ static void
GIB_Delete_f (void) GIB_Delete_f (void)
{ {
gib_var_t *var; gib_var_t *var;
unsigned int index, i; unsigned int index;
int i;
hashtab_t *source; hashtab_t *source;
char *c; char *c;
@ -312,7 +315,7 @@ GIB_Return_f (void)
if (GIB_Argc () > 1 && sp && sp->interpreter == &gib_interp if (GIB_Argc () > 1 && sp && sp->interpreter == &gib_interp
&& GIB_DATA (sp)->waitret) { && GIB_DATA (sp)->waitret) {
unsigned int i; int i;
dstring_t *dstr; dstring_t *dstr;
for (i = 1; i < GIB_Argc (); i++) { for (i = 1; i < GIB_Argc (); i++) {
@ -327,7 +330,7 @@ static void
GIB_For_f (void) GIB_For_f (void)
{ {
dstring_t *dstr; dstring_t *dstr;
unsigned int i; int i;
GIB_Buffer_Push_Sstack (cbuf_active); GIB_Buffer_Push_Sstack (cbuf_active);
dstr = GIB_Buffer_Dsarray_Get (cbuf_active); dstr = GIB_Buffer_Dsarray_Get (cbuf_active);
@ -352,7 +355,7 @@ GIB_Runexported_f (void)
"The QuakeForge developers.", Cmd_Argv (0)); "The QuakeForge developers.", Cmd_Argv (0));
else { else {
cbuf_t *sub = Cbuf_PushStack (&gib_interp); cbuf_t *sub = Cbuf_PushStack (&gib_interp);
unsigned int i; int i;
args = malloc (sizeof (char *) * Cmd_Argc()); args = malloc (sizeof (char *) * Cmd_Argc());
for (i = 0; i < Cmd_Argc(); i++) for (i = 0; i < Cmd_Argc(); i++)
@ -422,7 +425,7 @@ GIB_Count_f (void)
static void static void
GIB_Contains_f (void) GIB_Contains_f (void)
{ {
unsigned int i; int i;
if (GIB_Argc () < 2) if (GIB_Argc () < 2)
GIB_USAGE ("needle [straw1 straw2 ...]"); GIB_USAGE ("needle [straw1 straw2 ...]");
else if (GIB_CanReturn()) else if (GIB_CanReturn())

View file

@ -81,7 +81,7 @@ GIB_Execute_Split_Var (cbuf_t * cbuf)
{ {
gib_var_t *var; gib_var_t *var;
unsigned int i; unsigned int i;
int start = 0, end = (int) ((unsigned int) ~0 >> 1); unsigned int start = 0, end = ((unsigned int) ~0 >> 1);
char *c, *str = cbuf->args->argv[cbuf->args->argc - 1]->str + 1; char *c, *str = cbuf->args->argv[cbuf->args->argc - 1]->str + 1;
void *m = cbuf->args->argm[cbuf->args->argc - 1]; void *m = cbuf->args->argm[cbuf->args->argc - 1];
@ -204,7 +204,7 @@ GIB_Execute (cbuf_t * cbuf)
gib_function_t *f; gib_function_t *f;
unsigned int index; unsigned int index;
gib_var_t *var; gib_var_t *var;
unsigned int i; int i;
if (!g->program) if (!g->program)
return; return;

View file

@ -882,7 +882,7 @@ static reg_errcode_t compile_range (const char **p_ptr, const char *pend, char *
cast the subscript to translate because some data is declared as cast the subscript to translate because some data is declared as
`char *', to avoid warnings when a string constant is passed. But `char *', to avoid warnings when a string constant is passed. But
when we use a character as a subscript we must make it unsigned. */ when we use a character as a subscript we must make it unsigned. */
#define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d)) #define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (unsigned char)(d))
/* Macros for outputting the compiled pattern into `buffer'. */ /* Macros for outputting the compiled pattern into `buffer'. */
@ -892,7 +892,7 @@ static reg_errcode_t compile_range (const char **p_ptr, const char *pend, char *
/* Make sure we have at least N more bytes of space in buffer. */ /* Make sure we have at least N more bytes of space in buffer. */
#define GET_BUFFER_SPACE(n) \ #define GET_BUFFER_SPACE(n) \
while (b - bufp->buffer + (n) > bufp->allocated) \ while ((unsigned long)(b - bufp->buffer + (n)) > bufp->allocated) \
EXTEND_BUFFER () EXTEND_BUFFER ()
/* Make sure we have one more byte of buffer space and then add C to it. */ /* Make sure we have one more byte of buffer space and then add C to it. */
@ -2240,7 +2240,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
char' -- the range is inclusive, so if `range_end' == 0xff char' -- the range is inclusive, so if `range_end' == 0xff
(assuming 8-bit characters), we would otherwise go into an infinite (assuming 8-bit characters), we would otherwise go into an infinite
loop, since all characters <= 0xff. */ loop, since all characters <= 0xff. */
for (this_char = range_start; this_char <= range_end; this_char++) for (this_char = range_start; this_char <= (unsigned) range_end; this_char++)
{ {
SET_LIST_BIT (TRANSLATE (this_char)); SET_LIST_BIT (TRANSLATE (this_char));
} }
@ -2361,7 +2361,7 @@ typedef struct
char *destination; \ char *destination; \
/* Must be int, so when we don't save any registers, the arithmetic \ /* Must be int, so when we don't save any registers, the arithmetic \
of 0 + -1 isn't done as unsigned. */ \ of 0 + -1 isn't done as unsigned. */ \
int this_reg; \ unsigned int this_reg; \
\ \
DEBUG_STATEMENT (failure_id++); \ DEBUG_STATEMENT (failure_id++); \
DEBUG_STATEMENT (nfailure_points_pushed++); \ DEBUG_STATEMENT (nfailure_points_pushed++); \
@ -2468,7 +2468,7 @@ typedef struct
#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\ #define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
{ \ { \
DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \ DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \
int this_reg; \ unsigned int this_reg; \
const unsigned char *string_temp; \ const unsigned char *string_temp; \
\ \
assert (!FAIL_STACK_EMPTY ()); \ assert (!FAIL_STACK_EMPTY ()); \
@ -3174,7 +3174,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
int stop; int stop;
{ {
/* General temporaries. */ /* General temporaries. */
int mcnt; unsigned int mcnt;
unsigned char *p1; unsigned char *p1;
/* Just past the end of the corresponding string. */ /* Just past the end of the corresponding string. */
@ -3764,7 +3764,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
EVER_MATCHED_SOMETHING (reg_info[*p]) = 0; EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
/* Restore this and inner groups' (if any) registers. */ /* Restore this and inner groups' (if any) registers. */
for (r = *p; r < *p + *(p + 1); r++) for (r = *p; r < (unsigned) (*p + *(p + 1)); r++)
{ {
regstart[r] = old_regstart[r]; regstart[r] = old_regstart[r];
@ -3833,7 +3833,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Want how many consecutive characters we can match in /* Want how many consecutive characters we can match in
one shot, so, if necessary, adjust the count. */ one shot, so, if necessary, adjust the count. */
if (mcnt > dend2 - d2) if (mcnt > (unsigned) (dend2 - d2))
mcnt = dend2 - d2; mcnt = dend2 - d2;
/* Compare that many; failure if mismatch, else move /* Compare that many; failure if mismatch, else move
@ -4770,7 +4770,7 @@ regcomp (preg, pattern, cflags)
/* Map uppercase characters to corresponding lowercase ones. */ /* Map uppercase characters to corresponding lowercase ones. */
for (i = 0; i < CHAR_SET_SIZE; i++) for (i = 0; i < CHAR_SET_SIZE; i++)
preg->translate[i] = ISUPPER (i) ? tolower (i) : i; preg->translate[i] = ISUPPER (i) ? (unsigned) tolower (i) : i;
} }
else else
preg->translate = NULL; preg->translate = NULL;
@ -4890,7 +4890,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
size_t msg_size; size_t msg_size;
if (errcode < 0 if (errcode < 0
|| errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0]))) || (size_t) errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0])))
/* Only error codes returned by the rest of the code should be passed /* Only error codes returned by the rest of the code should be passed
to this routine. If we are given anything else, or if other regex to this routine. If we are given anything else, or if other regex
code generates an invalid error code, then the program has a bug. code generates an invalid error code, then the program has a bug.

View file

@ -299,6 +299,7 @@ BuildTris (void)
add_command (-(bestlen + 2)); add_command (-(bestlen + 2));
for (j = 0; j < bestlen + 2; j++) { for (j = 0; j < bestlen + 2; j++) {
int tmp;
// emit a vertex into the reorder buffer // emit a vertex into the reorder buffer
k = bestverts[j]; k = bestverts[j];
add_vertex (k); add_vertex (k);
@ -311,8 +312,10 @@ BuildTris (void)
s = (s + 0.5) / pheader->mdl.skinwidth; s = (s + 0.5) / pheader->mdl.skinwidth;
t = (t + 0.5) / pheader->mdl.skinheight; t = (t + 0.5) / pheader->mdl.skinheight;
add_command (*(int *) &s); memcpy (&tmp, &s, 4);
add_command (*(int *) &t); add_command (tmp);
memcpy (&tmp, &t, 4);
add_command (tmp);
} }
} }

View file

@ -144,7 +144,7 @@ Mod_LoadSkin (byte * skin, int skinsize, int snum, int gnum, qboolean group,
Mod_FloodFillSkin (pskin, pheader->mdl.skinwidth, pheader->mdl.skinheight); Mod_FloodFillSkin (pskin, pheader->mdl.skinwidth, pheader->mdl.skinheight);
// save 8 bit texels for the player model to remap // save 8 bit texels for the player model to remap
if (strequal (loadmodel->name, "progs/player.mdl")) { if (strequal (loadmodel->name, "progs/player.mdl")) {
if (skinsize > sizeof (player_8bit_texels)) if (skinsize > (int) sizeof (player_8bit_texels))
Sys_Error ("Player skin too large"); Sys_Error ("Player skin too large");
memcpy (player_8bit_texels, pskin, skinsize); memcpy (player_8bit_texels, pskin, skinsize);
} }

View file

@ -819,7 +819,7 @@ Mod_LoadBrushModel (model_t *mod, void *buffer)
// swap all the lumps // swap all the lumps
mod_base = (byte *) header; mod_base = (byte *) header;
for (i = 0; i < sizeof (dheader_t) / 4; i++) for (i = 0; i < (int) sizeof (dheader_t) / 4; i++)
((int *) header)[i] = LittleLong (((int *) header)[i]); ((int *) header)[i] = LittleLong (((int *) header)[i]);
// checksum all of the map, except for entities // checksum all of the map, except for entities

View file

@ -372,7 +372,7 @@ Datagram_GetMessage (qsocket_t * sock)
if (length == 0) if (length == 0)
break; break;
if (length == -1) { if ((int) length == -1) {
Con_Printf ("Read error\n"); Con_Printf ("Read error\n");
return -1; return -1;
} }
@ -562,7 +562,7 @@ Test_Poll (void *unused)
len = len =
dfunc.Read (testSocket, net_message->message->data, dfunc.Read (testSocket, net_message->message->data,
net_message->message->maxsize, &clientaddr); net_message->message->maxsize, &clientaddr);
if (len < sizeof (int)) if (len < (int) sizeof (int))
break; break;
net_message->message->cursize = len; net_message->message->cursize = len;
@ -572,7 +572,7 @@ Test_Poll (void *unused)
MSG_ReadLong (net_message); MSG_ReadLong (net_message);
if (control == -1) if (control == -1)
break; break;
if ((control & (~NETFLAG_LENGTH_MASK)) != NETFLAG_CTL) if ((control & (~NETFLAG_LENGTH_MASK)) != (int) NETFLAG_CTL)
break; break;
if ((control & NETFLAG_LENGTH_MASK) != len) if ((control & NETFLAG_LENGTH_MASK) != len)
break; break;
@ -690,7 +690,7 @@ Test2_Poll (void *unused)
len = len =
dfunc.Read (test2Socket, net_message->message->data, dfunc.Read (test2Socket, net_message->message->data,
net_message->message->maxsize, &clientaddr); net_message->message->maxsize, &clientaddr);
if (len < sizeof (int)) if (len < (int) sizeof (int))
goto Reschedule; goto Reschedule;
net_message->message->cursize = len; net_message->message->cursize = len;
@ -700,7 +700,7 @@ Test2_Poll (void *unused)
MSG_ReadLong (net_message); MSG_ReadLong (net_message);
if (control == -1) if (control == -1)
goto Error; goto Error;
if ((control & (~NETFLAG_LENGTH_MASK)) != NETFLAG_CTL) if ((control & (~NETFLAG_LENGTH_MASK)) != (int) NETFLAG_CTL)
goto Error; goto Error;
if ((control & NETFLAG_LENGTH_MASK) != len) if ((control & NETFLAG_LENGTH_MASK) != len)
goto Error; goto Error;
@ -889,7 +889,7 @@ _Datagram_CheckNewConnections (void)
len = len =
dfunc.Read (acceptsock, net_message->message->data, dfunc.Read (acceptsock, net_message->message->data,
net_message->message->maxsize, &clientaddr); net_message->message->maxsize, &clientaddr);
if (len < sizeof (int)) if (len < (int) sizeof (int))
return NULL; return NULL;
net_message->message->cursize = len; net_message->message->cursize = len;
@ -899,7 +899,7 @@ _Datagram_CheckNewConnections (void)
MSG_ReadLong (net_message); MSG_ReadLong (net_message);
if (control == -1) if (control == -1)
return NULL; return NULL;
if ((control & (~NETFLAG_LENGTH_MASK)) != NETFLAG_CTL) if ((control & (~NETFLAG_LENGTH_MASK)) != (int) NETFLAG_CTL)
return NULL; return NULL;
if ((control & NETFLAG_LENGTH_MASK) != len) if ((control & NETFLAG_LENGTH_MASK) != len)
return NULL; return NULL;
@ -1183,7 +1183,7 @@ _Datagram_SearchForHosts (qboolean xmit)
(ret = (ret =
dfunc.Read (dfunc.controlSock, net_message->message->data, dfunc.Read (dfunc.controlSock, net_message->message->data,
net_message->message->maxsize, &readaddr)) > 0) { net_message->message->maxsize, &readaddr)) > 0) {
if (ret < sizeof (int)) if (ret < (int) sizeof (int))
continue; continue;
net_message->message->cursize = ret; net_message->message->cursize = ret;
@ -1201,7 +1201,7 @@ _Datagram_SearchForHosts (qboolean xmit)
MSG_ReadLong (net_message); MSG_ReadLong (net_message);
if (control == -1) if (control == -1)
continue; continue;
if ((control & (~NETFLAG_LENGTH_MASK)) != NETFLAG_CTL) if ((control & (~NETFLAG_LENGTH_MASK)) != (int) NETFLAG_CTL)
continue; continue;
if ((control & NETFLAG_LENGTH_MASK) != ret) if ((control & NETFLAG_LENGTH_MASK) != ret)
continue; continue;
@ -1334,7 +1334,7 @@ _Datagram_Connect (const char *host)
continue; continue;
} }
if (ret < sizeof (int)) { if (ret < (int) sizeof (int)) {
ret = 0; ret = 0;
continue; continue;
} }
@ -1348,7 +1348,7 @@ _Datagram_Connect (const char *host)
ret = 0; ret = 0;
continue; continue;
} }
if ((control & (~NETFLAG_LENGTH_MASK)) != NETFLAG_CTL) { if ((control & (~NETFLAG_LENGTH_MASK)) != (int) NETFLAG_CTL) {
ret = 0; ret = 0;
continue; continue;
} }

View file

@ -194,7 +194,7 @@ Hash_DelTable (hashtab_t *tab)
void void
Hash_FlushTable (hashtab_t *tab) Hash_FlushTable (hashtab_t *tab)
{ {
int i; size_t i;
for (i = 0; i < tab->tab_size; i++) { for (i = 0; i < tab->tab_size; i++) {
while (tab->tab[i]) { while (tab->tab[i]) {
@ -419,7 +419,7 @@ Hash_Stats (hashtab_t *tab)
{ {
int *lengths = calloc (tab->tab_size, sizeof (int)); int *lengths = calloc (tab->tab_size, sizeof (int));
int chains = 0; int chains = 0;
int i; size_t i;
int min_length = tab->num_ele; int min_length = tab->num_ele;
int max_length = 0; int max_length = 0;

View file

@ -254,7 +254,7 @@ const char *
MSG_ReadString (msg_t *msg) MSG_ReadString (msg_t *msg)
{ {
char *string; char *string;
int len, maxlen; size_t len, maxlen;
if (msg->badread || msg->readcount + 1 > msg->message->cursize) { if (msg->badread || msg->readcount + 1 > msg->message->cursize) {
msg->badread = true; msg->badread = true;

View file

@ -234,7 +234,7 @@ int
pack_extract (pack_t *pack, dpackfile_t *pf) pack_extract (pack_t *pack, dpackfile_t *pf)
{ {
const char *name = pf->name; const char *name = pf->name;
int count; size_t count;
int len; int len;
QFile *file; QFile *file;
char buffer[16384]; char buffer[16384];

View file

@ -57,7 +57,7 @@ static const char *safeargvs[] =
{ "-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse", { "-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse",
"-dibonly" }; "-dibonly" };
#define NUM_SAFE_ARGVS (sizeof(safeargvs)/sizeof(safeargvs[0])) #define NUM_SAFE_ARGVS ((int) (sizeof(safeargvs)/sizeof(safeargvs[0])))
int com_argc; int com_argc;
const char **com_argv; const char **com_argv;

View file

@ -189,7 +189,7 @@ Qopen (const char *path, const char *mode)
Qexpand_squiggle (path, e_path); Qexpand_squiggle (path, e_path);
path = e_path; path = e_path;
for (p = m; *mode && p - m < (sizeof (m) - 1); mode++) { for (p = m; *mode && p - m < ((int) sizeof (m) - 1); mode++) {
if (*mode == 'z') { if (*mode == 'z') {
zip = 1; zip = 1;
continue; continue;
@ -248,7 +248,7 @@ Qdopen (int fd, const char *mode)
#ifdef WIN32 #ifdef WIN32
setmode (fd, O_BINARY); setmode (fd, O_BINARY);
#endif #endif
for (p = m; *mode && p - m < (sizeof (m) - 1); mode++) { for (p = m; *mode && p - m < ((int) sizeof (m) - 1); mode++) {
if (*mode == 'z') { if (*mode == 'z') {
zip = 1; zip = 1;
continue; continue;

View file

@ -261,7 +261,7 @@ static riff_d_cue_t *
read_cue (QFile *f, int len) read_cue (QFile *f, int len)
{ {
riff_d_cue_t *cue = malloc (len); riff_d_cue_t *cue = malloc (len);
int i; unsigned int i;
if (!Rread (f, cue, len)) { if (!Rread (f, cue, len)) {
free (cue); free (cue);

View file

@ -81,7 +81,7 @@ W_LoadWadFile (const char *filename)
{ {
lumpinfo_t *lump_p; lumpinfo_t *lump_p;
wadinfo_t *header; wadinfo_t *header;
unsigned int i; int i;
int infotableofs; int infotableofs;
wad_base = QFS_LoadHunkFile (filename); wad_base = QFS_LoadHunkFile (filename);

View file

@ -533,7 +533,7 @@ Hunk_TempAlloc (int size)
size = (size + 15) & ~15; size = (size + 15) & ~15;
if (hunk_tempactive) { if (hunk_tempactive) {
if (hunk_high_used - hunk_tempmark >= size + sizeof (hunk_t)) { if (hunk_high_used - hunk_tempmark >= size + (int) sizeof (hunk_t)) {
return (hunk_t *) (hunk_base + hunk_size - hunk_high_used) + 1; return (hunk_t *) (hunk_base + hunk_size - hunk_high_used) + 1;
} }
Hunk_FreeToHighMark (hunk_tempmark); Hunk_FreeToHighMark (hunk_tempmark);

View file

@ -69,9 +69,9 @@ static __attribute__ ((unused)) const char rcsid[] =
byte *draw_chars; // 8*8 graphic characters byte *draw_chars; // 8*8 graphic characters
int tVAsize; int tVAsize;
int *tVAindices; int *tVAindices;
unsigned int tVAcount; int tVAcount;
float *textVertices, *tV; float *textVertices, *tV;
float *textCoords, *tC; float *textCoords, *tC;

View file

@ -116,7 +116,7 @@ R_RenderDlight (dlight_t *light)
void void
R_RenderDlights (void) R_RenderDlights (void)
{ {
int i; unsigned int i;
dlight_t *l; dlight_t *l;
if (!gl_dlight_polyblend->int_val) if (!gl_dlight_polyblend->int_val)

View file

@ -130,7 +130,8 @@ R_InitParticles (void)
if (r_maxparticles && r_init) { if (r_maxparticles && r_init) {
if (vaelements > 3) if (vaelements > 3)
pVAsize = min (vaelements - (vaelements % 4), r_maxparticles * 4); pVAsize = min ((unsigned int) (vaelements - (vaelements % 4)),
r_maxparticles * 4);
else if (vaelements >= 0) else if (vaelements >= 0)
pVAsize = r_maxparticles * 4; pVAsize = r_maxparticles * 4;
else else
@ -335,9 +336,9 @@ static void
R_RunParticleEffect_QF (const vec3_t org, const vec3_t dir, int color, R_RunParticleEffect_QF (const vec3_t org, const vec3_t dir, int color,
int count) int count)
{ {
float scale; float scale;
unsigned int i, j; int i, j;
vec3_t porg; vec3_t porg;
if (numparticles >= r_maxparticles) if (numparticles >= r_maxparticles)
return; return;
@ -936,7 +937,7 @@ R_RunParticleEffect_ID (const vec3_t org, const vec3_t dir, int color,
int count) int count)
{ {
float scale; float scale;
unsigned int i, j; int i, j;
vec3_t porg; vec3_t porg;
if (numparticles >= r_maxparticles) if (numparticles >= r_maxparticles)
@ -1311,8 +1312,8 @@ R_DrawParticles (void)
float grav, fast_grav, minparticledist, scale, float grav, fast_grav, minparticledist, scale,
time_125, time_25, time_40, time_55, time2, time4, time5, time_125, time_25, time_40, time_55, time2, time4, time5,
time10, time15, time30, time50; time10, time15, time30, time50;
int activeparticles, maxparticle, j, k; int activeparticles, maxparticle, j, vacount;
unsigned int vacount; unsigned int k;
varray_t2f_c4ub_v3f_t *VA; varray_t2f_c4ub_v3f_t *VA;
particle_t *part; particle_t *part;
vec3_t up_scale, right_scale, up_right_scale, down_right_scale; vec3_t up_scale, right_scale, up_right_scale, down_right_scale;

View file

@ -109,10 +109,10 @@ static void
R_AddDynamicLights_1 (msurface_t *surf) R_AddDynamicLights_1 (msurface_t *surf)
{ {
float dist; float dist;
int lnum, maxdist, maxdist2, maxdist3, smax, smax_bytes, tmax, int maxdist, maxdist2, maxdist3, smax, smax_bytes, tmax,
grey; grey, s, t, td;
unsigned int td, i, j, s, t; unsigned int lnum, i, j;
unsigned int sdtable[18]; int sdtable[18];
unsigned int *bl; unsigned int *bl;
vec3_t impact, local; vec3_t impact, local;
@ -173,10 +173,10 @@ static void
R_AddDynamicLights_3 (msurface_t *surf) R_AddDynamicLights_3 (msurface_t *surf)
{ {
float dist; float dist;
int lnum, maxdist, maxdist2, maxdist3, smax, smax_bytes, tmax, int maxdist, maxdist2, maxdist3, smax, smax_bytes, tmax,
red, green, blue; red, green, blue, s, t, td;
unsigned int td, i, j, s, t; unsigned int lnum, i, j;
unsigned int sdtable[18]; int sdtable[18];
unsigned int *bl; unsigned int *bl;
vec3_t impact, local; vec3_t impact, local;

View file

@ -599,8 +599,9 @@ void
R_DrawAliasModel (entity_t *e) R_DrawAliasModel (entity_t *e)
{ {
float add, an, minshade, radius, shade; float add, an, minshade, radius, shade;
int lnum, texture, i; int texture, i;
int fb_texture = 0; int fb_texture = 0;
unsigned int lnum;
aliashdr_t *paliashdr; aliashdr_t *paliashdr;
model_t *model; model_t *model;
vec3_t dist, scale; vec3_t dist, scale;

View file

@ -265,7 +265,8 @@ R_DrawBrushModel (entity_t *e)
{ {
float dot, radius; float dot, radius;
float color[4]; float color[4];
int i, k; int i;
unsigned int k;
model_t *model; model_t *model;
mplane_t *pplane; mplane_t *pplane;
msurface_t *psurf; msurface_t *psurf;
@ -527,7 +528,7 @@ R_MarkLeaves (void)
} else } else
vis = Mod_LeafPVS (r_viewleaf, r_worldentity.model); vis = Mod_LeafPVS (r_viewleaf, r_worldentity.model);
for (i = 0; i < r_worldentity.model->numleafs; i++) { for (i = 0; (int) i < r_worldentity.model->numleafs; i++) {
if (vis[i >> 3] & (1 << (i & 7))) { if (vis[i >> 3] & (1 << (i & 7))) {
leaf = &r_worldentity.model->leafs[i + 1]; leaf = &r_worldentity.model->leafs[i + 1];
if ((c = leaf->nummarksurfaces)) { if ((c = leaf->nummarksurfaces)) {

View file

@ -140,8 +140,10 @@ SCR_ScreenShot (int width, int height)
qfglReadPixels (0, 0, vid.width, vid.height, GL_RGB, GL_UNSIGNED_BYTE, qfglReadPixels (0, 0, vid.width, vid.height, GL_RGB, GL_UNSIGNED_BYTE,
snap); snap);
w = (vid.width < width) ? vid.width : width; w = (vid.width < (unsigned int) width) ? vid.width
h = (vid.height < height) ? vid.height : height; : (unsigned int) width;
h = (vid.height < (unsigned int) height) ? vid.height
: (unsigned int) height;
fracw = (float) vid.width / (float) w; fracw = (float) vid.width / (float) w;
frach = (float) vid.height / (float) h; frach = (float) vid.height / (float) h;

View file

@ -102,7 +102,7 @@ build_skin_8 (byte * original, int tinwidth, int tinheight,
// Improvements should be mirrored in GL_ResampleTexture in gl_textures.c // Improvements should be mirrored in GL_ResampleTexture in gl_textures.c
byte *inrow; byte *inrow;
byte pixels[512 * 256], *out; byte pixels[512 * 256], *out;
int i, j; unsigned int i, j;
unsigned int frac, fracstep; unsigned int frac, fracstep;
out = pixels; out = pixels;
@ -128,7 +128,7 @@ build_skin_32 (byte * original, int tinwidth, int tinheight,
{ {
// Improvements should be mirrored in GL_ResampleTexture in gl_textures.c // Improvements should be mirrored in GL_ResampleTexture in gl_textures.c
byte *inrow; byte *inrow;
int i, j; unsigned int i, j;
int samples = alpha ? gl_alpha_format : gl_solid_format; int samples = alpha ? gl_alpha_format : gl_solid_format;
unsigned int frac, fracstep; unsigned int frac, fracstep;
unsigned int pixels[512 * 256], *out; unsigned int pixels[512 * 256], *out;

View file

@ -68,16 +68,6 @@ void *alloca(size_t size);
/* cube face to sky texture offset conversion */ /* cube face to sky texture offset conversion */
static const int skytex_offs[] = { 3, 0, 4, 1, 2, 5 }; static const int skytex_offs[] = { 3, 0, 4, 1, 2, 5 };
/* clockwise loop through the cube faces adjoining the current face */
static const int face_loop[6][5] = {
{1, 2, 4, 5, 1},
{0, 5, 3, 2, 0},
{0, 1, 3, 4, 0},
{1, 5, 4, 2, 1},
{0, 2, 3, 5, 0},
{0, 4, 3, 1, 0},
};
/* convert axis and face distance into face */ /* convert axis and face distance into face */
static const int faces_table[3][6] = { static const int faces_table[3][6] = {
{-1, 0, 0, -1, 3, 3}, {-1, 0, 0, -1, 3, 3},

View file

@ -62,12 +62,13 @@ noise_diamondsquare (unsigned char *noise, unsigned int size,
#define n(x, y) noisebuf[(((y) & size1) << sizepower) + ((x) & size1)] #define n(x, y) noisebuf[(((y) & size1) << sizepower) + ((x) & size1)]
for (sizepower = 0; (1 << sizepower) < size; sizepower++); for (sizepower = 0; (unsigned int) (1 << sizepower) < size; sizepower++);
if (size != (1 << sizepower)) if (size != (unsigned int) (1 << sizepower))
Sys_Error("fractalnoise: size must be power of 2"); Sys_Error("fractalnoise: size must be power of 2");
for (gridpower = 0; (1 << gridpower) < startgrid; gridpower++); for (gridpower = 0; (unsigned int) (1 << gridpower) < startgrid;
if (startgrid != (1 << gridpower)) gridpower++);
if (startgrid != (unsigned int) (1 << gridpower))
Sys_Error("fractalnoise: grid must be power of 2"); Sys_Error("fractalnoise: grid must be power of 2");
startgrid = bound(0, startgrid, size); startgrid = bound(0, startgrid, size);
@ -123,7 +124,8 @@ noise_diamondsquare (unsigned char *noise, unsigned int size,
void void
noise_plasma (unsigned char *noise, int size) noise_plasma (unsigned char *noise, int size)
{ {
unsigned int a, b, c, d, i, j, k; unsigned int a, b, c, d, i;
int j, k;
if (128 >= size) if (128 >= size)
d = 64 / size; d = 64 / size;

View file

@ -299,7 +299,7 @@ R_MarkLights (const vec3_t lightorigin, dlight_t *light, int bit,
void void
R_PushDlights (const vec3_t entorigin) R_PushDlights (const vec3_t entorigin)
{ {
int i; unsigned int i;
dlight_t *l; dlight_t *l;
vec3_t lightorigin; vec3_t lightorigin;
@ -483,7 +483,7 @@ R_LightPoint (const vec3_t p)
dlight_t * dlight_t *
R_AllocDlight (int key) R_AllocDlight (int key)
{ {
int i; unsigned int i;
dlight_t *dl; dlight_t *dl;
if (!r_maxdlights) { if (!r_maxdlights) {
@ -522,7 +522,7 @@ R_AllocDlight (int key)
void void
R_DecayLights (double frametime) R_DecayLights (double frametime)
{ {
int i; unsigned int i;
dlight_t *dl; dlight_t *dl;
dl = r_dlights; dl = r_dlights;

View file

@ -58,7 +58,9 @@ float r_time1;
int r_lineadj; int r_lineadj;
qboolean r_active; qboolean r_active;
static void (*const r_progs_init)(struct progs_s *) = R_Progs_Init; #define U __attribute__ ((unused))
static U void (*const r_progs_init)(struct progs_s *) = R_Progs_Init;
#undef U
byte color_white[4] = { 255, 255, 255, 0 }; // alpha will be explicitly set byte color_white[4] = { 255, 255, 255, 0 }; // alpha will be explicitly set
byte color_black[4] = { 0, 0, 0, 0 }; // alpha will be explicitly set byte color_black[4] = { 0, 0, 0, 0 }; // alpha will be explicitly set

View file

@ -326,7 +326,7 @@ SCR_DrawFPS (void)
i = 80; i = 80;
} }
x = hudswap ? vid.width - ((strlen (st) * 8) + i) : i; x = hudswap ? vid.width - ((strlen (st) * 8) + i) : (unsigned int) i;
y = vid.height - sb_lines - 8; y = vid.height - sb_lines - 8;
Draw_String (x, y, st); Draw_String (x, y, st);
} }

View file

@ -37,7 +37,7 @@ static __attribute__ ((unused)) const char rcsid[] =
void void
D_FillRect (vrect_t *rect, int color) D_FillRect (vrect_t *rect, int color)
{ {
int rx, ry, rwidth, rheight; unsigned int rx, ry, rwidth, rheight;
unsigned char *dest; unsigned char *dest;
unsigned int *ldest; unsigned int *ldest;

View file

@ -102,7 +102,7 @@ D_ViewChanged (void)
r_refdef.vrectbottom - (d_pix_max << d_y_aspect_shift); r_refdef.vrectbottom - (d_pix_max << d_y_aspect_shift);
{ {
int i; unsigned int i;
for (i = 0; i < vid.height; i++) { for (i = 0; i < vid.height; i++) {
d_scantable[i] = i * rowpixels; d_scantable[i] = i * rowpixels;

View file

@ -212,7 +212,7 @@ Draw_Character (int x, int y, unsigned int num)
if (y <= -8) if (y <= -8)
return; // totally off screen return; // totally off screen
if (y > vid.height - 8 || x < 0 || x > vid.width - 8) if (y > (int) vid.height - 8 || x < 0 || x > (int) vid.width - 8)
return; return;
if (num < 0 || num > 255) if (num < 0 || num > 255)
return; return;
@ -376,8 +376,8 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
byte *dest, *source, tbyte; byte *dest, *source, tbyte;
int u, v; int u, v;
if ((x < 0) || if ((x < 0) || (x + width > (int) vid.width)
(x + width > vid.width) || (y < 0) || (y + height > vid.height)) { || (y < 0) || (y + height > (int) vid.height)) {
Sys_Error ("Draw_SubPic: bad coordinates"); Sys_Error ("Draw_SubPic: bad coordinates");
} }
@ -493,7 +493,7 @@ Draw_ConsoleBackground (int lines)
else { else {
f = 0; f = 0;
fstep = 320 * 0x10000 / vid.conwidth; fstep = 320 * 0x10000 / vid.conwidth;
for (x = 0; x < vid.conwidth; x += 4) { for (x = 0; x < (int) vid.conwidth; x += 4) {
dest[x] = src[f >> 16]; dest[x] = src[f >> 16];
f += fstep; f += fstep;
dest[x + 1] = src[f >> 16]; dest[x + 1] = src[f >> 16];
@ -621,7 +621,8 @@ Draw_Fill (int x, int y, int w, int h, int c)
byte *dest; byte *dest;
int u, v; int u, v;
if (x < 0 || x + w > vid.width || y < 0 || y + h > vid.height) { if (x < 0 || x + w > (int) vid.width
|| y < 0 || y + h > (int) vid.height) {
Con_Printf ("Bad Draw_Fill(%d, %d, %d, %d, %c)\n", x, y, w, h, c); Con_Printf ("Bad Draw_Fill(%d, %d, %d, %d, %c)\n", x, y, w, h, c);
return; return;
} }
@ -636,7 +637,7 @@ Draw_Fill (int x, int y, int w, int h, int c)
void void
Draw_FadeScreen (void) Draw_FadeScreen (void)
{ {
int x, y; unsigned int x, y;
byte *pbuf; byte *pbuf;
VID_UnlockBuffer (); VID_UnlockBuffer ();
@ -644,7 +645,7 @@ Draw_FadeScreen (void)
VID_LockBuffer (); VID_LockBuffer ();
for (y = 0; y < vid.height; y++) { for (y = 0; y < vid.height; y++) {
int t; unsigned int t;
pbuf = (byte *) (vid.buffer + vid.rowbytes * y); pbuf = (byte *) (vid.buffer + vid.rowbytes * y);
t = (y & 1) << 1; t = (y & 1) << 1;

View file

@ -177,8 +177,10 @@ SCR_ScreenShot (int width, int height)
// enable direct drawing of console to back buffer // enable direct drawing of console to back buffer
D_EnableBackBufferAccess (); D_EnableBackBufferAccess ();
w = (vid.width < width) ? vid.width : width; w = (vid.width < (unsigned int) width) ? vid.width
h = (vid.height < height) ? vid.height : height; : (unsigned int) width;
h = (vid.height < (unsigned int) height) ? vid.height
: (unsigned int) height;
fracw = (float) vid.width / (float) w; fracw = (float) vid.width / (float) w;
frach = (float) vid.height / (float) h; frach = (float) vid.height / (float) h;

View file

@ -400,7 +400,7 @@ R_RenderFace (msurface_t *fa, int clipflags)
if (!insubmodel) { if (!insubmodel) {
if (r_pedge->cachededgeoffset & FULLY_CLIPPED_CACHED) { if (r_pedge->cachededgeoffset & FULLY_CLIPPED_CACHED) {
if ((r_pedge->cachededgeoffset & FRAMECOUNT_MASK) == if ((r_pedge->cachededgeoffset & FRAMECOUNT_MASK) ==
r_framecount) { (unsigned int) r_framecount) {
r_lastvertvalid = false; r_lastvertvalid = false;
continue; continue;
} }
@ -435,7 +435,7 @@ R_RenderFace (msurface_t *fa, int clipflags)
if (!insubmodel) { if (!insubmodel) {
if (r_pedge->cachededgeoffset & FULLY_CLIPPED_CACHED) { if (r_pedge->cachededgeoffset & FULLY_CLIPPED_CACHED) {
if ((r_pedge->cachededgeoffset & FRAMECOUNT_MASK) == if ((r_pedge->cachededgeoffset & FRAMECOUNT_MASK) ==
r_framecount) { (unsigned int) r_framecount) {
r_lastvertvalid = false; r_lastvertvalid = false;
continue; continue;
} }

View file

@ -483,7 +483,7 @@ static void
R_DrawEntitiesOnList (void) R_DrawEntitiesOnList (void)
{ {
int i, j; int i, j;
int lnum; unsigned int lnum;
alight_t lighting; alight_t lighting;
// FIXME: remove and do real lighting // FIXME: remove and do real lighting
@ -554,7 +554,7 @@ R_DrawViewModel (void)
// FIXME: remove and do real lighting // FIXME: remove and do real lighting
float lightvec[3] = { -1, 0, 0 }; float lightvec[3] = { -1, 0, 0 };
int j; int j;
int lnum; unsigned int lnum;
vec3_t dist; vec3_t dist;
float add; float add;
dlight_t *dl; dlight_t *dl;
@ -665,7 +665,8 @@ R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
static void static void
R_DrawBEntitiesOnList (void) R_DrawBEntitiesOnList (void)
{ {
int i, j, k, clipflags; int i, j, clipflags;
unsigned int k;
vec3_t oldorigin; vec3_t oldorigin;
model_t *clmodel; model_t *clmodel;
float minmaxs[6]; float minmaxs[6];
@ -1197,7 +1198,7 @@ static void
renderlookup (byte **offs, byte* bufs) renderlookup (byte **offs, byte* bufs)
{ {
byte *p = (byte*)vid.buffer; byte *p = (byte*)vid.buffer;
int x, y; unsigned int x, y;
for (y = 0; y < vid.height; y++) { for (y = 0; y < vid.height; y++) {
for (x = 0; x < vid.width; x++, offs++) for (x = 0; x < vid.width; x++, offs++)
p[x] = **offs; p[x] = **offs;

View file

@ -57,7 +57,7 @@ R_InitParticles (void)
void void
R_ClearParticles (void) R_ClearParticles (void)
{ {
int i; unsigned int i;
free_particles = &particles[0]; free_particles = &particles[0];
active_particles = NULL; active_particles = NULL;

View file

@ -62,7 +62,7 @@ static void
R_AddDynamicLights (void) R_AddDynamicLights (void)
{ {
msurface_t *surf; msurface_t *surf;
int lnum; unsigned int lnum;
int sd, td; int sd, td;
float dist, rad, minlight; float dist, rad, minlight;
vec3_t impact, local, lightorigin; vec3_t impact, local, lightorigin;

View file

@ -43,7 +43,7 @@ D_FillRect (vrect_t *rect, int color)
{ {
case 1: case 1:
{ {
int rx, ry, rwidth, rheight; unsigned int rx, ry, rwidth, rheight;
byte *dest, pix; byte *dest, pix;
pix = color; pix = color;
@ -81,7 +81,7 @@ D_FillRect (vrect_t *rect, int color)
break; break;
case 2: case 2:
{ {
int rx, ry, rwidth, rheight; unsigned int rx, ry, rwidth, rheight;
unsigned short *dest, pix; unsigned short *dest, pix;
pix = d_8to16table[color]; pix = d_8to16table[color];
@ -120,7 +120,7 @@ D_FillRect (vrect_t *rect, int color)
break; break;
case 4: case 4:
{ {
int rx, ry, rwidth, rheight; unsigned int rx, ry, rwidth, rheight;
unsigned int *dest, pix; unsigned int *dest, pix;
pix = d_8to24table[color]; pix = d_8to24table[color];

View file

@ -86,7 +86,7 @@ D_ViewChanged (void)
r_refdef.vrectbottom - (d_pix_max << d_y_aspect_shift); r_refdef.vrectbottom - (d_pix_max << d_y_aspect_shift);
{ {
int i; unsigned int i;
for (i = 0; i < vid.height; i++) { for (i = 0; i < vid.height; i++) {
d_scantable[i] = i * rowpixels; d_scantable[i] = i * rowpixels;

View file

@ -211,7 +211,7 @@ Draw_Character (int x, int y, unsigned int num)
if (y <= -8) if (y <= -8)
return; // totally off screen return; // totally off screen
if (y > vid.height - 8 || x < 0 || x > vid.width - 8) if (y > (int) vid.height - 8 || x < 0 || x > (int) vid.width - 8)
return; return;
if (num < 0 || num > 255) if (num < 0 || num > 255)
return; return;
@ -490,8 +490,8 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
byte *source, tbyte; byte *source, tbyte;
int v, u; int v, u;
if ((x < 0) || if ((x < 0) || (x + width > (int) vid.width)
(x + width > vid.width) || (y < 0) || (y + height > vid.height)) { || (y < 0) || (y + height > (int) vid.height)) {
Sys_Error ("Draw_SubPic: bad coordinates"); Sys_Error ("Draw_SubPic: bad coordinates");
} }
@ -653,7 +653,7 @@ Draw_ConsoleBackground (int lines)
else { else {
f = 0; f = 0;
fstep = 320 * 0x10000 / vid.conwidth; fstep = 320 * 0x10000 / vid.conwidth;
for (x = 0; x < vid.conwidth; x += 4) { for (x = 0; x < (int) vid.conwidth; x += 4) {
dest[x] = src[f >> 16]; dest[x] = src[f >> 16];
f += fstep; f += fstep;
dest[x + 1] = src[f >> 16]; dest[x + 1] = src[f >> 16];
@ -678,7 +678,7 @@ Draw_ConsoleBackground (int lines)
src = conback->data + v * 320; src = conback->data + v * 320;
f = 0; f = 0;
fstep = 320 * 0x10000 / vid.conwidth; fstep = 320 * 0x10000 / vid.conwidth;
for (x = 0; x < vid.conwidth; x += 4) { for (x = 0; x < (int) vid.conwidth; x += 4) {
dest[x] = d_8to16table[src[f >> 16]]; dest[x] = d_8to16table[src[f >> 16]];
f += fstep; f += fstep;
dest[x + 1] = d_8to16table[src[f >> 16]]; dest[x + 1] = d_8to16table[src[f >> 16]];
@ -699,7 +699,7 @@ Draw_ConsoleBackground (int lines)
src = conback->data + v * 320; src = conback->data + v * 320;
f = 0; f = 0;
fstep = 320 * 0x10000 / vid.conwidth; fstep = 320 * 0x10000 / vid.conwidth;
for (x = 0; x < vid.conwidth; x += 4) { for (x = 0; x < (int) vid.conwidth; x += 4) {
dest[x ] = d_8to24table[src[f >> 16]];f += fstep; dest[x ] = d_8to24table[src[f >> 16]];f += fstep;
dest[x + 1] = d_8to24table[src[f >> 16]];f += fstep; dest[x + 1] = d_8to24table[src[f >> 16]];f += fstep;
dest[x + 2] = d_8to24table[src[f >> 16]];f += fstep; dest[x + 2] = d_8to24table[src[f >> 16]];f += fstep;
@ -1073,7 +1073,8 @@ Draw_Fill (int x, int y, int w, int h, int c)
{ {
int u, v; int u, v;
if (x < 0 || x + w > vid.width || y < 0 || y + h > vid.height) { if (x < 0 || x + w > (int) vid.width
|| y < 0 || y + h > (int) vid.height) {
Con_Printf ("Bad Draw_Fill(%d, %d, %d, %d, %c)\n", x, y, w, h, c); Con_Printf ("Bad Draw_Fill(%d, %d, %d, %d, %c)\n", x, y, w, h, c);
return; return;
} }
@ -1116,7 +1117,7 @@ Draw_Fill (int x, int y, int w, int h, int c)
void void
Draw_FadeScreen (void) Draw_FadeScreen (void)
{ {
int x, y; unsigned int x, y;
VID_UnlockBuffer (); VID_UnlockBuffer ();
S_ExtraUpdate (); S_ExtraUpdate ();
@ -1126,7 +1127,7 @@ Draw_FadeScreen (void)
case 1: case 1:
{ {
for (y = 0; y < vid.height; y++) { for (y = 0; y < vid.height; y++) {
int t; unsigned int t;
byte *pbuf = (byte *) ((byte *) vid.buffer + vid.rowbytes * y); byte *pbuf = (byte *) ((byte *) vid.buffer + vid.rowbytes * y);
t = (y & 1) << 1; t = (y & 1) << 1;

View file

@ -171,7 +171,7 @@ SCR_ApplyBlend (void) // Used to be V_UpdatePalette
break; break;
case 2: case 2:
{ {
int g1, g2, x, y; unsigned int g1, g2, x, y;
unsigned short rramp[32], gramp[64], bramp[32], *temp; unsigned short rramp[32], gramp[64], bramp[32], *temp;
for (i = 0; i < 32; i++) { for (i = 0; i < 32; i++) {
r = i << 3; r = i << 3;
@ -198,7 +198,7 @@ SCR_ApplyBlend (void) // Used to be V_UpdatePalette
break; break;
case 4: case 4:
{ {
int x, y; unsigned int x, y;
byte ramp[256][4], *temp; byte ramp[256][4], *temp;
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
r = i; r = i;

View file

@ -393,7 +393,7 @@ R_RenderFace (msurface_t *fa, int clipflags)
if (!insubmodel) { if (!insubmodel) {
if (r_pedge->cachededgeoffset & FULLY_CLIPPED_CACHED) { if (r_pedge->cachededgeoffset & FULLY_CLIPPED_CACHED) {
if ((r_pedge->cachededgeoffset & FRAMECOUNT_MASK) == if ((r_pedge->cachededgeoffset & FRAMECOUNT_MASK) ==
r_framecount) { (unsigned int) r_framecount) {
r_lastvertvalid = false; r_lastvertvalid = false;
continue; continue;
} }
@ -428,7 +428,7 @@ R_RenderFace (msurface_t *fa, int clipflags)
if (!insubmodel) { if (!insubmodel) {
if (r_pedge->cachededgeoffset & FULLY_CLIPPED_CACHED) { if (r_pedge->cachededgeoffset & FULLY_CLIPPED_CACHED) {
if ((r_pedge->cachededgeoffset & FRAMECOUNT_MASK) == if ((r_pedge->cachededgeoffset & FRAMECOUNT_MASK) ==
r_framecount) { (unsigned int) r_framecount) {
r_lastvertvalid = false; r_lastvertvalid = false;
continue; continue;
} }

View file

@ -502,7 +502,7 @@ static void
R_DrawEntitiesOnList (void) R_DrawEntitiesOnList (void)
{ {
int i, j; int i, j;
int lnum; unsigned int lnum;
alight_t lighting; alight_t lighting;
// FIXME: remove and do real lighting // FIXME: remove and do real lighting
@ -573,7 +573,7 @@ R_DrawViewModel (void)
// FIXME: remove and do real lighting // FIXME: remove and do real lighting
float lightvec[3] = { -1, 0, 0 }; float lightvec[3] = { -1, 0, 0 };
int j; int j;
int lnum; unsigned int lnum;
vec3_t dist; vec3_t dist;
float add; float add;
dlight_t *dl; dlight_t *dl;
@ -683,7 +683,8 @@ R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
static void static void
R_DrawBEntitiesOnList (void) R_DrawBEntitiesOnList (void)
{ {
int i, j, k, clipflags; int i, j, clipflags;
unsigned int k;
vec3_t oldorigin; vec3_t oldorigin;
model_t *clmodel; model_t *clmodel;
float minmaxs[6]; float minmaxs[6];

View file

@ -272,8 +272,8 @@ R_SetupFrame (void)
if ((r_dowarp != r_dowarpold) || r_viewchanged) { if ((r_dowarp != r_dowarpold) || r_viewchanged) {
if (r_dowarp) { if (r_dowarp) {
if ((vid.width <= vid.maxwarpwidth) && if ((vid.width <= (unsigned int) vid.maxwarpwidth) &&
(vid.height <= vid.maxwarpheight)) { (vid.height <= (unsigned int) vid.maxwarpheight)) {
vrect.x = 0; vrect.x = 0;
vrect.y = 0; vrect.y = 0;
vrect.width = vid.width; vrect.width = vid.width;

View file

@ -57,7 +57,7 @@ R_InitParticles (void)
void void
R_ClearParticles (void) R_ClearParticles (void)
{ {
int i; unsigned int i;
free_particles = &particles[0]; free_particles = &particles[0];
active_particles = NULL; active_particles = NULL;

View file

@ -80,7 +80,7 @@ static void
R_AddDynamicLights (void) R_AddDynamicLights (void)
{ {
msurface_t *surf; msurface_t *surf;
int lnum; unsigned int lnum;
int sd, td; int sd, td;
float dist, rad, minlight; float dist, rad, minlight;
vec3_t impact, local, lightorigin; vec3_t impact, local, lightorigin;

View file

@ -655,7 +655,7 @@ DisplayVModeInfo (struct VideoMode *vmode)
static void static void
DisplayFBInfo (struct fb_fix_screeninfo *fix) DisplayFBInfo (struct fb_fix_screeninfo *fix)
{ {
int i; size_t i;
puts("Frame buffer device information:"); puts("Frame buffer device information:");
printf(" Name : %s\n", fix->id); printf(" Name : %s\n", fix->id);

View file

@ -23,6 +23,23 @@
#include "fbset.h" #include "fbset.h"
#include "fbset_modes_y.h" #include "fbset_modes_y.h"
#ifndef YY_PROTO
# define YY_PROTO(x) x
#else
# define YY_FLEX_REALLOC_HACK
#endif
int yyget_lineno (void);
FILE *yyget_in (void);
FILE *yyget_out (void);
int yyget_leng (void);
char *yyget_text (void);
void yyset_lineno (int line_number);
void yyset_in (FILE * in_str);
void yyset_out (FILE * out_str);
int yyget_debug (void);
void yyset_debug (int bdebug);
int yylex_destroy (void);
#define YY_NO_UNPUT #define YY_NO_UNPUT
#define YY_DECL int yylex YY_PROTO(( void )) #define YY_DECL int yylex YY_PROTO(( void ))
YY_DECL; YY_DECL;
@ -139,3 +156,5 @@ junk .
} }
%% %%
static __attribute__ ((unused)) void (*yyunput_hack)(int, char*) = yyunput;

View file

@ -56,7 +56,9 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "compat.h" #include "compat.h"
#include "old_keys.h" #include "old_keys.h"
static void (*const key_progs_init)(struct progs_s *) = Key_Progs_Init; #define U __attribute__ ((unused))
static U void (*const key_progs_init)(struct progs_s *) = Key_Progs_Init;
#undef U
/* key up events are sent even if in console mode */ /* key up events are sent even if in console mode */
@ -471,11 +473,11 @@ Key_StringToIMTnum (const char *str)
FIXME: handle quote special (general escape sequence?) FIXME: handle quote special (general escape sequence?)
*/ */
static const char * static const char *
Key_IMTnumToString (const int imtnum) Key_IMTnumToString (const imt_t imtnum)
{ {
imtname_t *kn; imtname_t *kn;
if (imtnum == -1) if (imtnum == (imt_t) -1)
return "<IMT NOT FOUND>"; return "<IMT NOT FOUND>";
for (kn = imtnames; kn->name; kn++) for (kn = imtnames; kn->name; kn++)
@ -518,7 +520,7 @@ Key_KeynumToString (knum_t keynum)
{ {
keyname_t *kn; keyname_t *kn;
if (keynum == -1) if (keynum == (knum_t) -1)
return "<KEY NOT FOUND>"; return "<KEY NOT FOUND>";
for (kn = keynames; kn->name; kn++) for (kn = keynames; kn->name; kn++)
@ -882,7 +884,7 @@ Key_GetBinding (imt_t imt, knum_t key)
void void
Key_SetBinding (imt_t target, knum_t keynum, const char *binding) Key_SetBinding (imt_t target, knum_t keynum, const char *binding)
{ {
if (keynum == -1) if (keynum == (knum_t) -1)
return; return;
// free old bindings // free old bindings

View file

@ -253,7 +253,7 @@ static int resolutions[][3] = {
static int static int
findres (int *width, int *height) findres (int *width, int *height)
{ {
int i; unsigned int i;
for (i = 0; i < NUM_RESOLUTIONS; i++) { for (i = 0; i < NUM_RESOLUTIONS; i++) {
if ((*width <= resolutions[i][0]) && (*height <= resolutions[i][1])) { if ((*width <= resolutions[i][0]) && (*height <= resolutions[i][1])) {
@ -322,8 +322,9 @@ VID_Init (unsigned char *palette)
qf_fxMesaMakeCurrent (fc); qf_fxMesaMakeCurrent (fc);
vid.width = vid.conwidth = min (vid.conwidth, scr_width); vid.width = vid.conwidth = min (vid.conwidth, (unsigned int) scr_width);
vid.height = vid.conheight = min (vid.conheight, scr_height); vid.height = vid.conheight = min (vid.conheight,
(unsigned int) scr_height);
vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0); vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0);
vid.numpages = 2; vid.numpages = 2;

View file

@ -186,7 +186,7 @@ VID_InitModes (void)
} }
static const char * static const char *
get_mode (int width, int height, int depth) get_mode (unsigned int width, unsigned int height, unsigned int depth)
{ {
struct VideoMode *vmode; struct VideoMode *vmode;

View file

@ -238,8 +238,9 @@ VID_Init (unsigned char *palette)
qfglXMakeCurrent (x_disp, x_win, ctx); qfglXMakeCurrent (x_disp, x_win, ctx);
vid.height = vid.conheight = min (vid.conheight, scr_height); vid.height = vid.conheight = min (vid.conheight,
vid.width = vid.conwidth = min (vid.conwidth, scr_width); (unsigned int) scr_height);
vid.width = vid.conwidth = min (vid.conwidth, (unsigned int) scr_width);
vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0); vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0);
vid.numpages = 2; vid.numpages = 2;

View file

@ -176,8 +176,9 @@ VID_Init (unsigned char *palette)
SDL_Quit (); SDL_Quit ();
success: success:
vid.height = vid.conheight = min (vid.conheight, scr_height); vid.height = vid.conheight = min (vid.conheight,
vid.width = vid.conwidth = min (vid.conwidth, scr_width); (unsigned int) scr_height);
vid.width = vid.conwidth = min (vid.conwidth, (unsigned int) scr_width);
Con_CheckResize (); // Now that we have a window size, fix console Con_CheckResize (); // Now that we have a window size, fix console
vid.aspect = ((float) vid.height / (float) vid.width) * (4.0 / 3.0); vid.aspect = ((float) vid.height / (float) vid.width) * (4.0 / 3.0);

View file

@ -89,28 +89,6 @@ model_t *cl_mod_bolt2;
model_t *cl_mod_bolt3; model_t *cl_mod_bolt3;
model_t *cl_spr_explod; model_t *cl_spr_explod;
static const particle_effect_t prot_to_rend[]={
PE_SPIKE, // TE_SPIKE
PE_SUPERSPIKE, // TE_SUPERSPIKE
PE_GUNSHOT, // TE_GUNSHOT
PE_UNKNOWN, // TE_EXPLOSION
PE_UNKNOWN, // TE_TAREXPLOSION
PE_UNKNOWN, // TE_LIGHTNING1
PE_UNKNOWN, // TE_LIGHTNING2
PE_WIZSPIKE, // TE_WIZSPIKE
PE_KNIGHTSPIKE, // TE_KNIGHTSPIKE
PE_UNKNOWN, // TE_LIGHTNING3
PE_UNKNOWN, // TE_LAVASPLASH
PE_UNKNOWN, // TE_TELEPORT
PE_BLOOD, // TE_BLOOD
PE_LIGHTNINGBLOOD, // TE_LIGHTNINGBLOOD
PE_UNKNOWN, // TE_IMPLOSION
PE_UNKNOWN, // TE_RAILTRAIL
PE_UNKNOWN, // TE_EXPLOSION2
PE_UNKNOWN, // TE_BEAM
};
void void
CL_TEnts_Init (void) CL_TEnts_Init (void)
{ {

View file

@ -62,7 +62,9 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "sv_progs.h" #include "sv_progs.h"
#include "view.h" #include "view.h"
static location_t * (* const _locs_find) (const vec3_t target) = locs_find; #define U __attribute__ ((unused))
static U location_t * (* const _locs_find) (const vec3_t target) = locs_find;
#undef U
/* /*

View file

@ -511,7 +511,8 @@ Host_Loadgame_f (void)
float time, tfloat; float time, tfloat;
char str[32768]; char str[32768];
const char *start; const char *start;
int i, r; unsigned int i;
int r;
edict_t *ent; edict_t *ent;
int entnum; int entnum;
int version; int version;
@ -725,7 +726,7 @@ Host_Say (qboolean teamonly)
snprintf (text, sizeof (text), "%c<%s> ", 1, hostname->string); snprintf (text, sizeof (text), "%c<%s> ", 1, hostname->string);
j = sizeof (text) - 2 - strlen (text); // -2 for /n and null terminator j = sizeof (text) - 2 - strlen (text); // -2 for /n and null terminator
if (strlen (p) > j) if ((int) strlen (p) > j)
p[j] = 0; p[j] = 0;
strcat (text, p); strcat (text, p);
@ -787,7 +788,7 @@ Host_Tell_f (void)
} }
// check length & truncate if necessary // check length & truncate if necessary
j = sizeof (text) - 2 - strlen (text); // -2 for /n and null terminator j = sizeof (text) - 2 - strlen (text); // -2 for /n and null terminator
if (strlen (p) > j) if ((int) strlen (p) > j)
p[j] = 0; p[j] = 0;
strcat (text, p); strcat (text, p);

View file

@ -1002,7 +1002,7 @@ Sbar_MiniDeathmatchOverlay (void)
i = max (i, 0); i = max (i, 0);
x = 324; x = 324;
for (; i < scoreboardlines && y < vid.height - 8; i++) { for (; i < scoreboardlines && y < (int) vid.height - 8; i++) {
k = fragsort[i]; k = fragsort[i];
s = &cl.scores[k]; s = &cl.scores[k];
if (!s->name[0]) if (!s->name[0])

View file

@ -36,4 +36,4 @@ static __attribute__ ((unused)) const char rcsid[] =
extern int noconinput; extern int noconinput;
static int *const _noconinput = &noconinput; static __attribute__ ((unused)) int *const _noconinput = &noconinput;

View file

@ -512,7 +512,8 @@ CL_Record (const char *argv1)
char timestring[20]; char timestring[20];
char mapname[MAX_OSPATH]; char mapname[MAX_OSPATH];
int n, i, j, k, l=0; int n, i, j, l=0;
size_t k;
int seq = 1; int seq = 1;
entity_t *ent; entity_t *ent;
entity_state_t *es, blankes; entity_state_t *es, blankes;

View file

@ -78,7 +78,7 @@ entity_t cl_packet_ents[512]; // FIXME: magic number
void void
CL_ClearEnts () CL_ClearEnts ()
{ {
int i; unsigned int i;
for (i = 0; i < sizeof (cl_packet_ents) / sizeof (cl_packet_ents[0]); i++) for (i = 0; i < sizeof (cl_packet_ents) / sizeof (cl_packet_ents[0]); i++)
CL_Init_Entity (&cl_packet_ents[i]); CL_Init_Entity (&cl_packet_ents[i]);

View file

@ -906,7 +906,7 @@ CL_ConnectionlessPacket (void)
len--; len--;
if (!allowremotecmd && (!*localid->string || if (!allowremotecmd && (!*localid->string ||
strlen (localid->string) > len || (int) strlen (localid->string) > len ||
strncmp (localid->string, s, len))) { strncmp (localid->string, s, len))) {
if (!*localid->string) { if (!*localid->string) {
Con_Printf ("===========================\n"); Con_Printf ("===========================\n");

View file

@ -455,7 +455,7 @@ SL_Update (server_entry_t *sldata)
static void static void
SL_Con_Details (server_entry_t *sldata, int slitemno) SL_Con_Details (server_entry_t *sldata, int slitemno)
{ {
int i, playercount; unsigned int i, playercount;
server_entry_t *cp; server_entry_t *cp;
playercount = 0; playercount = 0;
@ -576,7 +576,7 @@ SL_Command (void)
void void
MSL_ParseServerList (const char *msl_data) MSL_ParseServerList (const char *msl_data)
{ {
int msl_ptr; unsigned int msl_ptr;
for (msl_ptr = 0; msl_ptr < strlen (msl_data); msl_ptr = msl_ptr + 6) { for (msl_ptr = 0; msl_ptr < strlen (msl_data); msl_ptr = msl_ptr + 6) {
slist = SL_Add (slist, va ("%i.%i.%i.%i:%i", slist = SL_Add (slist, va ("%i.%i.%i.%i:%i",
@ -669,7 +669,7 @@ SL_CheckStatus (const char *cs_from, const char *cs_data)
for (temp = slist; temp; temp = temp->next) for (temp = slist; temp; temp = temp->next)
if (temp->waitstatus) { if (temp->waitstatus) {
if (strcmp (cs_from, temp->server) == 0) { if (strcmp (cs_from, temp->server) == 0) {
int i; unsigned int i;
char *data = strdup (cs_data); char *data = strdup (cs_data);
strcpy (data, cs_data); strcpy (data, cs_data);

View file

@ -92,28 +92,6 @@ model_t *cl_mod_bolt2;
model_t *cl_mod_bolt3; model_t *cl_mod_bolt3;
model_t *cl_spr_explod; model_t *cl_spr_explod;
static const particle_effect_t prot_to_rend[]={
PE_SPIKE, // TE_SPIKE
PE_SUPERSPIKE, // TE_SUPERSPIKE
PE_GUNSHOT, // TE_GUNSHOT
PE_UNKNOWN, // TE_EXPLOSION
PE_UNKNOWN, // TE_TAREXPLOSION
PE_UNKNOWN, // TE_LIGHTNING1
PE_UNKNOWN, // TE_LIGHTNING2
PE_WIZSPIKE, // TE_WIZSPIKE
PE_KNIGHTSPIKE, // TE_KNIGHTSPIKE
PE_UNKNOWN, // TE_LIGHTNING3
PE_UNKNOWN, // TE_LAVASPLASH
PE_UNKNOWN, // TE_TELEPORT
PE_BLOOD, // TE_BLOOD
PE_LIGHTNINGBLOOD, // TE_LIGHTNINGBLOOD
PE_UNKNOWN, // TE_IMPLOSION
PE_UNKNOWN, // TE_RAILTRAIL
PE_UNKNOWN, // TE_EXPLOSION2
PE_UNKNOWN, // TE_BEAM
};
void void
CL_TEnts_Init (void) CL_TEnts_Init (void)
{ {

View file

@ -849,7 +849,7 @@ Sbar_TeamOverlay (void)
// draw the text // draw the text
l = scoreboardlines; l = scoreboardlines;
for (i = 0; i < scoreboardteams && y <= vid.height - 10; i++) { for (i = 0; i < scoreboardteams && y <= (int) vid.height - 10; i++) {
k = teamsort[i]; k = teamsort[i];
tm = teams + k; tm = teams + k;
@ -1035,7 +1035,7 @@ Sbar_Draw_DMO_Team_Ping (int l, int y, int skip)
"\x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f"); "\x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f");
y += 8; y += 8;
for (i = 0; i < l && y <= vid.height - 10; i++) { for (i = 0; i < l && y <= (int) vid.height - 10; i++) {
k = fragsort[i]; k = fragsort[i];
s = &cl.players[k]; s = &cl.players[k];
if (!s->name[0]) if (!s->name[0])
@ -1121,7 +1121,7 @@ Sbar_Draw_DMO_Team_UID (int l, int y, int skip)
"\x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f"); "\x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f");
y += 8; y += 8;
for (i = 0; i < l && y <= vid.height - 10; i++) { for (i = 0; i < l && y <= (int) vid.height - 10; i++) {
k = fragsort[i]; k = fragsort[i];
s = &cl.players[k]; s = &cl.players[k];
if (!s->name[0]) if (!s->name[0])
@ -1206,7 +1206,7 @@ Sbar_Draw_DMO_Team_Ping_UID (int l, int y, int skip)
"\x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f"); "\x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f");
y += 8; y += 8;
for (i = 0; i < l && y <= vid.height - 10; i++) { for (i = 0; i < l && y <= (int) vid.height - 10; i++) {
k = fragsort[i]; k = fragsort[i];
s = &cl.players[k]; s = &cl.players[k];
if (!s->name[0]) if (!s->name[0])
@ -1299,7 +1299,7 @@ Sbar_Draw_DMO_Ping (int l, int y, int skip)
"\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f"); "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f");
y += 8; y += 8;
for (i = 0; i < l && y <= vid.height - 10; i++) { for (i = 0; i < l && y <= (int) vid.height - 10; i++) {
k = fragsort[i]; k = fragsort[i];
s = &cl.players[k]; s = &cl.players[k];
if (!s->name[0]) if (!s->name[0])
@ -1384,7 +1384,7 @@ Sbar_Draw_DMO_UID (int l, int y, int skip)
"\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f"); "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f");
y += 8; y += 8;
for (i = 0; i < l && y <= vid.height - 10; i++) { for (i = 0; i < l && y <= (int) vid.height - 10; i++) {
k = fragsort[i]; k = fragsort[i];
s = &cl.players[k]; s = &cl.players[k];
if (!s->name[0]) if (!s->name[0])
@ -1473,7 +1473,7 @@ Sbar_Draw_DMO_Ping_UID (int l, int y, int skip)
"\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f"); "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f");
y += 8; y += 8;
for (i = 0; i < l && y <= vid.height - 10; i++) { for (i = 0; i < l && y <= (int) vid.height - 10; i++) {
k = fragsort[i]; k = fragsort[i];
s = &cl.players[k]; s = &cl.players[k];
if (!s->name[0]) if (!s->name[0])
@ -1618,7 +1618,7 @@ Sbar_DeathmatchOverlay (int start)
Sbar_Draw_DMO_func (l, y, skip); // func ptr, avoids absurd if testing Sbar_Draw_DMO_func (l, y, skip); // func ptr, avoids absurd if testing
if (y >= vid.height - 10) // we ran over the screen size, squish if (y >= (int) vid.height - 10) // we ran over the screen size, squish
largegame = true; largegame = true;
} }
@ -1653,7 +1653,7 @@ Sbar_MiniDeathmatchOverlay (void)
return; // no one there? return; // no one there?
// draw the text // draw the text
y = vid.height - sb_lines - 1; y = (int) vid.height - sb_lines - 1;
numlines = sb_lines / 8; numlines = sb_lines / 8;
if (numlines < 3) if (numlines < 3)
return; // not enough room return; // not enough room
@ -1676,7 +1676,7 @@ Sbar_MiniDeathmatchOverlay (void)
x = 324; x = 324;
for (; i < scoreboardlines && y < vid.height - 8 + 1; i++) { for (; i < scoreboardlines && y < (int) vid.height - 8 + 1; i++) {
k = fragsort[i]; k = fragsort[i];
s = &cl.players[k]; s = &cl.players[k];
if (!s->name[0]) if (!s->name[0])
@ -1717,13 +1717,13 @@ Sbar_MiniDeathmatchOverlay (void)
// draw separator // draw separator
x += 208; x += 208;
if (cl_sbar_separator->int_val) if (cl_sbar_separator->int_val)
for (y = vid.height - sb_lines; y < vid.height - 6; y += 2) for (y = vid.height - sb_lines; y < (int) vid.height - 6; y += 2)
Draw_Character (x, y, 14); Draw_Character (x, y, 14);
x += 16; x += 16;
y = vid.height - sb_lines; y = vid.height - sb_lines;
for (i = 0; i < scoreboardteams && y <= vid.height; i++) { for (i = 0; i < scoreboardteams && y <= (int) vid.height; i++) {
k = teamsort[i]; k = teamsort[i];
tm = teams + k; tm = teams + k;

View file

@ -36,4 +36,4 @@ static __attribute__ ((unused)) const char rcsid[] =
extern int noconinput; extern int noconinput;
static int *const _noconinput = &noconinput; static __attribute__ ((unused)) int *const _noconinput = &noconinput;

View file

@ -852,7 +852,7 @@ Cvar_Info (cvar_t *var)
if (!sv_highchars || !sv_highchars->int_val) { if (!sv_highchars || !sv_highchars->int_val) {
for (p = info, c = var->string; for (p = info, c = var->string;
*c && (p - info < sizeof (info) - 1);) { *c && (p - info < (int) sizeof (info) - 1);) {
if ((*c & 0x7f) >= 32) if ((*c & 0x7f) >= 32)
*p++ = *c & 0x7f; *p++ = *c & 0x7f;
c++; c++;

View file

@ -1260,7 +1260,7 @@ SV_StringToFilter (const char *address, ipfilter_t *f)
byte b[4] = {}; byte b[4] = {};
#endif #endif
int mask = 0; int mask = 0;
int i; unsigned int i;
char *s; char *s;
char *slash; char *slash;
char *c; char *c;

View file

@ -271,8 +271,8 @@ static void
SV_PreSpawn_f (ucmd_t *cmd) SV_PreSpawn_f (ucmd_t *cmd)
{ {
char *command; char *command;
int size; int buf, size;
unsigned int buf, check; unsigned int check;
sizebuf_t *msg; sizebuf_t *msg;
if (host_client->state != cs_connected) { if (host_client->state != cs_connected) {
@ -1247,7 +1247,7 @@ SV_AddUserCommand (progs_t *pr)
void void
SV_SetupUserCommands (void) SV_SetupUserCommands (void)
{ {
int i; size_t i;
Hash_FlushTable (ucmd_table); Hash_FlushTable (ucmd_table);
for (i = 0; i < sizeof (ucmds) / sizeof (ucmds[0]); i++) for (i = 0; i < sizeof (ucmds) / sizeof (ucmds[0]); i++)

View file

@ -128,7 +128,7 @@ Team_ParseSay (const char *s)
char chr, t2[128], t3[128]; char chr, t2[128], t3[128];
const char *t1; const char *t1;
static char buf[1024]; static char buf[1024];
int i, bracket; size_t i, bracket;
static location_t *location = NULL; static location_t *location = NULL;
if (!cl_parsesay->int_val) if (!cl_parsesay->int_val)
@ -464,7 +464,7 @@ void
Team_ParseChat (const char *string) Team_ParseChat (const char *string)
{ {
char *s; char *s;
int i; unsigned int i;
if (!cl_freply->value) if (!cl_freply->value)
return; return;
@ -491,7 +491,7 @@ Team_ParseChat (const char *string)
void void
Team_ResetTimers (void) Team_ResetTimers (void)
{ {
int i; unsigned int i;
for (i = 0; i < sizeof (f_replies) / sizeof (f_replies[0]); i++) for (i = 0; i < sizeof (f_replies) / sizeof (f_replies[0]); i++)
f_replies[i].lasttime = realtime - cl_freply->value; f_replies[i].lasttime = realtime - cl_freply->value;

Some files were not shown because too many files have changed in this diff Show more