summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2009-10-03 11:39:42 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:12 +0000
commitcc75aa64bbd2c7b3d63c4857fbb848bab364a26c (patch)
treeee3887ba908f8a79cdf35a89f6b01c8a8fb7ad46 /src/client
parent7148805cd7831e3c33dd0965d9034ed5844e6464 (diff)
* Merge ioq3-r1272
Diffstat (limited to 'src/client')
-rw-r--r--src/client/cl_cgame.c4
-rw-r--r--src/client/cl_curl.c11
-rw-r--r--src/client/cl_curl.h3
-rw-r--r--src/client/cl_main.c4
-rw-r--r--src/client/cl_parse.c2
-rw-r--r--src/client/snd_codec.c3
-rw-r--r--src/client/snd_codec_ogg.c16
-rw-r--r--src/client/snd_dma.c5
8 files changed, 33 insertions, 15 deletions
diff --git a/src/client/cl_cgame.c b/src/client/cl_cgame.c
index a3efd77a..0a40e6dd 100644
--- a/src/client/cl_cgame.c
+++ b/src/client/cl_cgame.c
@@ -294,9 +294,9 @@ rescan:
// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=552
// allow server to indicate why they were disconnected
if ( argc >= 2 )
- Com_Error (ERR_SERVERDISCONNECT, va( "Server Disconnected - %s", Cmd_Argv( 1 ) ) );
+ Com_Error( ERR_SERVERDISCONNECT, "Server disconnected - %s", Cmd_Argv( 1 ) );
else
- Com_Error (ERR_SERVERDISCONNECT,"Server disconnected\n");
+ Com_Error( ERR_SERVERDISCONNECT, "Server disconnected\n" );
}
if ( !strcmp( cmd, "bcs0" ) ) {
diff --git a/src/client/cl_curl.c b/src/client/cl_curl.c
index 96bd7abc..5e55d0cf 100644
--- a/src/client/cl_curl.c
+++ b/src/client/cl_curl.c
@@ -100,13 +100,22 @@ qboolean CL_cURL_Init()
return qfalse;
#else
char fn[1024];
+
Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) );
strncat(fn, "/", sizeof(fn)-strlen(fn)-1);
strncat(fn, cl_cURLLib->string, sizeof(fn)-strlen(fn)-1);
- if( (cURLLib = Sys_LoadLibrary(fn)) == 0 )
+ if((cURLLib = Sys_LoadLibrary(fn)) == 0)
{
+#ifdef ALTERNATE_CURL_LIB
+ // On some linux distributions there is no libcurl.so.3, but only libcurl.so.4. That one works too.
+ if( (cURLLib = Sys_LoadLibrary(ALTERNATE_CURL_LIB)) == 0 )
+ {
+ return qfalse;
+ }
+#else
return qfalse;
+#endif
}
#endif /* _WIN32 */
}
diff --git a/src/client/cl_curl.h b/src/client/cl_curl.h
index 08aec802..8a779c9d 100644
--- a/src/client/cl_curl.h
+++ b/src/client/cl_curl.h
@@ -34,7 +34,8 @@ extern cvar_t *cl_cURLLib;
#elif defined(MACOS_X)
#define DEFAULT_CURL_LIB "libcurl.dylib"
#else
-#define DEFAULT_CURL_LIB "libcurl.so.3"
+#define DEFAULT_CURL_LIB "libcurl.so.4"
+#define ALTERNATE_CURL_LIB "libcurl.so.3"
#endif
#ifdef USE_LOCAL_HEADERS
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index 14cb84b7..ae1044e2 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -453,7 +453,7 @@ void CL_DemoCompleted( void )
time / (float)clc.timeDemoFrames,
clc.timeDemoMaxDuration,
CL_DemoFrameDurationSDev( ) );
- Com_Printf( buffer );
+ Com_Printf( "%s", buffer );
// Write a log of all the frame durations
if( cl_timedemoLog && strlen( cl_timedemoLog->string ) > 0 )
@@ -3236,7 +3236,7 @@ void CL_GlobalServers_f( void ) {
for (i=3; i<count; i++)
buffptr += sprintf( buffptr, " %s", Cmd_Argv(i) );
- NET_OutOfBandPrint( NS_SERVER, to, command );
+ NET_OutOfBandPrint( NS_SERVER, to, "%s", command );
}
diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c
index 63b1b6e5..ef57ee3f 100644
--- a/src/client/cl_parse.c
+++ b/src/client/cl_parse.c
@@ -555,7 +555,7 @@ void CL_ParseDownload ( msg_t *msg ) {
if (clc.downloadSize < 0)
{
- Com_Error(ERR_DROP, MSG_ReadString( msg ) );
+ Com_Error( ERR_DROP, "%s", MSG_ReadString( msg ) );
return;
}
}
diff --git a/src/client/snd_codec.c b/src/client/snd_codec.c
index 1b680f87..65f17f4d 100644
--- a/src/client/snd_codec.c
+++ b/src/client/snd_codec.c
@@ -42,7 +42,10 @@ static char *S_FileExtension(const char *fni)
while(*fn != '/' && fn != fni)
{
if(*fn == '.')
+ {
eptr = fn;
+ break;
+ }
fn--;
}
diff --git a/src/client/snd_codec_ogg.c b/src/client/snd_codec_ogg.c
index 3b322b97..8730a9ed 100644
--- a/src/client/snd_codec_ogg.c
+++ b/src/client/snd_codec_ogg.c
@@ -128,7 +128,7 @@ int S_OGG_Callback_seek(void *datasource, ogg_int64_t offset, int whence)
retVal = FS_Seek(stream->file, (long) offset, FS_SEEK_SET);
// something has gone wrong, so we return here
- if(!(retVal == 0))
+ if(retVal < 0)
{
return retVal;
}
@@ -144,7 +144,7 @@ int S_OGG_Callback_seek(void *datasource, ogg_int64_t offset, int whence)
retVal = FS_Seek(stream->file, (long) offset, FS_SEEK_CUR);
// something has gone wrong, so we return here
- if(!(retVal == 0))
+ if(retVal < 0)
{
return retVal;
}
@@ -163,7 +163,7 @@ int S_OGG_Callback_seek(void *datasource, ogg_int64_t offset, int whence)
retVal = FS_Seek(stream->file, (long) stream->length + (long) offset, FS_SEEK_SET);
// something has gone wrong, so we return here
- if(!(retVal == 0))
+ if(retVal < 0)
{
return retVal;
}
@@ -198,15 +198,19 @@ int S_OGG_Callback_close(void *datasource)
// ftell() replacement
long S_OGG_Callback_tell(void *datasource)
{
+ snd_stream_t *stream;
+
// check if input is valid
if(!datasource)
{
- errno = EBADF;
+ errno = EBADF;
return -1;
}
- // we keep track of the file position in stream->pos
- return (long) (((snd_stream_t *) datasource) -> pos);
+ // snd_stream_t in the generic pointer
+ stream = (snd_stream_t *) datasource;
+
+ return (long) FS_FTell(stream->file);
}
// the callback structure
diff --git a/src/client/snd_dma.c b/src/client/snd_dma.c
index ec92da69..93d9a316 100644
--- a/src/client/snd_dma.c
+++ b/src/client/snd_dma.c
@@ -494,8 +494,8 @@ void S_Base_StartSound(vec3_t origin, int entityNum, int entchannel, sfxHandle_t
ch = s_channels;
inplay = 0;
for ( i = 0; i < MAX_CHANNELS ; i++, ch++ ) {
- if (ch[i].entnum == entityNum && ch[i].thesfx == sfx) {
- if (time - ch[i].allocTime < 50) {
+ if (ch->entnum == entityNum && ch->thesfx == sfx) {
+ if (time - ch->allocTime < 50) {
// if (Cvar_VariableValue( "cg_showmiss" )) {
// Com_Printf("double sound start\n");
// }
@@ -532,6 +532,7 @@ void S_Base_StartSound(vec3_t origin, int entityNum, int entchannel, sfxHandle_t
}
}
if (chosen == -1) {
+ ch = s_channels;
if (ch->entnum == listener_number) {
for ( i = 0 ; i < MAX_CHANNELS ; i++, ch++ ) {
if (ch->allocTime<oldest) {