Skip to content

Commit

Permalink
SDL2: fixed IN_Init() order in Vulkan backend too
Browse files Browse the repository at this point in the history
Added more 'static' qualifiers
  • Loading branch information
Eugene committed Feb 16, 2022
1 parent 6b153e6 commit 582b288
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 51 deletions.
20 changes: 9 additions & 11 deletions code/client/cl_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ cvar_t *con_scale;

int g_console_field_width;

void Con_Fixup( void );

/*
================
Con_ToggleConsole_f
Expand Down Expand Up @@ -381,8 +379,8 @@ void Con_CheckResize( void )
Cmd_CompleteTxtName
==================
*/
void Cmd_CompleteTxtName( char *args, int argNum ) {
if( argNum == 2 ) {
static void Cmd_CompleteTxtName( char *args, int argNum ) {
if ( argNum == 2 ) {
Field_CompleteFilename( "", "txt", qfalse, FS_MATCH_EXTERN | FS_MATCH_STICK );
}
}
Expand Down Expand Up @@ -437,7 +435,7 @@ void Con_Shutdown( void )
Con_Fixup
===============
*/
void Con_Fixup( void )
static void Con_Fixup( void )
{
int filled;

Expand All @@ -464,7 +462,7 @@ Con_Linefeed
Move to newline only when we _really_ need this
===============
*/
void Con_NewLine( void )
static void Con_NewLine( void )
{
short *s;
int i;
Expand All @@ -487,7 +485,7 @@ void Con_NewLine( void )
Con_Linefeed
===============
*/
void Con_Linefeed( qboolean skipnotify )
static void Con_Linefeed( qboolean skipnotify )
{
// mark time for transparent overlay
if ( con.current >= 0 ) {
Expand Down Expand Up @@ -629,7 +627,7 @@ Con_DrawInput
Draw the editline after a ] prompt
================
*/
void Con_DrawInput( void ) {
static void Con_DrawInput( void ) {
int y;

if ( cls.state != CA_DISCONNECTED && !(Key_GetCatcher( ) & KEYCATCH_CONSOLE ) ) {
Expand All @@ -654,7 +652,7 @@ Con_DrawNotify
Draws the last few lines of output transparently over the game top
================
*/
void Con_DrawNotify( void )
static void Con_DrawNotify( void )
{
int x, v;
short *text;
Expand Down Expand Up @@ -735,7 +733,7 @@ Con_DrawSolidConsole
Draws the console with the solid background
================
*/
void Con_DrawSolidConsole( float frac ) {
static void Con_DrawSolidConsole( float frac ) {

static float conColorValue[4] = { 0.0, 0.0, 0.0, 0.0 };
// for cvar value change tracking
Expand Down Expand Up @@ -902,7 +900,7 @@ void Con_DrawConsole( void ) {
} else {
// draw notify lines
if ( cls.state == CA_ACTIVE ) {
Con_DrawNotify ();
Con_DrawNotify();
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions code/client/cl_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ CL_CreateNewCommands
Create a new usercmd_t structure for this frame
=================
*/
void CL_CreateNewCommands( void ) {
static void CL_CreateNewCommands( void ) {
int cmdNum;

// no need to create usercmds until we have a gamestate
Expand Down Expand Up @@ -994,7 +994,7 @@ void CL_InitInput( void ) {

/*
============
CL_InitInput
CL_ClearInput
============
*/
void CL_ClearInput( void ) {
Expand Down
18 changes: 9 additions & 9 deletions code/client/cl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ refexport_t re;
static void *rendererLib;
#endif

ping_t cl_pinglist[MAX_PINGREQUESTS];
static ping_t cl_pinglist[MAX_PINGREQUESTS];

typedef struct serverStatus_s
{
Expand All @@ -126,7 +126,7 @@ typedef struct serverStatus_s
qboolean retrieved;
} serverStatus_t;

serverStatus_t cl_serverStatusList[MAX_SERVERSTATUSREQUESTS];
static serverStatus_t cl_serverStatusList[MAX_SERVERSTATUSREQUESTS];

static void CL_CheckForResend( void );
static void CL_ShowIP_f( void );
Expand Down Expand Up @@ -2413,11 +2413,11 @@ typedef struct hash_chain_s {
struct hash_chain_s *next;
} hash_chain_t;

hash_chain_t *hash_table[1024];
hash_chain_t hash_list[MAX_GLOBAL_SERVERS];
unsigned int hash_count = 0;
static hash_chain_t *hash_table[1024];
static hash_chain_t hash_list[MAX_GLOBAL_SERVERS];
static unsigned int hash_count = 0;

unsigned int hash_func( const netadr_t *addr ) {
static unsigned int hash_func( const netadr_t *addr ) {

const byte *ip = NULL;
unsigned int size;
Expand Down Expand Up @@ -3469,7 +3469,7 @@ static void CL_InitRef( void ) {
//===========================================================================================


void CL_SetModel_f( void ) {
static void CL_SetModel_f( void ) {
const char *arg;
char name[ MAX_CVAR_VALUE_STRING ];

Expand All @@ -3495,7 +3495,7 @@ video
video [filename]
===============
*/
void CL_Video_f( void )
static void CL_Video_f( void )
{
char filename[ MAX_OSPATH ];
const char *ext;
Expand Down Expand Up @@ -3581,7 +3581,7 @@ CL_CompleteRecordName
*/
static void CL_CompleteVideoName( char *args, int argNum )
{
if( argNum == 2 )
if ( argNum == 2 )
{
Field_CompleteFilename( "videos", ".avi", qtrue, FS_MATCH_EXTERN | FS_MATCH_STICK );
}
Expand Down
10 changes: 5 additions & 5 deletions code/client/cl_scrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ int SCR_GetBigStringWidth( const char *str ) {
SCR_DrawDemoRecording
=================
*/
void SCR_DrawDemoRecording( void ) {
static void SCR_DrawDemoRecording( void ) {
char string[sizeof(clc.recordNameShort)+32];
int pos;

Expand All @@ -386,7 +386,7 @@ void SCR_DrawDemoRecording( void ) {
SCR_DrawVoipMeter
=================
*/
void SCR_DrawVoipMeter( void ) {
static void SCR_DrawVoipMeter( void ) {
char buffer[16];
char string[256];
int limit, i;
Expand Down Expand Up @@ -436,7 +436,7 @@ static float values[1024];
SCR_DebugGraph
==============
*/
void SCR_DebugGraph (float value)
void SCR_DebugGraph( float value )
{
values[current] = value;
current = (current + 1) % ARRAY_LEN(values);
Expand All @@ -448,7 +448,7 @@ void SCR_DebugGraph (float value)
SCR_DrawDebugGraph
==============
*/
void SCR_DrawDebugGraph (void)
static void SCR_DrawDebugGraph( void )
{
int a, x, y, w, i, h;
float v;
Expand Down Expand Up @@ -514,7 +514,7 @@ SCR_DrawScreenField
This will be called twice if rendering in stereo mode
==================
*/
void SCR_DrawScreenField( stereoFrame_t stereoFrame ) {
static void SCR_DrawScreenField( stereoFrame_t stereoFrame ) {
qboolean uiFullscreen;

re.BeginFrame( stereoFrame );
Expand Down
4 changes: 2 additions & 2 deletions code/client/cl_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void GetClientState( uiClientState_t *state ) {
LAN_LoadCachedServers
====================
*/
void LAN_LoadCachedServers( void ) {
static void LAN_LoadCachedServers( void ) {
fileHandle_t fileIn;
int size, file_size;

Expand Down Expand Up @@ -84,7 +84,7 @@ void LAN_LoadCachedServers( void ) {
LAN_SaveServersToCache
====================
*/
void LAN_SaveServersToCache( void ) {
static void LAN_SaveServersToCache( void ) {
fileHandle_t fileOut;
int size;

Expand Down
3 changes: 0 additions & 3 deletions code/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ void Con_CheckResize( void );
void Con_Init( void );
void Con_Shutdown( void );
void Con_ToggleConsole_f( void );
void Con_DrawNotify( void );
void Con_ClearNotify( void );
void Con_RunConsole( void );
void Con_DrawConsole( void );
Expand Down Expand Up @@ -574,8 +573,6 @@ void CL_InitUI( void );
void CL_ShutdownUI( void );
int Key_GetCatcher( void );
void Key_SetCatcher( int catcher );
void LAN_LoadCachedServers( void );
void LAN_SaveServersToCache( void );


//
Expand Down
5 changes: 2 additions & 3 deletions code/qcommon/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ cvar_t *com_affinityMask;
static cvar_t *com_logfile; // 1 = buffer log, 2 = flush after each print
static cvar_t *com_showtrace;
cvar_t *com_version;
cvar_t *com_buildScript; // for automated data building scripts
cvar_t *com_blood;
static cvar_t *com_buildScript; // for automated data building scripts

#ifndef DEDICATED
cvar_t *com_introPlayed;
Expand Down Expand Up @@ -3669,7 +3668,7 @@ void Com_Init( char *commandLine ) {
com_affinityMask->modified = qfalse;
#endif

com_blood = Cvar_Get( "com_blood", "1", CVAR_ARCHIVE_ND );
// com_blood = Cvar_Get( "com_blood", "1", CVAR_ARCHIVE_ND );

com_logfile = Cvar_Get( "logfile", "0", CVAR_TEMP );
Cvar_CheckRange( com_logfile, "0", "4", CV_INTEGER );
Expand Down
14 changes: 7 additions & 7 deletions code/qcommon/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ static const int kbitmask[32] = {
};


void MSG_WriteDeltaKey( msg_t *msg, int key, int oldV, int newV, int bits ) {
static void MSG_WriteDeltaKey( msg_t *msg, int key, int oldV, int newV, int bits ) {
if ( oldV == newV ) {
MSG_WriteBits( msg, 0, 1 );
return;
Expand All @@ -541,7 +541,7 @@ void MSG_WriteDeltaKey( msg_t *msg, int key, int oldV, int newV, int bits ) {
}


int MSG_ReadDeltaKey( msg_t *msg, int key, int oldV, int bits ) {
static int MSG_ReadDeltaKey( msg_t *msg, int key, int oldV, int bits ) {
if ( MSG_ReadBits( msg, 1 ) ) {
return MSG_ReadBits( msg, bits ) ^ (key & kbitmask[ bits - 1 ]);
}
Expand Down Expand Up @@ -666,7 +666,7 @@ typedef struct {
// using the stringizing operator to save typing...
#define NETF(x) #x,(size_t)&((entityState_t*)0)->x

const netField_t entityStateFields[] =
static const netField_t entityStateFields[] =
{
{ NETF(pos.trTime), 32 },
{ NETF(pos.trBase[0]), 0 },
Expand Down Expand Up @@ -985,9 +985,9 @@ plyer_state_t communication
// using the stringizing operator to save typing...
#define PSF(x) #x,(size_t)&((playerState_t*)0)->x

netField_t playerStateFields[] =
static const netField_t playerStateFields[] =
{
{ PSF(commandTime), 32 },
{ PSF(commandTime), 32 },
{ PSF(origin[0]), 0 },
{ PSF(origin[1]), 0 },
{ PSF(bobCycle), 8 },
Expand Down Expand Up @@ -1051,7 +1051,7 @@ void MSG_WriteDeltaPlayerstate( msg_t *msg, const playerState_t *from, const pla
int ammobits;
int powerupbits;
int numFields;
netField_t *field;
const netField_t *field;
const int *fromF, *toF;
float fullFloat;
int trunc, lc;
Expand Down Expand Up @@ -1194,7 +1194,7 @@ MSG_ReadDeltaPlayerstate
void MSG_ReadDeltaPlayerstate( msg_t *msg, const playerState_t *from, playerState_t *to ) {
int i, lc;
int bits;
netField_t *field;
const netField_t *field;
int numFields;
int startBit, endBit;
int print;
Expand Down
2 changes: 1 addition & 1 deletion code/qcommon/net_chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ typedef struct packetQueue_s {
int release;
} packetQueue_t;

packetQueue_t *packetQueue = NULL;
static packetQueue_t *packetQueue = NULL;

static void NET_QueuePacket( int length, const void *data, const netadr_t *to, int offset )
{
Expand Down
2 changes: 0 additions & 2 deletions code/qcommon/qcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,6 @@ extern cvar_t *com_speeds;
extern cvar_t *com_timescale;
extern cvar_t *com_viewlog; // 0 = hidden, 1 = visible, 2 = minimized
extern cvar_t *com_version;
extern cvar_t *com_blood;
extern cvar_t *com_buildScript; // for building release pak files
extern cvar_t *com_journal;
extern cvar_t *com_cameraMode;
extern cvar_t *com_protocol;
Expand Down
2 changes: 1 addition & 1 deletion code/renderer/tr_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void QDECL Com_Printf( const char *fmt, ... )
/*
** R_HaveExtension
*/
qboolean R_HaveExtension( const char *ext )
static qboolean R_HaveExtension( const char *ext )
{
const char *ptr = Q_stristr( gl_extensions, ext );
if (ptr == NULL)
Expand Down
2 changes: 0 additions & 2 deletions code/renderer/tr_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -1897,8 +1897,6 @@ void RE_VertexLighting( qboolean allowed );

void R_BloomScreen( void );

qboolean R_HaveExtension( const char *ext );

#define GLE( ret, name, ... ) extern ret ( APIENTRY * q##name )( __VA_ARGS__ );
QGL_Core_PROCS;
QGL_Ext_PROCS;
Expand Down
6 changes: 3 additions & 3 deletions code/sdl/sdl_glimp.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,12 +733,12 @@ void VKimp_Init( glconfig_t *config )
config->driverType = GLDRV_ICD;
config->hardwareType = GLHW_GENERIC;

Key_ClearStates();
// This depends on SDL_INIT_VIDEO, hence having it here
IN_Init();

HandleEvents();

// This depends on SDL_INIT_VIDEO, hence having it here
IN_Init();
Key_ClearStates();
}


Expand Down

0 comments on commit 582b288

Please sign in to comment.