Fix compiler warnings

This commit is contained in:
a1batross 2016-04-06 16:29:45 +03:00
parent 699849b124
commit 1a6693585b
15 changed files with 39 additions and 49 deletions

View File

@ -699,7 +699,7 @@ enum
kRenderGlow, // src*a+dest -- No Z buffer checks
kRenderTransAlpha, // src*srca+dest*(1-srca)
kRenderTransAdd, // src*a+dest
kRenderWorldGlow, // Same as kRenderGlow but not fixed size in screen space
kRenderWorldGlow // Same as kRenderGlow but not fixed size in screen space
};
enum
@ -724,7 +724,7 @@ enum
kRenderFxDeadPlayer, // kRenderAmt is the player index
kRenderFxExplode, // Scale up really big!
kRenderFxGlowShell, // Glowing Shell
kRenderFxClampMinScale, // Keep this sprite from getting very small (SPRITES only!)
kRenderFxClampMinScale // Keep this sprite from getting very small (SPRITES only!)
};
typedef int func_t;
@ -777,4 +777,4 @@ typedef struct
int hitgroup; // 0 == generic, non zero is specific body part
} trace_t;
#endif//CONST_H
#endif//CONST_H

View File

@ -28,7 +28,7 @@ typedef enum
NA_BROADCAST,
NA_IP,
NA_IPX,
NA_BROADCAST_IPX,
NA_BROADCAST_IPX
} netadrtype_t;
typedef struct netadr_s

View File

@ -78,10 +78,10 @@ typedef struct ui_enginefuncs_s
char* (*pfnCmd_Args)( void );
// debug messages (in-menu shows only notify)
void (*Con_Printf)( char *fmt, ... );
void (*Con_DPrintf)( char *fmt, ... );
void (*Con_NPrintf)( int pos, char *fmt, ... );
void (*Con_NXPrintf)( struct con_nprint_s *info, char *fmt, ... );
void (*Con_Printf)( const char *fmt, ... );
void (*Con_DPrintf)( const char *fmt, ... );
void (*Con_NPrintf)( int pos, const char *fmt, ... );
void (*Con_NXPrintf)( struct con_nprint_s *info, const char *fmt, ... );
// sound handlers
void (*pfnPlayLocalSound)( const char *szSound );

View File

@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 2.6.0)
project (MAINUI)
# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os")

View File

@ -59,7 +59,7 @@ int uiColorBlack = 0xFF000000; // 0, 0, 0, 255 // some controls backgroun
int uiColorConsole = 0xFFF0B418; // just for reference
// color presets (this is nasty hack to allow color presets to part of text)
const int g_iColorTable[8] =
const unsigned int g_iColorTable[8] =
{
0xFF000000, // black
0xFFFF0000, // red
@ -1151,6 +1151,8 @@ void UI_CharEvent( int key )
case QMTYPE_FIELD:
UI_Field_Char((menuField_s *)item, key );
break;
default:
break;
}
}
}

View File

@ -259,7 +259,7 @@ typedef struct
typedef struct
{
menuCommon_s generic;
int enabled;
bool enabled;
const char *emptyPic;
const char *focusPic; // can be replaced with pressPic manually
const char *checkPic;

View File

@ -17,12 +17,13 @@ GNU General Public License for more details.
#define EXTDLL_H
// shut-up compiler warnings
#if defined(MSC_VER)
#pragma warning(disable : 4305) // int or float data truncation
#pragma warning(disable : 4201) // nameless struct/union
#pragma warning(disable : 4514) // unreferenced inline function removed
#pragma warning(disable : 4100) // unreferenced formal parameter
#pragma warning(disable : 4244) // conversion from 'float' to 'int', possible loss of data
#endif
// Misc C-runtime library headers
#include <assert.h>
#include <string.h>

View File

@ -172,7 +172,7 @@ static void UI_Controls_ParseKeysList( void )
if( !stricmp( token, "blank" ))
{
// seperator
// separator
pfile = COM_ParseFile( pfile, token );
if( !pfile ) break; // technically an error
@ -271,7 +271,6 @@ static void UI_Controls_ResetKeysList( void )
char *afile = (char *)LOAD_FILE( "gfx/shell/kb_def.lst", NULL );
char *pfile = afile;
char token[1024];
int i = 0;
if( !afile )
{

View File

@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static const char *uiCreditsDefault[] =
{
"CS16Client v0.1",
"CS16Client v1.0",
"Build Date:" __DATE__ " " __TIME__ ,
"",
"Developers: ",
@ -60,7 +60,7 @@ static const char *uiCreditsDefault[] =
"",
"Big thanks to Valve Corporation for Counter-Strike",
"Uncle Mike for this powerful engine",
"Nagist and s1lentq for successful game researching",
"Nagist and s1lentq for successful CS1.6 game researching",
"Spirit of Half-Life developers for rain code",
"hzqst for studio render code",
"",

View File

@ -178,21 +178,21 @@ static void UI_GameOptions_GetConfig( void )
uiGameOptions.mp_decals.curValue = uiGameInitial.mp_decals = CVAR_GET_FLOAT( "mp_decals" );
if( CVAR_GET_FLOAT( "hand" ))
uiGameInitial.hand = uiGameOptions.hand.enabled = 1;
uiGameInitial.hand = uiGameOptions.hand.enabled = true;
if( CVAR_GET_FLOAT( "cl_fastsmoke" ))
uiGameInitial.fast_smoke_gas = uiGameOptions.fast_smoke_gas.enabled = 1;
uiGameInitial.fast_smoke_gas = uiGameOptions.fast_smoke_gas.enabled = true;
if( CVAR_GET_FLOAT( "_vgui_menus" ))
uiGameInitial.oldstylemenu = uiGameOptions.oldstylemenu.enabled = 1;
uiGameInitial.oldstylemenu = uiGameOptions.oldstylemenu.enabled = true;
if( CVAR_GET_FLOAT( "_extended_menus" ))
uiGameInitial.extendedmenus = uiGameOptions.extendedmenus.enabled = 1;
uiGameInitial.extendedmenus = uiGameOptions.extendedmenus.enabled = true;
if( CVAR_GET_FLOAT( "_cl_autowepswitch" ))
uiGameInitial.cl_autowepswitch = uiGameOptions.cl_autowepswitch.enabled = 1;
uiGameInitial.cl_autowepswitch = uiGameOptions.cl_autowepswitch.enabled = true;
if( CVAR_GET_FLOAT( "hud_centerid" ))
uiGameInitial.hud_centerid = uiGameOptions.hud_centerid.enabled = 1;
uiGameInitial.hud_centerid = uiGameOptions.hud_centerid.enabled = true;
if( CVAR_GET_FLOAT( "_ah" ))
uiGameInitial.auto_help = uiGameOptions.auto_help.enabled = 1;
uiGameInitial.auto_help = uiGameOptions.auto_help.enabled = true;
if( CVAR_GET_FLOAT( "cl_radartype" ))
uiGameInitial.radar_type = uiGameOptions.radar_type.enabled = 1;
uiGameInitial.radar_type = uiGameOptions.radar_type.enabled = true;
UI_GameOptions_UpdateConfig ();
}

View File

@ -119,6 +119,7 @@ static void UI_Background_Ownerdraw( void *self )
logoPosY = 70 * scaleY; // 70 it's empirically determined value (magic number)
DRAW_LOGO( "logo.avi", 0, logoPosY, logoWidth, logoHeight );
//UI_DrawPic( 0, logoPosY, logoWidth, logoHeight)
}
static void UI_QuitDialog( void )
@ -291,14 +292,8 @@ UI_Main_Init
*/
static void UI_Main_Init( void )
{
bool bCustomGame;
memset( &uiMain, 0, sizeof( uiMain_t ));
if( CVAR_GET_FLOAT( "host_allow_changegame" ))
bCustomGame = true;
else bCustomGame = false;
// precache .avi file and get logo width and height
PRECACHE_LOGO( "logo.avi" );

View File

@ -270,20 +270,9 @@ static void UI_PlayerSetup_Callback( void *self, int event )
/*
=================
UI_PlayerSetup_Ownerdraw
UI_Crosshair_Ownerdraw
=================
*/
static void UI_PlayerSetup_Ownerdraw( void *self )
{
menuCommon_s *item = (menuCommon_s *)self;
// draw the background
UI_FillRect( item->x, item->y, item->width, item->height, uiPromptBgColor );
// draw the rectangle
UI_DrawRectangle( item->x, item->y, item->width, item->height, uiInputFgColor );
}
static void UI_Crosshair_Ownerdraw( void *self )
{
menuBitmap_s *item = (menuBitmap_s*)self;

View File

@ -91,7 +91,7 @@ UI_VidModes_GetModesList
*/
static void UI_VidModes_GetConfig( void )
{
int i;
unsigned int i;
for( i = 0; i < MAX_VIDMODES-1; i++ )
uiVidModes.videoModesPtr[i] = uiVideoModes[i];
@ -231,6 +231,10 @@ static void UI_VidModes_Init( void )
uiVidModes.vidList.generic.id = ID_VIDMODELIST;
uiVidModes.vidList.generic.type = QMTYPE_SCROLLLIST;
uiVidModes.vidList.generic.flags = QMF_HIGHLIGHTIFFOCUS|QMF_SMALLFONT;
#if defined(__ANDROID__) // it's impossible to change resolution on Android, so grey it out
uiVidModes.vidList.generic.flags = QMF_INACTIVE;
uiVidModes.vidList.generic.color = uiColorDkGrey;
#endif
uiVidModes.vidList.generic.x = 400;
uiVidModes.vidList.generic.y = 300;
uiVidModes.vidList.generic.width = 560;

View File

@ -208,7 +208,7 @@ char *Info_ValueForKey( const char *s, const char *key )
o = pkey;
while( *s != '\\' && *s != '\n' )
{
if( !*s ) return "";
if( !*s ) return (char*)"";
*o++ = *s++;
}
@ -219,14 +219,14 @@ char *Info_ValueForKey( const char *s, const char *key )
while( *s != '\\' && *s != '\n' && *s )
{
if( !*s ) return "";
if( !*s ) return (char*)"";
*o++ = *s++;
}
*o = 0;
if( !strcmp( key, pkey ))
return value[valueindex];
if( !*s ) return "";
if( !*s ) return (char*)"";
s++;
}
}
@ -1164,7 +1164,7 @@ UI_Slider_Key
*/
const char *UI_Slider_Key( menuSlider_s *sl, int key, int down )
{
int sliderX;
int sliderX;
if( !down )
{

View File

@ -111,7 +111,7 @@ inline float RemapVal( float val, float A, float B, float C, float D)
extern void AddSpaces( char *s, int size );
extern int ColorStrlen( const char *str ); // returns string length without color symbols
extern const int g_iColorTable[8];
extern const unsigned int g_iColorTable[8];
extern void COM_FileBase( const char *in, char *out ); // ripped out from hlsdk 2.3
extern int UI_FadeAlpha( int starttime, int endtime );
extern void StringConcat( char *dst, const char *src, size_t size ); // strncat safe prototype
@ -122,4 +122,4 @@ extern int COM_CompareSaves( const void **a, const void **b );
extern void UI_LoadCustomStrings( void );
#endif//UTILS_H
#endif//UTILS_H