Bug 5094 - Code cleanup, patch by Zack Middleton and DevHC. Fixes unused-but-set gcc warnings
This commit is contained in:
parent
1ea7ab1f42
commit
23f6fd1633
85 changed files with 246 additions and 496 deletions
|
@ -827,7 +827,6 @@ or bursted delayed packets.
|
|||
#define RESET_TIME 500
|
||||
|
||||
void CL_AdjustTimeDelta( void ) {
|
||||
int resetTime;
|
||||
int newDelta;
|
||||
int deltaDelta;
|
||||
|
||||
|
@ -838,13 +837,6 @@ void CL_AdjustTimeDelta( void ) {
|
|||
return;
|
||||
}
|
||||
|
||||
// if the current time is WAY off, just correct to the current value
|
||||
if ( com_sv_running->integer ) {
|
||||
resetTime = 100;
|
||||
} else {
|
||||
resetTime = RESET_TIME;
|
||||
}
|
||||
|
||||
newDelta = cl.snap.serverTime - cls.realtime;
|
||||
deltaDelta = abs( newDelta - cl.serverTimeDelta );
|
||||
|
||||
|
|
|
@ -937,10 +937,6 @@ static void setupQuad( long xOff, long yOff )
|
|||
cin.oldysize = cinTable[currentHandle].ysize;
|
||||
cin.oldxsize = cinTable[currentHandle].xsize;
|
||||
|
||||
numQuadCels = (cinTable[currentHandle].CIN_WIDTH*cinTable[currentHandle].CIN_HEIGHT) / (16);
|
||||
numQuadCels += numQuadCels/4 + numQuadCels/16;
|
||||
numQuadCels += 64; // for overflow
|
||||
|
||||
numQuadCels = (cinTable[currentHandle].xsize*cinTable[currentHandle].ysize) / (16);
|
||||
numQuadCels += numQuadCels/4;
|
||||
numQuadCels += 64; // for overflow
|
||||
|
@ -1610,7 +1606,6 @@ void CIN_DrawCinematic (int handle) {
|
|||
|
||||
void CL_PlayCinematic_f(void) {
|
||||
char *arg, *s;
|
||||
qboolean holdatend;
|
||||
int bits = CIN_system;
|
||||
|
||||
Com_DPrintf("CL_PlayCinematic_f\n");
|
||||
|
@ -1621,7 +1616,6 @@ void CL_PlayCinematic_f(void) {
|
|||
arg = Cmd_Argv( 1 );
|
||||
s = Cmd_Argv(2);
|
||||
|
||||
holdatend = qfalse;
|
||||
if ((s && s[0] == '1') || Q_stricmp(arg,"demoend.roq")==0 || Q_stricmp(arg,"end.roq")==0) {
|
||||
bits |= CIN_hold;
|
||||
}
|
||||
|
|
|
@ -279,10 +279,6 @@ void IN_CenterView (void) {
|
|||
|
||||
//==========================================================================
|
||||
|
||||
cvar_t *cl_upspeed;
|
||||
cvar_t *cl_forwardspeed;
|
||||
cvar_t *cl_sidespeed;
|
||||
|
||||
cvar_t *cl_yawspeed;
|
||||
cvar_t *cl_pitchspeed;
|
||||
|
||||
|
@ -399,13 +395,9 @@ CL_JoystickMove
|
|||
=================
|
||||
*/
|
||||
void CL_JoystickMove( usercmd_t *cmd ) {
|
||||
int movespeed;
|
||||
float anglespeed;
|
||||
|
||||
if ( in_speed.active ^ cl_run->integer ) {
|
||||
movespeed = 2;
|
||||
} else {
|
||||
movespeed = 1;
|
||||
if ( !(in_speed.active ^ cl_run->integer) ) {
|
||||
cmd->buttons |= BUTTON_WALKING;
|
||||
}
|
||||
|
||||
|
@ -617,10 +609,10 @@ usercmd_t CL_CreateCmd( void ) {
|
|||
// draw debug graphs of turning for mouse testing
|
||||
if ( cl_debugMove->integer ) {
|
||||
if ( cl_debugMove->integer == 1 ) {
|
||||
SCR_DebugGraph( abs(cl.viewangles[YAW] - oldAngles[YAW]), 0 );
|
||||
SCR_DebugGraph( abs(cl.viewangles[YAW] - oldAngles[YAW]) );
|
||||
}
|
||||
if ( cl_debugMove->integer == 2 ) {
|
||||
SCR_DebugGraph( abs(cl.viewangles[PITCH] - oldAngles[PITCH]), 0 );
|
||||
SCR_DebugGraph( abs(cl.viewangles[PITCH] - oldAngles[PITCH]) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -636,7 +628,6 @@ Create a new usercmd_t structure for this frame
|
|||
=================
|
||||
*/
|
||||
void CL_CreateNewCommands( void ) {
|
||||
usercmd_t *cmd;
|
||||
int cmdNum;
|
||||
|
||||
// no need to create usercmds until we have a gamestate
|
||||
|
@ -658,7 +649,6 @@ void CL_CreateNewCommands( void ) {
|
|||
cl.cmdNumber++;
|
||||
cmdNum = cl.cmdNumber & CMD_MASK;
|
||||
cl.cmds[cmdNum] = CL_CreateCmd ();
|
||||
cmd = &cl.cmds[cmdNum];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -440,9 +440,7 @@ void CL_CaptureVoip(void)
|
|||
// try to get more audio data from the sound card...
|
||||
|
||||
if (initialFrame) {
|
||||
float gain = cl_voipGainDuringCapture->value;
|
||||
if (gain < 0.0f) gain = 0.0f; else if (gain >= 1.0f) gain = 1.0f;
|
||||
S_MasterGain(cl_voipGainDuringCapture->value);
|
||||
S_MasterGain(Com_Clamp(0.0f, 1.0f, cl_voipGainDuringCapture->value));
|
||||
S_StartCapture();
|
||||
CL_VoipNewGeneration();
|
||||
CL_VoipParseTargets();
|
||||
|
@ -582,9 +580,8 @@ CL_ChangeReliableCommand
|
|||
======================
|
||||
*/
|
||||
void CL_ChangeReliableCommand( void ) {
|
||||
int r, index, l;
|
||||
int index, l;
|
||||
|
||||
r = clc.reliableSequence - (random() * 5);
|
||||
index = clc.reliableSequence & ( MAX_RELIABLE_COMMANDS - 1 );
|
||||
l = strlen(clc.reliableCommands[ index ]);
|
||||
if ( l >= MAX_STRING_CHARS - 1 ) {
|
||||
|
@ -3001,7 +2998,7 @@ void CL_Frame ( int msec ) {
|
|||
cls.realtime += cls.frametime;
|
||||
|
||||
if ( cl_timegraph->integer ) {
|
||||
SCR_DebugGraph ( cls.realFrametime * 0.25, 0 );
|
||||
SCR_DebugGraph ( cls.realFrametime * 0.25 );
|
||||
}
|
||||
|
||||
// see if we need to update any userinfo
|
||||
|
@ -3803,10 +3800,8 @@ CL_GetServerStatus
|
|||
===================
|
||||
*/
|
||||
serverStatus_t *CL_GetServerStatus( netadr_t from ) {
|
||||
serverStatus_t *serverStatus;
|
||||
int i, oldest, oldestTime;
|
||||
|
||||
serverStatus = NULL;
|
||||
for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) {
|
||||
if ( NET_CompareAdr( from, cl_serverStatusList[i].address ) ) {
|
||||
return &cl_serverStatusList[i];
|
||||
|
@ -4330,7 +4325,6 @@ qboolean CL_UpdateVisiblePings_f(int source) {
|
|||
if (slots < MAX_PINGREQUESTS) {
|
||||
serverInfo_t *server = NULL;
|
||||
|
||||
max = (source == AS_GLOBAL) ? MAX_GLOBAL_SERVERS : MAX_OTHER_SERVERS;
|
||||
switch (source) {
|
||||
case AS_LOCAL :
|
||||
server = &cls.localServers[0];
|
||||
|
|
|
@ -395,25 +395,18 @@ DEBUG GRAPH
|
|||
===============================================================================
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float value;
|
||||
int color;
|
||||
} graphsamp_t;
|
||||
|
||||
static int current;
|
||||
static graphsamp_t values[1024];
|
||||
static float values[1024];
|
||||
|
||||
/*
|
||||
==============
|
||||
SCR_DebugGraph
|
||||
==============
|
||||
*/
|
||||
void SCR_DebugGraph (float value, int color)
|
||||
void SCR_DebugGraph (float value)
|
||||
{
|
||||
values[current&1023].value = value;
|
||||
values[current&1023].color = color;
|
||||
current++;
|
||||
values[current] = value;
|
||||
current = (current + 1) % ARRAY_LEN(values);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -425,7 +418,6 @@ void SCR_DrawDebugGraph (void)
|
|||
{
|
||||
int a, x, y, w, i, h;
|
||||
float v;
|
||||
int color;
|
||||
|
||||
//
|
||||
// draw the graph
|
||||
|
@ -440,9 +432,8 @@ void SCR_DrawDebugGraph (void)
|
|||
|
||||
for (a=0 ; a<w ; a++)
|
||||
{
|
||||
i = (current-1-a+1024) & 1023;
|
||||
v = values[i].value;
|
||||
color = values[i].color;
|
||||
i = (ARRAY_LEN(values)+current-1-(a % ARRAY_LEN(values))) % ARRAY_LEN(values);
|
||||
v = values[i];
|
||||
v = v * cl_graphscale->integer + cl_graphshift->integer;
|
||||
|
||||
if (v < 0)
|
||||
|
|
|
@ -564,7 +564,7 @@ void CL_SaveConsoleHistory( void );
|
|||
void SCR_Init (void);
|
||||
void SCR_UpdateScreen (void);
|
||||
|
||||
void SCR_DebugGraph (float value, int color);
|
||||
void SCR_DebugGraph (float value);
|
||||
|
||||
int SCR_GetBigStringWidth( const char *str ); // returns in virtual 640x480 coordinates
|
||||
|
||||
|
|
|
@ -131,7 +131,6 @@ S_ReadRIFFHeader
|
|||
static qboolean S_ReadRIFFHeader(fileHandle_t file, snd_info_t *info)
|
||||
{
|
||||
char dump[16];
|
||||
int wav_format;
|
||||
int bits;
|
||||
int fmtlen = 0;
|
||||
|
||||
|
@ -146,7 +145,7 @@ static qboolean S_ReadRIFFHeader(fileHandle_t file, snd_info_t *info)
|
|||
}
|
||||
|
||||
// Save the parameters
|
||||
wav_format = FGetLittleShort(file);
|
||||
FGetLittleShort(file); // wav_format
|
||||
info->channels = FGetLittleShort(file);
|
||||
info->rate = FGetLittleLong(file);
|
||||
FGetLittleLong(file);
|
||||
|
|
|
@ -243,8 +243,6 @@ S_AL_BufferUnload
|
|||
*/
|
||||
static void S_AL_BufferUnload(sfxHandle_t sfx)
|
||||
{
|
||||
ALenum error;
|
||||
|
||||
if(knownSfx[sfx].filename[0] == '\0')
|
||||
return;
|
||||
|
||||
|
@ -254,7 +252,7 @@ static void S_AL_BufferUnload(sfxHandle_t sfx)
|
|||
// Delete it
|
||||
S_AL_ClearError( qfalse );
|
||||
qalDeleteBuffers(1, &knownSfx[sfx].buffer);
|
||||
if((error = qalGetError()) != AL_NO_ERROR)
|
||||
if(qalGetError() != AL_NO_ERROR)
|
||||
Com_Printf( S_COLOR_RED "ERROR: Can't delete sound buffer for %s\n",
|
||||
knownSfx[sfx].filename);
|
||||
|
||||
|
@ -673,7 +671,6 @@ qboolean S_AL_SrcInit( void )
|
|||
{
|
||||
int i;
|
||||
int limit;
|
||||
ALenum error;
|
||||
|
||||
// Clear the sources data structure
|
||||
memset(srcList, 0, sizeof(srcList));
|
||||
|
@ -692,7 +689,7 @@ qboolean S_AL_SrcInit( void )
|
|||
for(i = 0; i < limit; i++)
|
||||
{
|
||||
qalGenSources(1, &srcList[i].alSource);
|
||||
if((error = qalGetError()) != AL_NO_ERROR)
|
||||
if(qalGetError() != AL_NO_ERROR)
|
||||
break;
|
||||
srcCount++;
|
||||
}
|
||||
|
@ -2440,20 +2437,26 @@ qboolean S_AL_Init( soundInterface_t *si )
|
|||
{
|
||||
char devicenames[16384] = "";
|
||||
const char *devicelist;
|
||||
#ifdef _WIN32
|
||||
const char *defaultdevice;
|
||||
#endif
|
||||
int curlen;
|
||||
|
||||
// get all available devices + the default device name.
|
||||
if(enumeration_all_ext)
|
||||
{
|
||||
devicelist = qalcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
|
||||
#ifdef _WIN32
|
||||
defaultdevice = qalcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// We don't have ALC_ENUMERATE_ALL_EXT but normal enumeration.
|
||||
devicelist = qalcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
||||
#ifdef _WIN32
|
||||
defaultdevice = qalcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
#endif
|
||||
enumeration_ext = qtrue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue