Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed some warnings from compiler #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions smc/src/audio/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ bool cAudio :: Init( void )
bool music = pPreferences->m_audio_music;

// if no change
if( numtimesopened && m_music_enabled == music && m_sound_enabled == sound && dev_frequency == pPreferences->m_audio_hz )
if( numtimesopened && m_music_enabled == music && m_sound_enabled == sound && (unsigned)dev_frequency == pPreferences->m_audio_hz )
{
return 1;
}
Expand Down Expand Up @@ -211,7 +211,7 @@ bool cAudio :: Init( void )
else
{
// different frequency
if( pPreferences->m_audio_hz != dev_frequency )
if( pPreferences->m_audio_hz != (unsigned)dev_frequency )
{
printf( "Warning : different frequency got %d but requested %d\n", dev_frequency, pPreferences->m_audio_hz );
}
Expand Down
2 changes: 0 additions & 2 deletions smc/src/core/game_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ void Handle_Game_Events( void )
while( Game_Action != GA_NONE )
{
// get current data
const GameMode current_game_mode = Game_Mode;
const GameModeType current_game_mode_type = Game_Mode_Type;
const GameAction current_game_action = Game_Action;
const CEGUI::XMLAttributes current_game_action_data_start = Game_Action_Data_Start;
const CEGUI::XMLAttributes current_game_action_data_middle = Game_Action_Data_Middle;
Expand Down
2 changes: 2 additions & 0 deletions smc/src/core/i18n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ void I18N_Init( void )
printf( "Warning: bindtextdomain failed for %s\n", DATA_DIR "/" GAME_TRANSLATION_DIR );
}

# ifdef _DEBUG
const char *textdomain_codeset = bind_textdomain_codeset( CAPTION, "UTF-8" );
const char *textdomain_default = textdomain( CAPTION );

debug_print( "Translation support with gettext set to:\n\tDirectory %s\n\tCodeset: %s\n\tText domain: %s\n",
textdomain_directory, textdomain_codeset, textdomain_default );
# endif
}

#ifdef _WIN32
Expand Down
2 changes: 0 additions & 2 deletions smc/src/gui/menu_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1196,8 +1196,6 @@ void cMenu_Options :: Init( void )
m_vid_geometry_detail = pVideo->m_geometry_quality;
m_vid_texture_detail = pVideo->m_texture_quality;

cMenu_Item *temp_item = NULL;

// options image
cHudSprite *hud_sprite = new cHudSprite( pMenuCore->m_handler->m_level->m_sprite_manager );
hud_sprite->Set_Image( pVideo->Get_Surface( "menu/options.png" ) );
Expand Down
2 changes: 1 addition & 1 deletion smc/src/level/level_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace SMC
{

// Milliseconds to enable power jump when ducking
const int power_jump_delta = 1000;
const unsigned int power_jump_delta = 1000;

const float cLevel_Player::m_default_pos_x = 200.0f;
const float cLevel_Player::m_default_pos_y = -300.0f;
Expand Down
3 changes: 2 additions & 1 deletion smc/src/overworld/world_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ cLine_collision cLayer :: Get_Nearest( float x, float y, ObjectDirection dir /*
cLayer_Line_Point_Start *layer_line = (*itr);

// line is not from waypoint
if( only_origin_id >= 0 && only_origin_id != layer_line->m_origin )
if( only_origin_id >= 0)
if((unsigned)only_origin_id != layer_line->m_origin )
{
continue;
}
Expand Down
10 changes: 5 additions & 5 deletions smc/src/video/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1279,8 +1279,8 @@ cGL_Surface *cVideo :: Load_GL_Surface( std::string filename, bool use_settings
SDL_Surface *cVideo :: Convert_To_Final_Software_Image( SDL_Surface *surface ) const
{
// get power of two size
const unsigned int width = Get_Power_of_2( surface->w );
const unsigned int height = Get_Power_of_2( surface->h );
const int width = Get_Power_of_2( surface->w );
const int height = Get_Power_of_2( surface->h );

// if it needs to be changed
if( width != surface->w || height != surface->h || surface->format->BitsPerPixel != 32 )
Expand All @@ -1306,7 +1306,7 @@ SDL_Surface *cVideo :: Convert_To_Final_Software_Image( SDL_Surface *surface ) c
return surface;
}

cGL_Surface *cVideo :: Create_Texture( SDL_Surface *surface, bool mipmap /* = 0 */, unsigned int force_width /* = 0 */, unsigned int force_height /* = 0 */ ) const
cGL_Surface *cVideo :: Create_Texture( SDL_Surface *surface, bool mipmap /* = 0 */,unsigned int force_width /* = 0 */, unsigned int force_height /* = 0 */ ) const
{
if( !surface )
{
Expand Down Expand Up @@ -1343,14 +1343,14 @@ cGL_Surface *cVideo :: Create_Texture( SDL_Surface *surface, bool mipmap /* = 0
int height = surface->h;

// forced size is set
if( force_width > 0 && force_height > 0 )
if( force_width != 0 && force_height != 0 )
{
// get power of two size
force_width = Get_Power_of_2( force_width );
force_height = Get_Power_of_2( force_height );

// apply forced size
if( force_width != width || force_height != height )
if( force_width != (unsigned)width || force_height != (unsigned)height )
{
width = force_width;
height = force_height;
Expand Down