mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-25 22:01:33 +00:00
gcc 4.2 clean
This commit is contained in:
parent
e6a5994cd0
commit
ce2ba56c47
7 changed files with 20 additions and 16 deletions
|
@ -64,7 +64,7 @@ void NET_Init (int port);
|
||||||
void NET_Init (int port);
|
void NET_Init (int port);
|
||||||
void NET_Shutdown (void);
|
void NET_Shutdown (void);
|
||||||
qboolean NET_GetPacket (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_CompareAdr (netadr_t a, netadr_t b);
|
||||||
qboolean NET_CompareBaseAdr (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);
|
qboolean Netchan_CanReliable (netchan_t *chan);
|
||||||
|
|
||||||
static inline void
|
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 0
|
||||||
if (net_packetlog->int_val)
|
if (net_packetlog->int_val)
|
||||||
|
|
|
@ -126,14 +126,16 @@ SNDDMA_Init (void)
|
||||||
int bps = -1, stereo = -1;
|
int bps = -1, stereo = -1;
|
||||||
unsigned int rate = 0;
|
unsigned int rate = 0;
|
||||||
snd_pcm_hw_params_t *hw;
|
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;
|
||||||
|
snd_pcm_sw_params_t **_sw = &sw;
|
||||||
snd_pcm_uframes_t frag_size;
|
snd_pcm_uframes_t frag_size;
|
||||||
|
|
||||||
if (!load_libasound ())
|
if (!load_libasound ())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
snd_pcm_hw_params_alloca (&hw);
|
snd_pcm_hw_params_alloca (_hw);
|
||||||
snd_pcm_sw_params_alloca (&sw);
|
snd_pcm_sw_params_alloca (_sw);
|
||||||
|
|
||||||
if (snd_device->string[0])
|
if (snd_device->string[0])
|
||||||
pcmname = snd_device->string;
|
pcmname = snd_device->string;
|
||||||
|
|
|
@ -178,29 +178,30 @@ GIB_Function_f (void)
|
||||||
gib_tree_t *program;
|
gib_tree_t *program;
|
||||||
gib_function_t *func;
|
gib_function_t *func;
|
||||||
int i;
|
int i;
|
||||||
|
int argc = GIB_Argc ();
|
||||||
|
|
||||||
if (GIB_Argc () < 3)
|
if (argc < 3)
|
||||||
GIB_USAGE ("name [arg1 arg2 ...] program");
|
GIB_USAGE ("name [arg1 arg2 ...] program");
|
||||||
else {
|
else {
|
||||||
// Is the function program already tokenized?
|
// Is the function program already tokenized?
|
||||||
if (GIB_Argm (GIB_Argc()-1)->delim != '{') {
|
if (GIB_Argm (argc-1)->delim != '{') {
|
||||||
// Parse on the fly
|
// Parse on the fly
|
||||||
if (!(program = GIB_Parse_Lines (GIB_Argv
|
if (!(program = GIB_Parse_Lines (GIB_Argv
|
||||||
(GIB_Argc()-1), 0))) {
|
(argc-1), 0))) {
|
||||||
// Error!
|
// Error!
|
||||||
GIB_Error ("ParseError", "Parse error while defining function '%s'.",
|
GIB_Error ("ParseError", "Parse error while defining function '%s'.",
|
||||||
GIB_Argv (1));
|
GIB_Argv (1));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
program = GIB_Argm (GIB_Argc()-1)->children;
|
program = GIB_Argm (argc-1)->children;
|
||||||
func = GIB_Function_Define (GIB_Argv (1), GIB_Argv (GIB_Argc()-1), program,
|
func = GIB_Function_Define (GIB_Argv (1), GIB_Argv (argc-1), program,
|
||||||
GIB_DATA (cbuf_active)->script,
|
GIB_DATA (cbuf_active)->script,
|
||||||
GIB_DATA (cbuf_active)->globals);
|
GIB_DATA (cbuf_active)->globals);
|
||||||
llist_flush (func->arglist);
|
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)));
|
llist_append (func->arglist, strdup (GIB_Argv(i)));
|
||||||
func->minargs = GIB_Argc()-2;
|
func->minargs = argc-2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -312,7 +312,7 @@ NET_GetPacket (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NET_SendPacket (int length, void *data, netadr_t to)
|
NET_SendPacket (int length, const void *data, netadr_t to)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct sockaddr_in addr;
|
struct sockaddr_in addr;
|
||||||
|
|
|
@ -364,7 +364,7 @@ server_getchallenge (connection_t *con, server_t *sv)
|
||||||
{
|
{
|
||||||
static const char *getchallenge = "\377\377\377\377getchallenge\n";
|
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
|
static void
|
||||||
|
|
|
@ -444,7 +444,7 @@ Sbar_SortTeams (void)
|
||||||
// find his team in the list
|
// find his team in the list
|
||||||
t[16] = 0;
|
t[16] = 0;
|
||||||
strncpy (t, s->team->value, 16);
|
strncpy (t, s->team->value, 16);
|
||||||
if (!t || !t[0])
|
if (!t[0])
|
||||||
continue; // not on team
|
continue; // not on team
|
||||||
for (j = 0; j < scoreboardteams; j++)
|
for (j = 0; j < scoreboardteams; j++)
|
||||||
if (!strcmp (teams[j].team, t)) {
|
if (!strcmp (teams[j].team, t)) {
|
||||||
|
|
|
@ -179,8 +179,9 @@ ExpandPath (const char *path)
|
||||||
{
|
{
|
||||||
static char full[1024];
|
static char full[1024];
|
||||||
|
|
||||||
if (!qdir)
|
//FIXME buffer overflow central
|
||||||
Sys_Error ("ExpandPath called without qdir set");
|
//if (!qdir)
|
||||||
|
// Sys_Error ("ExpandPath called without qdir set");
|
||||||
if (path[0] == '/' || path[0] == '\\' || path[1] == ':')
|
if (path[0] == '/' || path[0] == '\\' || path[1] == ':')
|
||||||
return path;
|
return path;
|
||||||
sprintf (full, "%s%s", qdir, path);
|
sprintf (full, "%s%s", qdir, path);
|
||||||
|
|
Loading…
Reference in a new issue