r1037 - in trunk/code: client qcommon server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Jan 24 16:23:21 EST 2007
Author: thilo
Date: 2007-01-24 16:23:21 -0500 (Wed, 24 Jan 2007)
New Revision: 1037
Modified:
trunk/code/client/cl_cgame.c
trunk/code/client/cl_ui.c
trunk/code/client/qal.c
trunk/code/client/snd_dma.c
trunk/code/client/snd_openal.c
trunk/code/qcommon/vm_interpreted.c
trunk/code/qcommon/vm_x86_64.c
trunk/code/server/sv_client.c
trunk/code/server/sv_game.c
Log:
- Fix loads of format string bugs
- Fix locally looping sounds, thanks to Timbo
Modified: trunk/code/client/cl_cgame.c
===================================================================
--- trunk/code/client/cl_cgame.c 2007-01-23 10:39:49 UTC (rev 1036)
+++ trunk/code/client/cl_cgame.c 2007-01-24 21:23:21 UTC (rev 1037)
@@ -698,7 +698,7 @@
default:
assert(0); // bk010102
- Com_Error( ERR_DROP, "Bad cgame system trap: %i", args[0] );
+ Com_Error( ERR_DROP, "Bad cgame system trap: %ld", (long int) args[0] );
}
return 0;
}
Modified: trunk/code/client/cl_ui.c
===================================================================
--- trunk/code/client/cl_ui.c 2007-01-23 10:39:49 UTC (rev 1036)
+++ trunk/code/client/cl_ui.c 2007-01-24 21:23:21 UTC (rev 1037)
@@ -1109,7 +1109,7 @@
default:
- Com_Error( ERR_DROP, "Bad UI system trap: %i", args[0] );
+ Com_Error( ERR_DROP, "Bad UI system trap: %ld", (long int) args[0] );
}
Modified: trunk/code/client/qal.c
===================================================================
--- trunk/code/client/qal.c 2007-01-23 10:39:49 UTC (rev 1036)
+++ trunk/code/client/qal.c 2007-01-24 21:23:21 UTC (rev 1037)
@@ -153,7 +153,7 @@
}
else
{
- Com_DPrintf( " Loaded symbol %s (0x%08X)\n", str, rv);
+ Com_DPrintf( " Loaded symbol %s (%p)\n", str, rv);
return rv;
}
}
Modified: trunk/code/client/snd_dma.c
===================================================================
--- trunk/code/client/snd_dma.c 2007-01-23 10:39:49 UTC (rev 1036)
+++ trunk/code/client/snd_dma.c 2007-01-24 21:23:21 UTC (rev 1037)
@@ -109,7 +109,7 @@
Com_Printf("%5d samplebits\n", dma.samplebits);
Com_Printf("%5d submission_chunk\n", dma.submission_chunk);
Com_Printf("%5d speed\n", dma.speed);
- Com_Printf("0x%x dma buffer\n", dma.buffer);
+ Com_Printf("%p dma buffer\n", dma.buffer);
if ( s_backgroundStream ) {
Com_Printf("Background file: %s\n", s_backgroundLoop );
} else {
@@ -466,7 +466,7 @@
}
if ( sfxHandle < 0 || sfxHandle >= s_numSfx ) {
- Com_Printf( S_COLOR_YELLOW, "S_StartSound: handle %i out of range\n", sfxHandle );
+ Com_Printf( S_COLOR_YELLOW "S_StartSound: handle %i out of range\n", sfxHandle );
return;
}
@@ -578,7 +578,7 @@
}
if ( sfxHandle < 0 || sfxHandle >= s_numSfx ) {
- Com_Printf( S_COLOR_YELLOW, "S_StartLocalSound: handle %i out of range\n", sfxHandle );
+ Com_Printf( S_COLOR_YELLOW "S_StartLocalSound: handle %i out of range\n", sfxHandle );
return;
}
@@ -687,7 +687,7 @@
}
if ( sfxHandle < 0 || sfxHandle >= s_numSfx ) {
- Com_Printf( S_COLOR_YELLOW, "S_AddLoopingSound: handle %i out of range\n", sfxHandle );
+ Com_Printf( S_COLOR_YELLOW "S_AddLoopingSound: handle %i out of range\n", sfxHandle );
return;
}
@@ -750,7 +750,7 @@
}
if ( sfxHandle < 0 || sfxHandle >= s_numSfx ) {
- Com_Printf( S_COLOR_YELLOW, "S_AddRealLoopingSound: handle %i out of range\n", sfxHandle );
+ Com_Printf( S_COLOR_YELLOW "S_AddRealLoopingSound: handle %i out of range\n", sfxHandle );
return;
}
@@ -1115,7 +1115,7 @@
ch = s_channels;
for (i=0 ; i<MAX_CHANNELS; i++, ch++) {
if (ch->thesfx && (ch->leftvol || ch->rightvol) ) {
- Com_Printf ("%f %f %s\n", ch->leftvol, ch->rightvol, ch->thesfx->soundName);
+ Com_Printf ("%d %d %s\n", ch->leftvol, ch->rightvol, ch->thesfx->soundName);
total++;
}
}
Modified: trunk/code/client/snd_openal.c
===================================================================
--- trunk/code/client/snd_openal.c 2007-01-23 10:39:49 UTC (rev 1036)
+++ trunk/code/client/snd_openal.c 2007-01-24 21:23:21 UTC (rev 1037)
@@ -530,15 +530,13 @@
static void S_AL_ScaleGain(src_t *chksrc, vec3_t origin)
{
float distance;
-
- if(chksrc->local)
- distance = VectorLength(origin);
- else
+
+ if(!chksrc->local)
distance = Distance(origin, lastListenerOrigin);
-
+
// If we exceed a certain distance, scale the gain linearly until the sound
// vanishes into nothingness.
- if((distance -= s_alMaxDistance->value) > 0)
+ if(!chksrc->local && (distance -= s_alMaxDistance->value) > 0)
{
float scaleFactor;
Modified: trunk/code/qcommon/vm_interpreted.c
===================================================================
--- trunk/code/qcommon/vm_interpreted.c 2007-01-23 10:39:49 UTC (rev 1036)
+++ trunk/code/qcommon/vm_interpreted.c 2007-01-24 21:23:21 UTC (rev 1037)
@@ -907,7 +907,7 @@
vm->currentlyInterpreting = qfalse;
if ( opStack != &stack[1] ) {
- Com_Error( ERR_DROP, "Interpreter error: opStack = %i", opStack - stack );
+ Com_Error( ERR_DROP, "Interpreter error: opStack = %ld", (long int) (opStack - stack) );
}
vm->programStack = stackOnEntry;
Modified: trunk/code/qcommon/vm_x86_64.c
===================================================================
--- trunk/code/qcommon/vm_x86_64.c 2007-01-23 10:39:49 UTC (rev 1036)
+++ trunk/code/qcommon/vm_x86_64.c 2007-01-24 21:23:21 UTC (rev 1037)
@@ -422,7 +422,7 @@
unlink(fn_s);
unlink(fn_o);
- Com_Printf(S_COLOR_RED "can't create temporary files for vm\n", fn_s);
+ Com_Printf(S_COLOR_RED "can't create temporary file %s for vm\n", fn_s);
vm->compiled = qfalse;
return;
}
@@ -895,7 +895,7 @@
fflush(qdasmout);
#endif
- Com_Printf( "VM file %s compiled to %i bytes of code (0x%lx - 0x%lx)\n", vm->name, vm->codeLength, vm->codeBase, vm->codeBase+vm->codeLength );
+ Com_Printf( "VM file %s compiled to %i bytes of code (%p - %p)\n", vm->name, vm->codeLength, vm->codeBase, vm->codeBase+vm->codeLength );
out:
close(fd_o);
@@ -990,7 +990,7 @@
);
if ( opStack != &stack[1] ) {
- Com_Error( ERR_DROP, "opStack corrupted in compiled code (offset %d)\n", (void*)&stack[1] - opStack);
+ Com_Error( ERR_DROP, "opStack corrupted in compiled code (offset %ld)\n", (long int) ((void *) &stack[1] - opStack));
}
if ( programStack != stackOnEntry - 48 ) {
Com_Error( ERR_DROP, "programStack corrupted in compiled code\n" );
Modified: trunk/code/server/sv_client.c
===================================================================
--- trunk/code/server/sv_client.c 2007-01-23 10:39:49 UTC (rev 1036)
+++ trunk/code/server/sv_client.c 2007-01-24 21:23:21 UTC (rev 1037)
@@ -679,7 +679,7 @@
*/
void SV_StopDownload_f( client_t *cl ) {
if (*cl->downloadName)
- Com_DPrintf( "clientDownload: %d : file \"%s\" aborted\n", cl - svs.clients, cl->downloadName );
+ Com_DPrintf( "clientDownload: %d : file \"%s\" aborted\n", (int) (cl - svs.clients), cl->downloadName );
SV_CloseDownload( cl );
}
@@ -710,11 +710,11 @@
int block = atoi( Cmd_Argv(1) );
if (block == cl->downloadClientBlock) {
- Com_DPrintf( "clientDownload: %d : client acknowledge of block %d\n", cl - svs.clients, block );
+ Com_DPrintf( "clientDownload: %d : client acknowledge of block %d\n", (int) (cl - svs.clients), block );
// Find out if we are done. A zero-length block indicates EOF
if (cl->downloadBlockSize[cl->downloadClientBlock % MAX_DOWNLOAD_WINDOW] == 0) {
- Com_Printf( "clientDownload: %d : file \"%s\" completed\n", cl - svs.clients, cl->downloadName );
+ Com_Printf( "clientDownload: %d : file \"%s\" completed\n", (int) (cl - svs.clients), cl->downloadName );
SV_CloseDownload( cl );
return;
}
@@ -809,11 +809,11 @@
// cannot auto-download file
if(unreferenced)
{
- Com_Printf("clientDownload: %d : \"%s\" is not referenced and cannot be downloaded.\n", cl - svs.clients, cl->downloadName);
+ Com_Printf("clientDownload: %d : \"%s\" is not referenced and cannot be downloaded.\n", (int) (cl - svs.clients), cl->downloadName);
Com_sprintf(errorMessage, sizeof(errorMessage), "File \"%s\" is not referenced and cannot be downloaded.", cl->downloadName);
}
else if (idPack) {
- Com_Printf("clientDownload: %d : \"%s\" cannot download id pk3 files\n", cl - svs.clients, cl->downloadName);
+ Com_Printf("clientDownload: %d : \"%s\" cannot download id pk3 files\n", (int) (cl - svs.clients), cl->downloadName);
if (missionPack) {
Com_sprintf(errorMessage, sizeof(errorMessage), "Cannot autodownload Team Arena file \"%s\"\n"
"The Team Arena mission pack can be found in your local game store.", cl->downloadName);
@@ -825,7 +825,7 @@
else if ( !(sv_allowDownload->integer & DLF_ENABLE) ||
(sv_allowDownload->integer & DLF_NO_UDP) ) {
- Com_Printf("clientDownload: %d : \"%s\" download disabled", cl - svs.clients, cl->downloadName);
+ Com_Printf("clientDownload: %d : \"%s\" download disabled", (int) (cl - svs.clients), cl->downloadName);
if (sv_pure->integer) {
Com_sprintf(errorMessage, sizeof(errorMessage), "Could not download \"%s\" because autodownloading is disabled on the server.\n\n"
"You will need to get this file elsewhere before you "
@@ -839,7 +839,7 @@
} else {
// NOTE TTimo this is NOT supposed to happen unless bug in our filesystem scheme?
// if the pk3 is referenced, it must have been found somewhere in the filesystem
- Com_Printf("clientDownload: %d : \"%s\" file not found on server\n", cl - svs.clients, cl->downloadName);
+ Com_Printf("clientDownload: %d : \"%s\" file not found on server\n", (int) (cl - svs.clients), cl->downloadName);
Com_sprintf(errorMessage, sizeof(errorMessage), "File \"%s\" not found on server for autodownloading.\n", cl->downloadName);
}
MSG_WriteByte( msg, svc_download );
@@ -851,7 +851,7 @@
return;
}
- Com_Printf( "clientDownload: %d : beginning \"%s\"\n", cl - svs.clients, cl->downloadName );
+ Com_Printf( "clientDownload: %d : beginning \"%s\"\n", (int) (cl - svs.clients), cl->downloadName );
// Init
cl->downloadCurrentBlock = cl->downloadClientBlock = cl->downloadXmitBlock = 0;
@@ -960,7 +960,7 @@
MSG_WriteData( msg, cl->downloadBlocks[curindex], cl->downloadBlockSize[curindex] );
}
- Com_DPrintf( "clientDownload: %d : writing block %d\n", cl - svs.clients, cl->downloadXmitBlock );
+ Com_DPrintf( "clientDownload: %d : writing block %d\n", (int) (cl - svs.clients), cl->downloadXmitBlock );
// Move on to the next block
// It will get sent with next snap shot. The rate will keep us in line.
@@ -1580,7 +1580,7 @@
} else if ( c == clc_moveNoDelta ) {
SV_UserMove( cl, msg, qfalse );
} else if ( c != clc_EOF ) {
- Com_Printf( "WARNING: bad command byte for client %i\n", cl - svs.clients );
+ Com_Printf( "WARNING: bad command byte for client %i\n", (int) (cl - svs.clients) );
}
// if ( msg->readcount != msg->cursize ) {
// Com_Printf( "WARNING: Junk at end of packet for client %i\n", cl - svs.clients );
Modified: trunk/code/server/sv_game.c
===================================================================
--- trunk/code/server/sv_game.c 2007-01-23 10:39:49 UTC (rev 1036)
+++ trunk/code/server/sv_game.c 2007-01-24 21:23:21 UTC (rev 1037)
@@ -854,7 +854,7 @@
default:
- Com_Error( ERR_DROP, "Bad game system trap: %i", args[0] );
+ Com_Error( ERR_DROP, "Bad game system trap: %ld", (long int) args[0] );
}
return -1;
}
More information about the quake3-commits
mailing list