Skip to content

Commit

Permalink
fix most linux warnings and errors take 3
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintWish committed Sep 25, 2024
1 parent fe6d482 commit a09c0ea
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/game/client/hud.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ typedef struct cvar_s cvar_t;
#endif
#include "hud_spectator.h" //SDK 2.3

void Print(char *szFmt, ...);
void Print(const char *szFmt, ...);
void ShowVGUIMenu(int iMenu);

//ripped from windef.h
Expand Down
6 changes: 3 additions & 3 deletions src/game/client/inc_huditem.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

#define INC_HUDITEM_H

void Print(char *szFmt, ...);
char *UTIL_VarArgs(char *format, ...);
inline const char *Localized(const char *pszText) { return CHudTextMessage::BufferedLocaliseTextString(pszText); }
void Print(const char *szFmt, ...);
char* UTIL_VarArgs(const char *format, ...);
inline const char* Localized(const char *pszText) { return CHudTextMessage::BufferedLocaliseTextString(pszText); }
2 changes: 1 addition & 1 deletion src/game/client/ms/clglobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ void AlertMessage(ALERT_TYPE atype, char *szFmt, ...)
ConsolePrint("cl: ");
ConsolePrint(string);
}
char *UTIL_VarArgs(char *format, ...)
char* UTIL_VarArgs(const char *format, ...)
{
static char string[1024];

Expand Down
2 changes: 1 addition & 1 deletion src/game/client/render/studiomodelrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ engine_studio_api_t IEngineStudio;

modelinfo_t CModelMgr::m_ModelInfo[4096];

void Print(char* szFmt, ...);
void Print(const char* szFmt, ...);
void VectorAngles(const float* forward, float* angles);

int ViewModel_ExclusiveViewHand = -1;
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/fn/FNSharedDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#define STRING_BUFFER 1024

void FNShared::Print(char* fmt, ...)
void FNShared::Print(const char* fmt, ...)
{
static char string[STRING_BUFFER];

Expand Down
2 changes: 1 addition & 1 deletion src/game/server/fn/FNSharedDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ enum FnPlayerFlags

namespace FNShared
{
void Print(char* fmt, ...);
void Print(const char* fmt, ...);
bool IsSlotValid(int slot);
bool IsEnabled(void);
void Validate(void);
Expand Down
3 changes: 1 addition & 2 deletions src/game/server/gamerules/multiplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ void CHalfLifeMultiplay::UpdateGameMode( CBasePlayer *pPlayer )
void CHalfLifeMultiplay::InitHUD( CBasePlayer *pPlayer )
{
// notify other clients of player joining the game
UTIL_ClientPrintAll( HUD_PRINTNOTIFY, UTIL_VarArgs( "%s has joined the game\n",
( pPlayer->pev->netname && STRING(pPlayer->pev->netname)[0] != 0 ) ? STRING(pPlayer->pev->netname) : "unconnected" ) );
UTIL_ClientPrintAll( HUD_PRINTNOTIFY, UTIL_VarArgs("%s has joined the game\n", (pPlayer->pev->netname && STRING(pPlayer->pev->netname)[0] != 0) ? STRING(pPlayer->pev->netname) : "unconnected" ));

UTIL_LogPrintf( "\"%s<%i>\" has entered the game\n", STRING( pPlayer->pev->netname ), GETPLAYERUSERID( pPlayer->edict() ) );

Expand Down
2 changes: 1 addition & 1 deletion src/game/server/hl/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ float UTIL_SplineFraction(float value, float scale)
return 3 * valueSquared - 2 * valueSquared * value;
}

char *UTIL_VarArgs(char *format, ...)
char* UTIL_VarArgs(const char *format, ...)
{
static char string[1024];

Expand Down
2 changes: 1 addition & 1 deletion src/game/server/hl/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ extern float UTIL_Approach(float target, float value, float speed);
extern float UTIL_ApproachAngle(float target, float value, float speed);
extern float UTIL_AngleDistance(float next, float cur);

extern char *UTIL_VarArgs(char *format, ...);
extern char *UTIL_VarArgs(const char *format, ...);
extern void UTIL_Remove(CBaseEntity *pEntity);
extern BOOL UTIL_IsValidEntity(edict_t *pent);
extern BOOL UTIL_TeamsMatch(const char *pTeamName1, const char *pTeamName2);
Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/ms/global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ AlertMessage
Print debug messages to console
======================
*/
void Print(char *szFmt, ...)
void Print(const char *szFmt, ...)
{
static char string[1024];

Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/ms/groupfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void operator delete(void* ptr, const char* pszSourceFile, int LineNum);
#define msnew new
#endif

void Print(char* szFmt, ...);
void Print(const char* szFmt, ...);

/*-----------
CGroupFile - File packwout without encryption.
Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/ms/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ extern Logger chatlog;
extern Logger NullFile;
extern bool g_log_initialized;

void Print(char* szFmt, ...);
void Print(const char* szFmt, ...);
void Log(char* szFmt, ...);
void OpenLogFiles();

Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/ms/sharedutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Color4F //For opengl or when you need colors in the [0-1] range
#define MACRO_CREATEITEM(item) (CBaseEntity *)GET_PRIVATE(CREATE_NAMED_ENTITY(MAKE_STRING(item)))
//#define clrmem( a ) memset( &a, 0, sizeof(a) );
int numofdigits(int x);
void Print(char *szFmt, ...);
void Print(const char *szFmt, ...);
#define FloatToString( a ) UTIL_VarArgs( "%.2f", a )
#define IntToString( a ) UTIL_VarArgs( "%i", a )

Expand Down
4 changes: 4 additions & 0 deletions src/game/shared/strhelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#ifdef POSIX
char* strupr(char* start);
char* strlower(char* start);

// These need to be defined here otherwise we could fuck up SDL2's headers.
#define _strupr strupr
#define _strlwr strlower
#endif

#endif // STR_HELPER_H

0 comments on commit a09c0ea

Please sign in to comment.