Fixed all warnings. If there's any problems, it will be here.

This commit is contained in:
a1batross 2016-03-12 23:10:18 +03:00
parent f3168aa727
commit 4c113276af
12 changed files with 40 additions and 37 deletions

View File

@ -24,9 +24,8 @@ cmake_minimum_required(VERSION 2.6.0)
project (CLDLL)
# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -DLINUX -D_LINUX -DCLIENT_WEAPONS -DCLIENT_DLL -D_DEBUG -D_CS16CLIENT_ALLOW_SPECIAL_SCRIPTING")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings -Wl,--no-undefined -std=c++11")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ ")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined -std=c++11")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os")
@ -204,7 +203,10 @@ include_directories (
../game_shared/
../public/)
add_library (${CLDLL_LIBRARY} SHARED ${CLDLL_SOURCES})
add_definitions( -D_CS16CLIENT_ENABLE_GSRC_SUPPORT )
add_definitions( -D_CS16CLIENT_ENABLE_GSRC_SUPPORT
-DLINUX -D_LINUX -DCLIENT_WEAPONS -DCLIENT_DLL
-D_DEBUG -D_CS16CLIENT_ALLOW_SPECIAL_SCRIPTING
-Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp)
target_link_libraries( ${CLDLL_LIBRARY} ${CMAKE_DL_LIBS} -L/usr/lib/i386-linux-gnu -lSDL2 )

View File

@ -42,7 +42,7 @@ cvar_t *cl_min_ct;
cvar_t *cl_minmodels;
cvar_t *cl_lw = NULL;
wrect_t nullrc = { 0, 0, 0, 0 };
char *sPlayerModelFiles[12] =
const char *sPlayerModelFiles[12] =
{
"models/player.mdl",
"models/player/leet/leet.mdl", // t

View File

@ -202,7 +202,7 @@ void UTIL_StringToVector( float * pVector, const char *pString )
}
}
int UTIL_FindEntityInMap(char * name, float * origin, float * angle)
int UTIL_FindEntityInMap( const char * name, float * origin, float * angle)
{
int n,found = 0;
char keyname[256];

View File

@ -273,7 +273,7 @@ void CHudMenu::UserCmd_OldStyleMenuClose()
void CHudMenu::ShowVGUIMenu( int menuType )
{
char *szCmd;
const char *szCmd;
switch(menuType)
{

View File

@ -30,7 +30,7 @@ DECLARE_MESSAGE( m_Message, GameTitle )
// 1 Global client_textmessage_t for custom messages that aren't in the titles.txt
client_textmessage_t g_pCustomMessage;
char *g_pCustomName = "Custom";
const char *g_pCustomName = "Custom";
char g_pCustomText[1024];
int CHudMessage::Init(void)

View File

@ -107,7 +107,7 @@ int CHudStatusIcons::MsgFunc_StatusIcon( const char *pszName, int iSize, void *p
}
// add the icon to the icon list, and set it's drawing color
void CHudStatusIcons::EnableIcon( char *pszIconName, unsigned char red, unsigned char green, unsigned char blue )
void CHudStatusIcons::EnableIcon( const char *pszIconName, unsigned char red, unsigned char green, unsigned char blue )
{
// check to see if the sprite is in the current list
int i;
@ -151,7 +151,7 @@ void CHudStatusIcons::EnableIcon( char *pszIconName, unsigned char red, unsigned
}
}
void CHudStatusIcons::DisableIcon( char *pszIconName )
void CHudStatusIcons::DisableIcon( const char *pszIconName )
{
// find the sprite is in the current list
for ( int i = 0; i < MAX_ICONSPRITES; i++ )

View File

@ -111,7 +111,7 @@ inline void CenterPrint( const char *string )
#define GetPlayerInfo (*gEngfuncs.pfnGetPlayerInfo)
// sound functions
inline void PlaySound( char *szSound, float vol ) { gEngfuncs.pfnPlaySoundByName( szSound, vol ); }
inline void PlaySound( const char *szSound, float vol ) { gEngfuncs.pfnPlaySoundByName( szSound, vol ); }
inline void PlaySound( int iSound, float vol ) { gEngfuncs.pfnPlaySoundByIndex( iSound, vol ); }
#define max(a, b) (((a) > (b)) ? (a) : (b))

View File

@ -65,7 +65,7 @@ extern cvar_t *cl_weather;
extern cvar_t *cl_minmodels;
extern cvar_t *cl_min_t;
extern cvar_t *cl_min_ct;
extern char *sPlayerModelFiles[];
extern const char *sPlayerModelFiles[];
class CClientSprite;
@ -641,8 +641,8 @@ public:
//had to make these public so CHud could access them (to enable concussion icon)
//could use a friend declaration instead...
void EnableIcon( char *pszIconName, unsigned char red, unsigned char green, unsigned char blue );
void DisableIcon( char *pszIconName );
void EnableIcon( const char *pszIconName, unsigned char red, unsigned char green, unsigned char blue );
void DisableIcon( const char *pszIconName );
friend class CHudScoreboard;

View File

@ -46,7 +46,7 @@ const char *Localize( const char *string )
std::string key(string);
CDict::const_iterator got = gTitlesTXT.find(key);
// if iterator points to end, then it 'key' not found in dictionary
// if iterator points to end, then it 'key' not found in dictionary-
if( got != gTitlesTXT.end() || got->first != key )
return got->second;
else return string;

View File

@ -27,8 +27,8 @@
typedef struct cvar_s
{
char *name;
char *string;
const char *name;
const char *string;
int flags;
float value;
struct cvar_s *next;

View File

@ -115,7 +115,7 @@ typedef struct cl_enginefuncs_s
void ( *pfnSPR_DrawAdditive ) ( int frame, int x, int y, const wrect_t *prc );
void ( *pfnSPR_EnableScissor ) ( int x, int y, int width, int height );
void ( *pfnSPR_DisableScissor ) ( void );
client_sprite_t *( *pfnSPR_GetList ) ( char *psz, int *piCount );
client_sprite_t *( *pfnSPR_GetList ) ( const char *psz, int *piCount );
// screen handlers
void ( *pfnFillRGBA ) ( int x, int y, int width, int height, int r, int g, int b, int a );
@ -123,20 +123,20 @@ typedef struct cl_enginefuncs_s
void ( *pfnSetCrosshair ) ( HSPRITE hspr, wrect_t rc, int r, int g, int b );
// cvar handlers
struct cvar_s *( *pfnRegisterVariable ) ( char *szName, char *szValue, int flags );
float ( *pfnGetCvarFloat ) ( char *szName );
char* ( *pfnGetCvarString ) ( char *szName );
struct cvar_s *( *pfnRegisterVariable ) ( const char *szName, const char *szValue, int flags );
float ( *pfnGetCvarFloat ) ( const char *szName );
char* ( *pfnGetCvarString ) ( const char *szName );
// command handlers
int ( *pfnAddCommand ) ( char *cmd_name, void (*function)(void) );
int ( *pfnHookUserMsg ) ( char *szMsgName, pfnUserMsgHook pfn );
int ( *pfnServerCmd ) ( char *szCmdString );
int ( *pfnClientCmd ) ( char *szCmdString );
int ( *pfnAddCommand ) ( const char *cmd_name, void (*function)(void) );
int ( *pfnHookUserMsg ) ( const char *szMsgName, pfnUserMsgHook pfn );
int ( *pfnServerCmd ) ( const char *szCmdString );
int ( *pfnClientCmd ) ( const char *szCmdString );
void ( *pfnGetPlayerInfo ) ( int ent_num, hud_player_info_t *pinfo );
// sound handlers
void ( *pfnPlaySoundByName ) ( char *szSound, float volume );
void ( *pfnPlaySoundByName ) ( const char *szSound, float volume );
void ( *pfnPlaySoundByIndex ) ( int iSound, float volume );
// vector helpers
@ -145,7 +145,7 @@ typedef struct cl_enginefuncs_s
// text message system
client_textmessage_t *( *pfnTextMessageGet ) ( const char *pName );
int ( *pfnDrawCharacter ) ( int x, int y, int number, int r, int g, int b );
int ( *pfnDrawConsoleString ) ( int x, int y, char *string );
int ( *pfnDrawConsoleString ) ( int x, int y, const char *string );
void ( *pfnDrawSetTextColor ) ( float r, float g, float b );
void ( *pfnDrawConsoleStringLen )( const char *string, int *length, int *height );
@ -159,14 +159,14 @@ typedef struct cl_enginefuncs_s
void ( *GetViewAngles ) ( float * );
void ( *SetViewAngles ) ( float * );
int ( *GetMaxClients ) ( void );
void ( *Cvar_SetValue ) ( char *cvar, float value );
void ( *Cvar_SetValue ) ( const char *cvar, float value );
int (*Cmd_Argc) (void);
char *( *Cmd_Argv ) ( int arg );
void ( *Con_Printf ) ( char *fmt, ... );
void ( *Con_DPrintf ) ( char *fmt, ... );
void ( *Con_Printf ) ( const char *fmt, ... );
void ( *Con_DPrintf ) ( const char *fmt, ... );
void ( *Con_NPrintf ) ( int pos, char *fmt, ... );
void ( *Con_NXPrintf ) ( struct con_nprint_s *info, char *fmt, ... );
void ( *Con_NXPrintf ) ( struct con_nprint_s *info, const char *fmt, ... );
const char *( *PhysInfo_ValueForKey ) ( const char *key );
const char *( *ServerInfo_ValueForKey )( const char *key );
@ -210,7 +210,7 @@ typedef struct cl_enginefuncs_s
void *( *VGui_GetPanel ) ( );
void ( *VGui_ViewportPaintBackground ) (int extents[4]);
byte* (*COM_LoadFile) ( char *path, int usehunk, int *pLength );
byte* (*COM_LoadFile) ( const char *path, int usehunk, int *pLength );
char* (*COM_ParseFile) ( char *data, char *token );
void (*COM_FreeFile) ( void *buffer );
@ -273,12 +273,12 @@ typedef struct cl_enginefuncs_s
const char *(*LocalPlayerInfo_ValueForKey)( const char* key );
int (*pfnVGUI2DrawCharacter)( int x, int y, int ch, unsigned int font );
int (*pfnVGUI2DrawCharacterAdditive)( int x, int y, int ch, int r, int g, int b, unsigned int font );
unsigned int (*pfnGetApproxWavePlayLen)( char *filename );
unsigned int (*pfnGetApproxWavePlayLen)( const char *filename );
void* (*GetCareerGameUI)( void ); // g-cont. !!!! potential crash-point!
void (*Cvar_Set)( char *name, char *value );
void (*Cvar_Set)( const char *name, const char *value );
int (*pfnIsPlayingCareerMatch)( void );
void (*pfnPlaySoundVoiceByName)( char *szSound, float volume, int pitch );
void (*pfnPrimeMusicStream)( char *filename, int looping );
void (*pfnPlaySoundVoiceByName)( const char *szSound, float volume, int pitch );
void (*pfnPrimeMusicStream)( const char *filename, int looping );
double (*pfnSys_FloatTime)( void );
// decay funcs

View File

@ -89,6 +89,7 @@ typedef struct physent_s
} physent_t;
typedef struct hull_s hull_t;
typedef struct playermove_s
{
int player_index; // So we don't try to run the PM_CheckStuck nudging too quickly.
@ -197,7 +198,7 @@ typedef struct playermove_s
void (*PM_StuckTouch)( int hitent, pmtrace_t *ptraceresult );
int (*PM_PointContents) (float *p, int *truecontents /*filled in if this is non-null*/ );
int (*PM_TruePointContents) (float *p);
int (*PM_HullPointContents) ( struct hull_s *hull, int num, float *p);
int (*PM_HullPointContents) ( hull_t *hull, int num, float *p);
pmtrace_t (*PM_PlayerTrace) (float *start, float *end, int traceFlags, int ignore_pe );
struct pmtrace_s *(*PM_TraceLine)( float *start, float *end, int flags, int usehulll, int ignore_pe );
long (*RandomLong)( long lLow, long lHigh );