client: code style cleanup

This commit is contained in:
Denis Pauk 2025-01-01 22:34:21 +02:00
parent 89719b4a27
commit 33fd4579fb
8 changed files with 53 additions and 53 deletions

View file

@ -618,21 +618,21 @@ Sys_Realpath(const char *in, char *out, size_t size)
void *
Sys_GetProcAddress(void *handle, const char *sym)
{
if (handle == NULL)
{
if (handle == NULL)
{
#ifdef RTLD_DEFAULT
return dlsym(RTLD_DEFAULT, sym);
return dlsym(RTLD_DEFAULT, sym);
#else
/* POSIX suggests that this is a portable equivalent */
static void *global_namespace = NULL;
/* POSIX suggests that this is a portable equivalent */
static void *global_namespace = NULL;
if (global_namespace == NULL)
global_namespace = dlopen(NULL, RTLD_GLOBAL|RTLD_LAZY);
if (global_namespace == NULL)
global_namespace = dlopen(NULL, RTLD_GLOBAL|RTLD_LAZY);
return dlsym(global_namespace, sym);
return dlsym(global_namespace, sym);
#endif
}
return dlsym(handle, sym);
}
return dlsym(handle, sym);
}
void

View file

@ -275,7 +275,7 @@ Sys_Microseconds(void)
static LARGE_INTEGER freq = { 0 };
static LARGE_INTEGER base = { 0 };
if (!freq.QuadPart)
if (!freq.QuadPart)
{
QueryPerformanceFrequency(&freq);
}

View file

@ -508,14 +508,14 @@ static void IN_Controller_Shutdown(qboolean notify_user);
qboolean IN_NumpadIsOn()
{
SDL_Keymod mod = SDL_GetModState();
SDL_Keymod mod = SDL_GetModState();
if ((mod & KMOD_NUM) == KMOD_NUM)
{
return true;
}
if ((mod & KMOD_NUM) == KMOD_NUM)
{
return true;
}
return false;
return false;
}
/* ------------------------------------------------------------------ */

View file

@ -506,14 +506,14 @@ static void IN_Controller_Shutdown(qboolean notify_user);
qboolean IN_NumpadIsOn()
{
SDL_Keymod mod = SDL_GetModState();
SDL_Keymod mod = SDL_GetModState();
if ((mod & SDL_KMOD_NUM) == SDL_KMOD_NUM)
{
return true;
}
if ((mod & SDL_KMOD_NUM) == SDL_KMOD_NUM)
{
return true;
}
return false;
return false;
}
/* ------------------------------------------------------------------ */

View file

@ -53,7 +53,7 @@ enum {
*/
static void APIENTRY
DebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length,
const GLchar *message, const void *userParam)
const GLchar *message, const void *userParam)
{
const char* sourceStr = "Source: Unknown";
const char* typeStr = "Type: Unknown";
@ -172,15 +172,15 @@ void GL3_SetVsync(void)
#ifdef USE_SDL3
int vsyncState;
if (!SDL_GL_GetSwapInterval(&vsyncState))
{
R_Printf(PRINT_ALL, "Failed to get vsync state, assuming vsync inactive.\n");
vsyncActive = false;
}
else
{
vsyncActive = vsyncState ? true : false;
}
if (!SDL_GL_GetSwapInterval(&vsyncState))
{
R_Printf(PRINT_ALL, "Failed to get vsync state, assuming vsync inactive.\n");
vsyncActive = false;
}
else
{
vsyncActive = vsyncState ? true : false;
}
#else
vsyncActive = SDL_GL_GetSwapInterval() != 0;
#endif

View file

@ -53,7 +53,7 @@ enum {
*/
static void APIENTRY
DebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length,
const GLchar *message, const void *userParam)
const GLchar *message, const void *userParam)
{
const char* sourceStr = "Source: Unknown";
const char* typeStr = "Type: Unknown";
@ -155,15 +155,15 @@ void GL4_SetVsync(void)
#ifdef USE_SDL3
int vsyncState;
if (SDL_GL_GetSwapInterval(&vsyncState) != 0)
{
R_Printf(PRINT_ALL, "Failed to get vsync state, assuming vsync inactive.\n");
vsyncActive = false;
}
else
{
vsyncActive = vsyncState ? true : false;
}
if (SDL_GL_GetSwapInterval(&vsyncState) != 0)
{
R_Printf(PRINT_ALL, "Failed to get vsync state, assuming vsync inactive.\n");
vsyncActive = false;
}
else
{
vsyncActive = vsyncState ? true : false;
}
#else
vsyncActive = SDL_GL_GetSwapInterval() != 0;
#endif
@ -439,9 +439,9 @@ void GL4_ShutdownContext()
if(context)
{
#ifdef USE_SDL3
SDL_GL_DestroyContext(context);
SDL_GL_DestroyContext(context);
#else
SDL_GL_DeleteContext(context);
SDL_GL_DeleteContext(context);
#endif
context = NULL;
}

View file

@ -393,7 +393,7 @@ ThrowHeadACID(edict_t *self, const char *gibname, int damage, int type)
vec3_t vd;
float vscale;
if (!self || !gibname)
if (!self || !gibname)
{
return;
}

View file

@ -167,7 +167,7 @@ SP_CreateUnnamedSpawn(edict_t *self)
}
/* mine1 */
if (Q_stricmp(level.mapname, "mine1") == 0)
if (Q_stricmp(level.mapname, "mine1") == 0)
{
if (Q_stricmp(self->targetname, "mintro") == 0)
{
@ -183,7 +183,7 @@ SP_CreateUnnamedSpawn(edict_t *self)
}
/* mine2 */
if (Q_stricmp(level.mapname, "mine2") == 0)
if (Q_stricmp(level.mapname, "mine2") == 0)
{
if (Q_stricmp(self->targetname, "mine1") == 0)
{
@ -199,7 +199,7 @@ SP_CreateUnnamedSpawn(edict_t *self)
}
/* mine3 */
if (Q_stricmp(level.mapname, "mine3") == 0)
if (Q_stricmp(level.mapname, "mine3") == 0)
{
if (Q_stricmp(self->targetname, "mine2a") == 0)
{
@ -215,7 +215,7 @@ SP_CreateUnnamedSpawn(edict_t *self)
}
/* mine4 */
if (Q_stricmp(level.mapname, "mine4") == 0)
if (Q_stricmp(level.mapname, "mine4") == 0)
{
if (Q_stricmp(self->targetname, "mine3") == 0)
{
@ -247,7 +247,7 @@ SP_CreateUnnamedSpawn(edict_t *self)
}
/* waste1 */
if (Q_stricmp(level.mapname, "waste1") == 0)
if (Q_stricmp(level.mapname, "waste1") == 0)
{
if (Q_stricmp(self->targetname, "power2") == 0)
{
@ -263,7 +263,7 @@ SP_CreateUnnamedSpawn(edict_t *self)
}
/* waste2 */
if (Q_stricmp(level.mapname, "waste2") == 0)
if (Q_stricmp(level.mapname, "waste2") == 0)
{
if (Q_stricmp(self->targetname, "waste1") == 0)
{
@ -279,7 +279,7 @@ SP_CreateUnnamedSpawn(edict_t *self)
}
/* city3 */
if (Q_stricmp(level.mapname, "city2") == 0)
if (Q_stricmp(level.mapname, "city2") == 0)
{
if (Q_stricmp(self->targetname, "city2NL") == 0)
{