diff --git a/include/netchan.h b/include/netchan.h index d3e5a5e35..0237bb122 100644 --- a/include/netchan.h +++ b/include/netchan.h @@ -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) diff --git a/libs/audio/targets/snd_alsa.c b/libs/audio/targets/snd_alsa.c index d961e655a..f315e78e0 100644 --- a/libs/audio/targets/snd_alsa.c +++ b/libs/audio/targets/snd_alsa.c @@ -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; diff --git a/libs/gib/gib_builtin.c b/libs/gib/gib_builtin.c index a6fa01bf0..1bce71e4a 100644 --- a/libs/gib/gib_builtin.c +++ b/libs/gib/gib_builtin.c @@ -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; } } diff --git a/libs/net/nc/net_udp.c b/libs/net/nc/net_udp.c index 69e96c16b..ddb444a3e 100644 --- a/libs/net/nc/net_udp.c +++ b/libs/net/nc/net_udp.c @@ -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; diff --git a/qtv/source/server.c b/qtv/source/server.c index 3b06e4fc5..08683d191 100644 --- a/qtv/source/server.c +++ b/qtv/source/server.c @@ -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 diff --git a/qw/source/sbar.c b/qw/source/sbar.c index 07c27072f..293d51bcb 100644 --- a/qw/source/sbar.c +++ b/qw/source/sbar.c @@ -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)) { diff --git a/tools/qfmodelgen/source/modelgen.c b/tools/qfmodelgen/source/modelgen.c index 60558c22a..054342f1c 100644 --- a/tools/qfmodelgen/source/modelgen.c +++ b/tools/qfmodelgen/source/modelgen.c @@ -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);