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
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
int edit_line; // current line being edited
int history_line; // current history line
int linepos; // cursor position within the current edit line
int scroll; // beginning of displayed line
int width; // viewable widht for horizontal scrolling
size_t linepos; // cursor position within the current edit line
size_t scroll; // beginning of displayed line
size_t width; // viewable widht for horizontal scrolling
void *user_data; // eg: window pointer
void (*complete)(struct inputline_s *); // tab key pressed
void (*enter)(const char *line); // enter key pressed

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -141,11 +141,11 @@ read_samples (sfxbuffer_t *buffer, int count)
}
void
SND_StreamAdvance (sfxbuffer_t *buffer, int count)
SND_StreamAdvance (sfxbuffer_t *buffer, unsigned int count)
{
float stepscale;
int headpos, samples;
int loop_samples = 0;
unsigned int headpos, samples;
unsigned int loop_samples = 0;
sfx_t *sfx = buffer->sfx;
sfxstream_t *stream = (sfxstream_t *) sfx->data;
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
// find out how many samples the buffer currently holds
samples = buffer->head - buffer->tail;
if (samples < 0)
samples += buffer->length;
if (buffer->head < buffer->tail) {
samples = buffer->length + buffer->head - buffer->tail;
} else {
samples = buffer->head - buffer->tail;
}
// find out where head points to in the stream
headpos = buffer->pos + samples;
if (headpos >= sfx->length) {
if (sfx->loopstart == -1)
if (sfx->loopstart == (unsigned int)-1)
headpos = sfx->length;
else
headpos -= sfx->length - sfx->loopstart;
@ -170,7 +172,7 @@ SND_StreamAdvance (sfxbuffer_t *buffer, int count)
buffer->head = buffer->tail = 0;
buffer->pos += count;
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
headpos = buffer->pos = 0;
} else {
@ -183,7 +185,7 @@ SND_StreamAdvance (sfxbuffer_t *buffer, int count)
} else {
buffer->pos += count;
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
buffer->pos = 0;
buffer->head = buffer->tail = 0;
@ -204,7 +206,7 @@ SND_StreamAdvance (sfxbuffer_t *buffer, int count)
samples += buffer->length;
if (headpos + samples > sfx->length) {
if (sfx->loopstart == -1) {
if (sfx->loopstart == (unsigned int)-1) {
samples = sfx->length - headpos;
} else {
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);
sc->sfx->length = info->samples / stepscale;
if (info->loopstart != -1)
if (info->loopstart != (unsigned int)-1)
sc->sfx->loopstart = info->loopstart / stepscale;
else
sc->sfx->loopstart = -1;
sc->sfx->loopstart = (unsigned int)-1;
if (snd_loadas8bit->int_val) {
outwidth = 1;
@ -436,10 +438,10 @@ SND_ResampleStereo (sfxbuffer_t *sc, byte *data, int length)
outcount = length / stepscale;
sc->sfx->length = info->samples / stepscale;
if (info->loopstart != -1)
if (info->loopstart != (unsigned int)-1)
sc->sfx->loopstart = info->loopstart / stepscale;
else
sc->sfx->loopstart = -1;
sc->sfx->loopstart = (unsigned int)-1;
if (snd_loadas8bit->int_val) {
outwidth = 1;

View file

@ -166,9 +166,10 @@ SND_TransferPaintBuffer (int endtime)
/* CHANNEL MIXING */
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;
sfxbuffer_t *sc;
@ -251,10 +252,11 @@ SND_InitScaletable (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;
int data, i;
int data;
unsigned int i;
int *lscale, *rscale;
portable_samplepair_t *pair;
@ -277,7 +279,7 @@ snd_paint_mono_8 (int offs, channel_t *ch, void *bytes, int count)
}
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;
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
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;
portable_samplepair_t *pair;
@ -398,7 +400,7 @@ snd_paint_stereo_8 (int offs, channel_t *ch, void *bytes, int count)
}
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;
portable_samplepair_t *pair;
@ -417,7 +419,7 @@ snd_paint_stereo_16 (int offs, channel_t *ch, void *bytes, int count)
void
SND_PaintChannelFrom8 (channel_t *ch, sfxbuffer_t *sc, int count)
{
int pos;
unsigned int pos;
byte *samps;
pos = (ch->pos - sc->pos + sc->tail) % sc->length;
@ -440,7 +442,7 @@ SND_PaintChannelFrom8 (channel_t *ch, sfxbuffer_t *sc, int count)
void
SND_PaintChannelFrom16 (channel_t *ch, sfxbuffer_t *sc, int count)
{
int pos;
unsigned int pos;
short *samps;
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;
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 (sub, ch, sc->data, count - sub);
} else {
@ -463,7 +465,7 @@ SND_PaintChannelFrom16 (channel_t *ch, sfxbuffer_t *sc, int count)
void
SND_PaintChannelStereo8 (channel_t *ch, sfxbuffer_t *sc, int count)
{
int pos;
unsigned int pos;
short *samps;
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;
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 (sub, ch, sc->data, count - sub);
} else {
@ -486,7 +488,7 @@ SND_PaintChannelStereo8 (channel_t *ch, sfxbuffer_t *sc, int count)
void
SND_PaintChannelStereo16 (channel_t *ch, sfxbuffer_t *sc, int count)
{
int pos;
unsigned int pos;
int *samps;
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;
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 (sub, ch, sc->data, count - sub);
} else {

View file

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

View file

@ -186,7 +186,7 @@ SNDDMA_Init (void)
if (snd_rate->int_val) {
shm->speed = snd_rate->int_val;
} 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]))
break;
shm->speed = tryrates[i];

View file

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

View file

@ -598,7 +598,7 @@ C_KeyEvent (knum_t key, short unicode, qboolean down)
}
il = input_line;
}
Con_ProcessInputLine (il, key >= 256 ? key : unicode);
Con_ProcessInputLine (il, key >= 256 ? (int) key : unicode);
}
/* DRAWING */
@ -744,7 +744,7 @@ DrawDownload (int lines)
{
char dlbar[1024];
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)
return;

View file

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

View file

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

View file

@ -191,7 +191,7 @@ static void
C_DrawInput (inputline_t *il)
{
WINDOW *win = (WINDOW *) il->user_data;
int i;
size_t i;
const char *text;
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;
} else {
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);
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));
pr_type_t *pr_list;
unsigned int i;
int i;
if (!builtin)
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/progs.h"
static void (*const cbuf_progs_init)(progs_t *) = Cbuf_Progs_Init;
static void (*const cmd_progs_init)(progs_t *) = Cmd_Progs_Init;
static void (*const gib_progs_init)(progs_t *) = GIB_Progs_Init;
static void (*const cvar_progs_init)(progs_t *) = Cvar_Progs_Init;
static void (*const file_progs_init)(progs_t *) = File_Progs_Init;
static void (*const hash_progs_init)(progs_t *) = Hash_Progs_Init;
static void (*const inputline_progs_init)(progs_t *) = InputLine_Progs_Init;
static void (*const plist_progs_init)(progs_t *) = Plist_Progs_Init;
static void (*const qfile_progs_init)(progs_t *, int) = QFile_Progs_Init;
static void (*const qfs_progs_init)(progs_t *) = QFS_Progs_Init;
#define U __attribute__ ((unused))
static U void (*const cbuf_progs_init)(progs_t *) = Cbuf_Progs_Init;
static U void (*const cmd_progs_init)(progs_t *) = Cmd_Progs_Init;
static U void (*const gib_progs_init)(progs_t *) = GIB_Progs_Init;
static U void (*const cvar_progs_init)(progs_t *) = Cvar_Progs_Init;
static U void (*const file_progs_init)(progs_t *) = File_Progs_Init;
static U void (*const hash_progs_init)(progs_t *) = Hash_Progs_Init;
static U void (*const inputline_progs_init)(progs_t *) = InputLine_Progs_Init;
static U void (*const plist_progs_init)(progs_t *) = Plist_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
BI_Init ()

View file

@ -62,7 +62,7 @@ get_inputline (progs_t *pr, int arg, const char *func)
inputline_t *line;
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);
handle = pr->pr_globals + arg;
@ -137,7 +137,7 @@ bi_InputLine_Destroy (progs_t *pr)
inputline_t *line;
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");
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
int fmt_alternate, fmt_leadzero, fmt_leftjust, fmt_minwidth,
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;
format = P_STRING (pr, 0);

View file

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

View file

@ -108,7 +108,7 @@ const char *pr_type_name[ev_type_count] = {
void
ED_ClearEdict (progs_t *pr, edict_t *e, int val)
{
int i;
unsigned int i;
if (NUM_FOR_EDICT(pr,e)<*pr->reserved_edicts)
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)
type = def->type;
name = PR_GetString (pr, def->s_name);
if (type != (def->type & ~DEF_SAVEGLOBAL))
if (type != (etype_t) (def->type & ~DEF_SAVEGLOBAL))
oi = "?";
}
@ -359,7 +359,7 @@ void
ED_Print (progs_t *pr, edict_t *ed)
{
int l;
int i;
unsigned int i;
char *name;
int type;
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
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
@ -225,7 +225,7 @@ void
PR_ExecuteProgram (progs_t * pr, func_t fnum)
{
int exitdepth, profile, startprofile;
int pointer;
unsigned int pointer;
dfunction_t *f, *newf;
dstatement_t *st;
edict_t *ed;
@ -454,8 +454,7 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
"of bounds edict");
if (OPA.entity_var == 0 && pr->null_bad)
PR_RunError (pr, "assignment to world entity");
if (OPB.integer_var < 0
|| OPB.integer_var >= pr->progs->entityfields)
if (OPB.uinteger_var >= pr->progs->entityfields)
PR_RunError (pr, "Progs attempted to address an "
"invalid field in an edict");
}
@ -485,8 +484,7 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
|| OPA.entity_var >= pr->pr_edictareasize)
PR_RunError (pr, "Progs attempted to read an out of "
"bounds edict number");
if (OPB.integer_var < 0
|| OPB.integer_var >= pr->progs->entityfields)
if (OPB.uinteger_var >= pr->progs->entityfields)
PR_RunError (pr, "Progs attempted to read an invalid "
"field in an edict");
}
@ -499,8 +497,7 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
|| OPA.entity_var >= pr->pr_edictareasize)
PR_RunError (pr, "Progs attempted to read an out of "
"bounds edict number");
if (OPB.integer_var < 0
|| OPB.integer_var + 2 >= pr->progs->entityfields)
if (OPB.uinteger_var + 2 >= pr->progs->entityfields)
PR_RunError (pr, "Progs attempted to read an invalid "
"field in an edict");
}

View file

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

View file

@ -969,7 +969,7 @@ static struct {
void
PR_Obj_Progs_Init (progs_t *pr)
{
int i;
size_t 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);

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;
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)",
(long)(st - pr->pr_statements), op->opname);
}
@ -342,7 +342,7 @@ PR_Check_Opcodes (progs_t *pr)
if (!pr_boundscheck->int_val)
return;
for (st = pr->pr_statements;
st - pr->pr_statements < pr->progs->numstatements;
(unsigned long) (st - pr->pr_statements) < pr->progs->numstatements;
st++) {
op = PR_Opcode (st->op);
if (!op) {

View file

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

View file

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

View file

@ -81,9 +81,10 @@ free_string_ref (progs_t *pr, strref_t *sr)
static int
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;
for (i = 0; i < pr->dyn_str_size; i++) {
int d = sr - pr->dynamic_strings[i];
@ -153,7 +154,8 @@ void
PR_GarbageCollect (progs_t *pr)
{
char *str;
int i, j;
unsigned int i;
int j;
ddef_t *def;
strref_t *sr;
@ -196,9 +198,9 @@ PR_GarbageCollect (progs_t *pr)
}
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;
num = ~num % 1024;

View file

@ -117,7 +117,8 @@ EXP_FindIndexByFunc (opfunc func)
static optable_t *
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++)
if (!strncmp (str, optable[i].str, strlen (optable[i].str))
@ -134,7 +135,8 @@ EXP_FindOpByStr (const char *str)
static functable_t *
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++)
if (!strncmp (str, functable[i].str, strlen (functable[i].str))
@ -222,7 +224,7 @@ EXP_ParseString (char *str)
char buf[256];
token *chain, *new, *cur;
int i, m;
size_t i, m;
optable_t *op;
functable_t *func;

View file

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

View file

@ -81,7 +81,7 @@ GIB_Execute_Split_Var (cbuf_t * cbuf)
{
gib_var_t *var;
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;
void *m = cbuf->args->argm[cbuf->args->argc - 1];
@ -204,7 +204,7 @@ GIB_Execute (cbuf_t * cbuf)
gib_function_t *f;
unsigned int index;
gib_var_t *var;
unsigned int i;
int i;
if (!g->program)
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
`char *', to avoid warnings when a string constant is passed. But
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'. */
@ -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. */
#define GET_BUFFER_SPACE(n) \
while (b - bufp->buffer + (n) > bufp->allocated) \
while ((unsigned long)(b - bufp->buffer + (n)) > bufp->allocated) \
EXTEND_BUFFER ()
/* 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
(assuming 8-bit characters), we would otherwise go into an infinite
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));
}
@ -2361,7 +2361,7 @@ typedef struct
char *destination; \
/* Must be int, so when we don't save any registers, the arithmetic \
of 0 + -1 isn't done as unsigned. */ \
int this_reg; \
unsigned int this_reg; \
\
DEBUG_STATEMENT (failure_id++); \
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)\
{ \
DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \
int this_reg; \
unsigned int this_reg; \
const unsigned char *string_temp; \
\
assert (!FAIL_STACK_EMPTY ()); \
@ -3174,7 +3174,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
int stop;
{
/* General temporaries. */
int mcnt;
unsigned int mcnt;
unsigned char *p1;
/* 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;
/* 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];
@ -3833,7 +3833,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Want how many consecutive characters we can match in
one shot, so, if necessary, adjust the count. */
if (mcnt > dend2 - d2)
if (mcnt > (unsigned) (dend2 - d2))
mcnt = dend2 - d2;
/* Compare that many; failure if mismatch, else move
@ -4770,7 +4770,7 @@ regcomp (preg, pattern, cflags)
/* Map uppercase characters to corresponding lowercase ones. */
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
preg->translate = NULL;
@ -4890,7 +4890,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
size_t msg_size;
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
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.

View file

@ -299,6 +299,7 @@ BuildTris (void)
add_command (-(bestlen + 2));
for (j = 0; j < bestlen + 2; j++) {
int tmp;
// emit a vertex into the reorder buffer
k = bestverts[j];
add_vertex (k);
@ -311,8 +312,10 @@ BuildTris (void)
s = (s + 0.5) / pheader->mdl.skinwidth;
t = (t + 0.5) / pheader->mdl.skinheight;
add_command (*(int *) &s);
add_command (*(int *) &t);
memcpy (&tmp, &s, 4);
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);
// save 8 bit texels for the player model to remap
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");
memcpy (player_8bit_texels, pskin, skinsize);
}

View file

@ -819,7 +819,7 @@ Mod_LoadBrushModel (model_t *mod, void *buffer)
// swap all the lumps
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]);
// checksum all of the map, except for entities

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -189,7 +189,7 @@ Qopen (const char *path, const char *mode)
Qexpand_squiggle (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') {
zip = 1;
continue;
@ -248,7 +248,7 @@ Qdopen (int fd, const char *mode)
#ifdef WIN32
setmode (fd, O_BINARY);
#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') {
zip = 1;
continue;

View file

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

View file

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

View file

@ -533,7 +533,7 @@ Hunk_TempAlloc (int size)
size = (size + 15) & ~15;
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;
}
Hunk_FreeToHighMark (hunk_tempmark);

View file

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

View file

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

View file

@ -130,7 +130,8 @@ R_InitParticles (void)
if (r_maxparticles && r_init) {
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)
pVAsize = r_maxparticles * 4;
else
@ -335,9 +336,9 @@ static void
R_RunParticleEffect_QF (const vec3_t org, const vec3_t dir, int color,
int count)
{
float scale;
unsigned int i, j;
vec3_t porg;
float scale;
int i, j;
vec3_t porg;
if (numparticles >= r_maxparticles)
return;
@ -936,7 +937,7 @@ R_RunParticleEffect_ID (const vec3_t org, const vec3_t dir, int color,
int count)
{
float scale;
unsigned int i, j;
int i, j;
vec3_t porg;
if (numparticles >= r_maxparticles)
@ -1311,8 +1312,8 @@ R_DrawParticles (void)
float grav, fast_grav, minparticledist, scale,
time_125, time_25, time_40, time_55, time2, time4, time5,
time10, time15, time30, time50;
int activeparticles, maxparticle, j, k;
unsigned int vacount;
int activeparticles, maxparticle, j, vacount;
unsigned int k;
varray_t2f_c4ub_v3f_t *VA;
particle_t *part;
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)
{
float dist;
int lnum, maxdist, maxdist2, maxdist3, smax, smax_bytes, tmax,
grey;
unsigned int td, i, j, s, t;
unsigned int sdtable[18];
int maxdist, maxdist2, maxdist3, smax, smax_bytes, tmax,
grey, s, t, td;
unsigned int lnum, i, j;
int sdtable[18];
unsigned int *bl;
vec3_t impact, local;
@ -173,10 +173,10 @@ static void
R_AddDynamicLights_3 (msurface_t *surf)
{
float dist;
int lnum, maxdist, maxdist2, maxdist3, smax, smax_bytes, tmax,
red, green, blue;
unsigned int td, i, j, s, t;
unsigned int sdtable[18];
int maxdist, maxdist2, maxdist3, smax, smax_bytes, tmax,
red, green, blue, s, t, td;
unsigned int lnum, i, j;
int sdtable[18];
unsigned int *bl;
vec3_t impact, local;

View file

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

View file

@ -265,7 +265,8 @@ R_DrawBrushModel (entity_t *e)
{
float dot, radius;
float color[4];
int i, k;
int i;
unsigned int k;
model_t *model;
mplane_t *pplane;
msurface_t *psurf;
@ -527,7 +528,7 @@ R_MarkLeaves (void)
} else
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))) {
leaf = &r_worldentity.model->leafs[i + 1];
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,
snap);
w = (vid.width < width) ? vid.width : width;
h = (vid.height < height) ? vid.height : height;
w = (vid.width < (unsigned int) width) ? vid.width
: (unsigned int) width;
h = (vid.height < (unsigned int) height) ? vid.height
: (unsigned int) height;
fracw = (float) vid.width / (float) w;
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
byte *inrow;
byte pixels[512 * 256], *out;
int i, j;
unsigned int i, j;
unsigned int frac, fracstep;
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
byte *inrow;
int i, j;
unsigned int i, j;
int samples = alpha ? gl_alpha_format : gl_solid_format;
unsigned int frac, fracstep;
unsigned int pixels[512 * 256], *out;

View file

@ -68,16 +68,6 @@ void *alloca(size_t size);
/* cube face to sky texture offset conversion */
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 */
static const int faces_table[3][6] = {
{-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)]
for (sizepower = 0; (1 << sizepower) < size; sizepower++);
if (size != (1 << sizepower))
for (sizepower = 0; (unsigned int) (1 << sizepower) < size; sizepower++);
if (size != (unsigned int) (1 << sizepower))
Sys_Error("fractalnoise: size must be power of 2");
for (gridpower = 0; (1 << gridpower) < startgrid; gridpower++);
if (startgrid != (1 << gridpower))
for (gridpower = 0; (unsigned int) (1 << gridpower) < startgrid;
gridpower++);
if (startgrid != (unsigned int) (1 << gridpower))
Sys_Error("fractalnoise: grid must be power of 2");
startgrid = bound(0, startgrid, size);
@ -123,7 +124,8 @@ noise_diamondsquare (unsigned char *noise, unsigned int size,
void
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)
d = 64 / size;

View file

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

View file

@ -58,7 +58,9 @@ float r_time1;
int r_lineadj;
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_black[4] = { 0, 0, 0, 0 }; // alpha will be explicitly set

View file

@ -326,7 +326,7 @@ SCR_DrawFPS (void)
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;
Draw_String (x, y, st);
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -23,6 +23,23 @@
#include "fbset.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_DECL int yylex YY_PROTO(( void ))
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 "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 */
@ -471,11 +473,11 @@ Key_StringToIMTnum (const char *str)
FIXME: handle quote special (general escape sequence?)
*/
static const char *
Key_IMTnumToString (const int imtnum)
Key_IMTnumToString (const imt_t imtnum)
{
imtname_t *kn;
if (imtnum == -1)
if (imtnum == (imt_t) -1)
return "<IMT NOT FOUND>";
for (kn = imtnames; kn->name; kn++)
@ -518,7 +520,7 @@ Key_KeynumToString (knum_t keynum)
{
keyname_t *kn;
if (keynum == -1)
if (keynum == (knum_t) -1)
return "<KEY NOT FOUND>";
for (kn = keynames; kn->name; kn++)
@ -882,7 +884,7 @@ Key_GetBinding (imt_t imt, knum_t key)
void
Key_SetBinding (imt_t target, knum_t keynum, const char *binding)
{
if (keynum == -1)
if (keynum == (knum_t) -1)
return;
// free old bindings

View file

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

View file

@ -186,7 +186,7 @@ VID_InitModes (void)
}
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;

View file

@ -238,8 +238,9 @@ VID_Init (unsigned char *palette)
qfglXMakeCurrent (x_disp, x_win, ctx);
vid.height = vid.conheight = min (vid.conheight, scr_height);
vid.width = vid.conwidth = min (vid.conwidth, scr_width);
vid.height = vid.conheight = min (vid.conheight,
(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.numpages = 2;

View file

@ -176,8 +176,9 @@ VID_Init (unsigned char *palette)
SDL_Quit ();
success:
vid.height = vid.conheight = min (vid.conheight, scr_height);
vid.width = vid.conwidth = min (vid.conwidth, scr_width);
vid.height = vid.conheight = min (vid.conheight,
(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
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_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
CL_TEnts_Init (void)
{

View file

@ -62,7 +62,9 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "sv_progs.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;
char str[32768];
const char *start;
int i, r;
unsigned int i;
int r;
edict_t *ent;
int entnum;
int version;
@ -725,7 +726,7 @@ Host_Say (qboolean teamonly)
snprintf (text, sizeof (text), "%c<%s> ", 1, hostname->string);
j = sizeof (text) - 2 - strlen (text); // -2 for /n and null terminator
if (strlen (p) > j)
if ((int) strlen (p) > j)
p[j] = 0;
strcat (text, p);
@ -787,7 +788,7 @@ Host_Tell_f (void)
}
// check length & truncate if necessary
j = sizeof (text) - 2 - strlen (text); // -2 for /n and null terminator
if (strlen (p) > j)
if ((int) strlen (p) > j)
p[j] = 0;
strcat (text, p);

View file

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

View file

@ -36,4 +36,4 @@ static __attribute__ ((unused)) const char rcsid[] =
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 mapname[MAX_OSPATH];
int n, i, j, k, l=0;
int n, i, j, l=0;
size_t k;
int seq = 1;
entity_t *ent;
entity_state_t *es, blankes;

View file

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

View file

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

View file

@ -455,7 +455,7 @@ SL_Update (server_entry_t *sldata)
static void
SL_Con_Details (server_entry_t *sldata, int slitemno)
{
int i, playercount;
unsigned int i, playercount;
server_entry_t *cp;
playercount = 0;
@ -576,7 +576,7 @@ SL_Command (void)
void
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) {
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)
if (temp->waitstatus) {
if (strcmp (cs_from, temp->server) == 0) {
int i;
unsigned int i;
char *data = strdup (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_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
CL_TEnts_Init (void)
{

View file

@ -849,7 +849,7 @@ Sbar_TeamOverlay (void)
// draw the text
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];
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");
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];
s = &cl.players[k];
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");
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];
s = &cl.players[k];
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");
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];
s = &cl.players[k];
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");
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];
s = &cl.players[k];
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");
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];
s = &cl.players[k];
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");
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];
s = &cl.players[k];
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
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;
}
@ -1653,7 +1653,7 @@ Sbar_MiniDeathmatchOverlay (void)
return; // no one there?
// draw the text
y = vid.height - sb_lines - 1;
y = (int) vid.height - sb_lines - 1;
numlines = sb_lines / 8;
if (numlines < 3)
return; // not enough room
@ -1676,7 +1676,7 @@ Sbar_MiniDeathmatchOverlay (void)
x = 324;
for (; i < scoreboardlines && y < vid.height - 8 + 1; i++) {
for (; i < scoreboardlines && y < (int) vid.height - 8 + 1; i++) {
k = fragsort[i];
s = &cl.players[k];
if (!s->name[0])
@ -1717,13 +1717,13 @@ Sbar_MiniDeathmatchOverlay (void)
// draw separator
x += 208;
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);
x += 16;
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];
tm = teams + k;

View file

@ -36,4 +36,4 @@ static __attribute__ ((unused)) const char rcsid[] =
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) {
for (p = info, c = var->string;
*c && (p - info < sizeof (info) - 1);) {
*c && (p - info < (int) sizeof (info) - 1);) {
if ((*c & 0x7f) >= 32)
*p++ = *c & 0x7f;
c++;

View file

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

View file

@ -271,8 +271,8 @@ static void
SV_PreSpawn_f (ucmd_t *cmd)
{
char *command;
int size;
unsigned int buf, check;
int buf, size;
unsigned int check;
sizebuf_t *msg;
if (host_client->state != cs_connected) {
@ -1247,7 +1247,7 @@ SV_AddUserCommand (progs_t *pr)
void
SV_SetupUserCommands (void)
{
int i;
size_t i;
Hash_FlushTable (ucmd_table);
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];
const char *t1;
static char buf[1024];
int i, bracket;
size_t i, bracket;
static location_t *location = NULL;
if (!cl_parsesay->int_val)
@ -464,7 +464,7 @@ void
Team_ParseChat (const char *string)
{
char *s;
int i;
unsigned int i;
if (!cl_freply->value)
return;
@ -491,7 +491,7 @@ Team_ParseChat (const char *string)
void
Team_ResetTimers (void)
{
int i;
unsigned int i;
for (i = 0; i < sizeof (f_replies) / sizeof (f_replies[0]); i++)
f_replies[i].lasttime = realtime - cl_freply->value;

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