From b3ab2d474da2f79493ec80f83107ab0d3758ee4d Mon Sep 17 00:00:00 2001 From: hikerstk Date: Tue, 11 Dec 2007 02:48:10 +0000 Subject: [PATCH] Fixed several compiler warnings for Visual Studio. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1340 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/gui/base_gui.cpp | 2 +- src/gui/base_gui.hpp | 2 +- src/gui/menu_manager.cpp | 6 +++--- src/kart.cpp | 7 +++++++ src/material.hpp | 2 +- src/robots/default_robot.cpp | 6 +++--- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/gui/base_gui.cpp b/src/gui/base_gui.cpp index bc2039c93..678837802 100644 --- a/src/gui/base_gui.cpp +++ b/src/gui/base_gui.cpp @@ -129,7 +129,7 @@ BaseGUI::update(float dt) //----------------------------------------------------------------------------- void -BaseGUI::TimeToString(const float TIME, char *s) +BaseGUI::TimeToString(const double TIME, char *s) { int min = (int) floor ( TIME / 60.0 ) ; int sec = (int) floor ( TIME - (double) ( 60 * min ) ) ; diff --git a/src/gui/base_gui.hpp b/src/gui/base_gui.hpp index 90eadd49d..8358b42f9 100644 --- a/src/gui/base_gui.hpp +++ b/src/gui/base_gui.hpp @@ -41,7 +41,7 @@ public: void inputPointer(int x, int y); - void TimeToString(const float time, char *s); + void TimeToString(const double time, char *s); protected: int m_menu_id; diff --git a/src/gui/menu_manager.cpp b/src/gui/menu_manager.cpp index c1a035aaf..3deaa6e3b 100644 --- a/src/gui/menu_manager.cpp +++ b/src/gui/menu_manager.cpp @@ -124,7 +124,7 @@ void MenuManager::update() delete m_current_menu; m_current_menu= NULL; - m_handled_size= m_menu_stack.size(); + m_handled_size= (unsigned int)m_menu_stack.size(); if (m_handled_size > 0) { pair saved = m_menu_stack.back(); @@ -213,7 +213,7 @@ void MenuManager::update() } // switch - if( !widget_manager->is_empty() ) + if( id != MENUID_EXITGAME ) { // Restores the previously selected widget if there was one. if (saved_widget != WidgetManager::WGT_NONE) @@ -236,7 +236,7 @@ void MenuManager::update() if (m_current_menu != NULL) { - m_current_menu->update(now.getDeltaTime()); + m_current_menu->update((float)now.getDeltaTime()); } } // update diff --git a/src/kart.cpp b/src/kart.cpp index fc4c39ae7..baaf25cff 100644 --- a/src/kart.cpp +++ b/src/kart.cpp @@ -122,7 +122,14 @@ void KartParticleSystem::particle_delete (int , Particle* ) //============================================================================= Kart::Kart (const KartProperties* kartProperties_, int position_ , sgCoord init_pos) +#if defined(WIN32) && !defined(__CYGWIN__) + // Disable warning for using 'this' in base member initializer list +# pragma warning(disable:4355) +#endif : Moveable(true), m_attachment(this), m_collectable(this) +#if defined(WIN32) && !defined(__CYGWIN__) +# pragma warning(1:4355) +#endif { m_kart_properties = kartProperties_; m_grid_position = position_ ; diff --git a/src/material.hpp b/src/material.hpp index 8b0e2ad63..907478148 100644 --- a/src/material.hpp +++ b/src/material.hpp @@ -73,7 +73,7 @@ public: int getIndex () { return m_index ; } void apply () { m_state -> apply () ; } - char *getTexFname () { return m_texname ; } + char *getTexFname () const { return m_texname ; } } ; diff --git a/src/robots/default_robot.cpp b/src/robots/default_robot.cpp index bbf0ff334..6ec97a5e4 100755 --- a/src/robots/default_robot.cpp +++ b/src/robots/default_robot.cpp @@ -190,7 +190,7 @@ void DefaultRobot::handle_braking() //----------------------------------------------------------------------------- void DefaultRobot::handle_steering() { - const unsigned int DRIVELINE_SIZE = world->m_track->m_driveline.size(); + const unsigned int DRIVELINE_SIZE = (unsigned int)world->m_track->m_driveline.size(); const size_t NEXT_SECTOR = (unsigned int)m_track_sector + 1 < DRIVELINE_SIZE ? m_track_sector + 1 : 0; float steer_angle = 0.0f; @@ -633,7 +633,7 @@ void DefaultRobot::check_crashes( const int STEPS, sgVec3 const pos ) */ void DefaultRobot::find_non_crashing_point( sgVec2 result ) { - const unsigned int DRIVELINE_SIZE = world->m_track->m_driveline.size(); + const unsigned int DRIVELINE_SIZE = (unsigned int)world->m_track->m_driveline.size(); unsigned int sector = (unsigned int)m_track_sector + 1 < DRIVELINE_SIZE ? m_track_sector + 1 : 0; @@ -864,7 +864,7 @@ float DefaultRobot::get_approx_radius(const int START, const int END) const */ void DefaultRobot::find_curve() { - const int DRIVELINE_SIZE = world->m_track->m_driveline.size(); + const int DRIVELINE_SIZE = (unsigned int)world->m_track->m_driveline.size(); float total_dist = 0.0f; int next_hint = m_track_sector; int i;