gcc 4.2 clean

This commit is contained in:
Bill Currie 2007-05-31 05:58:33 +00:00 committed by Jeff Teunissen
parent e6a5994cd0
commit ce2ba56c47
7 changed files with 20 additions and 16 deletions

View file

@ -64,7 +64,7 @@ void NET_Init (int port);
void NET_Init (int port);
void NET_Shutdown (void);
qboolean NET_GetPacket (void);
void NET_SendPacket (int length, void *data, netadr_t to);
void NET_SendPacket (int length, const void *data, netadr_t to);
qboolean NET_CompareAdr (netadr_t a, netadr_t b);
qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b);
@ -157,7 +157,7 @@ qboolean Netchan_CanPacket (netchan_t *chan);
qboolean Netchan_CanReliable (netchan_t *chan);
static inline void
Netchan_SendPacket (int length, void *data, netadr_t to)
Netchan_SendPacket (int length, const void *data, netadr_t to)
{
#if 0
if (net_packetlog->int_val)

View file

@ -126,14 +126,16 @@ SNDDMA_Init (void)
int bps = -1, stereo = -1;
unsigned int rate = 0;
snd_pcm_hw_params_t *hw;
snd_pcm_hw_params_t **_hw = &hw;
snd_pcm_sw_params_t *sw;
snd_pcm_sw_params_t **_sw = &sw;
snd_pcm_uframes_t frag_size;
if (!load_libasound ())
return false;
snd_pcm_hw_params_alloca (&hw);
snd_pcm_sw_params_alloca (&sw);
snd_pcm_hw_params_alloca (_hw);
snd_pcm_sw_params_alloca (_sw);
if (snd_device->string[0])
pcmname = snd_device->string;

View file

@ -178,29 +178,30 @@ GIB_Function_f (void)
gib_tree_t *program;
gib_function_t *func;
int i;
int argc = GIB_Argc ();
if (GIB_Argc () < 3)
if (argc < 3)
GIB_USAGE ("name [arg1 arg2 ...] program");
else {
// Is the function program already tokenized?
if (GIB_Argm (GIB_Argc()-1)->delim != '{') {
if (GIB_Argm (argc-1)->delim != '{') {
// Parse on the fly
if (!(program = GIB_Parse_Lines (GIB_Argv
(GIB_Argc()-1), 0))) {
(argc-1), 0))) {
// Error!
GIB_Error ("ParseError", "Parse error while defining function '%s'.",
GIB_Argv (1));
return;
}
} else
program = GIB_Argm (GIB_Argc()-1)->children;
func = GIB_Function_Define (GIB_Argv (1), GIB_Argv (GIB_Argc()-1), program,
program = GIB_Argm (argc-1)->children;
func = GIB_Function_Define (GIB_Argv (1), GIB_Argv (argc-1), program,
GIB_DATA (cbuf_active)->script,
GIB_DATA (cbuf_active)->globals);
llist_flush (func->arglist);
for (i = 2; i < GIB_Argc()-1; i++)
for (i = 2; i < argc-1; i++)
llist_append (func->arglist, strdup (GIB_Argv(i)));
func->minargs = GIB_Argc()-2;
func->minargs = argc-2;
}
}

View file

@ -312,7 +312,7 @@ NET_GetPacket (void)
}
void
NET_SendPacket (int length, void *data, netadr_t to)
NET_SendPacket (int length, const void *data, netadr_t to)
{
int ret;
struct sockaddr_in addr;

View file

@ -364,7 +364,7 @@ server_getchallenge (connection_t *con, server_t *sv)
{
static const char *getchallenge = "\377\377\377\377getchallenge\n";
Netchan_SendPacket (strlen (getchallenge), (void *) getchallenge, sv->adr);
Netchan_SendPacket (strlen (getchallenge), getchallenge, sv->adr);
}
static void

View file

@ -444,7 +444,7 @@ Sbar_SortTeams (void)
// find his team in the list
t[16] = 0;
strncpy (t, s->team->value, 16);
if (!t || !t[0])
if (!t[0])
continue; // not on team
for (j = 0; j < scoreboardteams; j++)
if (!strcmp (teams[j].team, t)) {

View file

@ -179,8 +179,9 @@ ExpandPath (const char *path)
{
static char full[1024];
if (!qdir)
Sys_Error ("ExpandPath called without qdir set");
//FIXME buffer overflow central
//if (!qdir)
// Sys_Error ("ExpandPath called without qdir set");
if (path[0] == '/' || path[0] == '\\' || path[1] == ':')
return path;
sprintf (full, "%s%s", qdir, path);