diff --git a/src/graphics/camera.cpp b/src/graphics/camera.cpp index d70d5f419..3f26c6e9a 100644 --- a/src/graphics/camera.cpp +++ b/src/graphics/camera.cpp @@ -55,7 +55,8 @@ Camera::CameraType Camera::m_default_type = Camera::CM_TYPE_NORMAL; */ Camera* Camera::createCamera(AbstractKart* kart) { - Camera *camera = createCamera(m_all_cameras.size(), m_default_type, kart); + Camera *camera = createCamera((int)m_all_cameras.size(), + m_default_type, kart ); m_all_cameras.push_back(camera); return camera; } // createCamera(kart) diff --git a/src/input/multitouch_device.hpp b/src/input/multitouch_device.hpp index 63f0376f8..30b72c8c8 100644 --- a/src/input/multitouch_device.hpp +++ b/src/input/multitouch_device.hpp @@ -110,7 +110,7 @@ public: void clearButtons(); /** Returns the number of created buttons */ - unsigned int getButtonsCount() {return m_buttons.size();} + unsigned int getButtonsCount() { return (unsigned int)m_buttons.size();} /** Returns pointer to the selected button */ MultitouchButton* getButton(unsigned int i) {return m_buttons.at(i);} diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index 8207488ac..2df9a3ec0 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -817,7 +817,7 @@ float Kart::getSpeedForTurnRadius(float radius) const { InterpolationArray turn_angle_at_speed = m_kart_properties->getTurnRadius(); // Convert the turn radius into turn angle - for(std::size_t i = 0; i < turn_angle_at_speed.size(); i++) + for(int i = 0; i < (int)turn_angle_at_speed.size(); i++) turn_angle_at_speed.setY(i, sin(m_kart_properties->getWheelBase() / turn_angle_at_speed.getY(i))); @@ -831,7 +831,7 @@ float Kart::getMaxSteerAngle(float speed) const { InterpolationArray turn_angle_at_speed = m_kart_properties->getTurnRadius(); // Convert the turn radius into turn angle - for(std::size_t i = 0; i < turn_angle_at_speed.size(); i++) + for(int i = 0; i < (int)turn_angle_at_speed.size(); i++) turn_angle_at_speed.setY(i, sin(m_kart_properties->getWheelBase() / turn_angle_at_speed.getY(i))); diff --git a/src/modes/follow_the_leader.cpp b/src/modes/follow_the_leader.cpp index 06cf0b461..4de734069 100644 --- a/src/modes/follow_the_leader.cpp +++ b/src/modes/follow_the_leader.cpp @@ -251,7 +251,7 @@ void FollowTheLeaderRace::terminateRace() endSetKartPositions(); // Mark all still racing karts to be finished. - for (int i = m_karts.size(); i>0; i--) + for (int i = (int)m_karts.size(); i>0; i--) { AbstractKart *kart = getKartAtPosition(i); if (kart->isEliminated() || kart->hasFinishedRace()) diff --git a/src/modes/soccer_world.cpp b/src/modes/soccer_world.cpp index 1f660ada1..3837cd5d3 100644 --- a/src/modes/soccer_world.cpp +++ b/src/modes/soccer_world.cpp @@ -626,7 +626,7 @@ void SoccerWorld::enterRaceOverState() std::sort(m_goal_frame.begin(), m_goal_frame.end()); const int mean = std::accumulate(m_goal_frame.begin(), - m_goal_frame.end(), 0) / m_goal_frame.size(); + m_goal_frame.end(), 0) / (int)m_goal_frame.size(); // Prevent overflow if there is a large frame in vector double squared_sum = 0; @@ -668,9 +668,9 @@ void SoccerWorld::enterRaceOverState() } int red_goal = ((int(m_red_scorers.size()) - blue_own_goal) >= 0 ? - m_red_scorers.size() - blue_own_goal : 0); + (int)m_red_scorers.size() - blue_own_goal : 0); int blue_goal = ((int(m_blue_scorers.size()) - red_own_goal) >= 0 ? - m_blue_scorers.size() - red_own_goal : 0); + (int)m_blue_scorers.size() - red_own_goal : 0); Log::verbose("Soccer AI profiling", "Red goal: %d, Red own goal: %d," "Blue goal: %d, Blue own goal: %d", red_goal, red_own_goal, diff --git a/src/modes/three_strikes_battle.cpp b/src/modes/three_strikes_battle.cpp index 86f789243..71accd7a2 100644 --- a/src/modes/three_strikes_battle.cpp +++ b/src/modes/three_strikes_battle.cpp @@ -660,7 +660,7 @@ void ThreeStrikesBattle::spawnSpareTireKarts() if (ratio < 1.5f) return; unsigned int spawn_sta = unsigned(ratio); if (spawn_sta > m_spare_tire_karts.size()) - spawn_sta = m_spare_tire_karts.size(); + spawn_sta = (int)m_spare_tire_karts.size(); m_race_gui->addMessage(_P("%i spare tire kart has been spawned!", "%i spare tire karts have been spawned!", spawn_sta), NULL, 2.0f); @@ -719,15 +719,15 @@ void ThreeStrikesBattle::loadCustomModels() // Compute a random kart list std::vector sta_list; - kart_properties_manager->getRandomKartList(pos.size(), NULL, - &sta_list); + kart_properties_manager->getRandomKartList((int)pos.size(), NULL, + &sta_list); assert(sta_list.size() == pos.size()); // Now add them for (unsigned int i = 0; i < pos.size(); i++) { - AbstractKart* sta = new Kart(sta_list[i], m_karts.size(), - m_karts.size() + 1, pos[i], PLAYER_DIFFICULTY_NORMAL, + AbstractKart* sta = new Kart(sta_list[i], (int)m_karts.size(), + (int)m_karts.size() + 1, pos[i], PLAYER_DIFFICULTY_NORMAL, KRT_RED); sta->init(RaceManager::KartType::KT_SPARE_TIRE); sta->setController(new SpareTireAI(sta)); diff --git a/src/network/protocol.cpp b/src/network/protocol.cpp index 269633c4f..9e6501d09 100644 --- a/src/network/protocol.cpp +++ b/src/network/protocol.cpp @@ -53,7 +53,7 @@ Protocol::~Protocol() /** Returns a network string with the given type. * \capacity Default preallocated size for the message. */ -NetworkString* Protocol::getNetworkString(int capacity) +NetworkString* Protocol::getNetworkString(size_t capacity) { return new NetworkString(m_type, capacity); } // getNetworkString diff --git a/src/network/protocol.hpp b/src/network/protocol.hpp index 12d3412fa..3d906cff3 100644 --- a/src/network/protocol.hpp +++ b/src/network/protocol.hpp @@ -128,7 +128,7 @@ public: virtual void asynchronousUpdate() = 0; /// functions to check incoming data easily - NetworkString* getNetworkString(int capacity=16); + NetworkString* getNetworkString(size_t capacity=16); bool checkDataSize(Event* event, unsigned int minimum_size); void sendMessageToPeersChangingToken(NetworkString *message, bool reliable = true); diff --git a/src/race/grand_prix_data.cpp b/src/race/grand_prix_data.cpp index 7890406f9..1a662f091 100644 --- a/src/race/grand_prix_data.cpp +++ b/src/race/grand_prix_data.cpp @@ -499,9 +499,9 @@ bool GrandPrixData::isEditable() const unsigned int GrandPrixData::getNumberOfTracks(bool includeLocked) const { if (includeLocked) - return m_tracks.size(); + return (unsigned int)m_tracks.size(); else - return getTrackNames(false).size(); + return (unsigned int)getTrackNames(false).size(); } // getNumberOfTracks // ---------------------------------------------------------------------------- diff --git a/src/scriptengine/script_challenges.cpp b/src/scriptengine/script_challenges.cpp index 792b21697..d1340afaa 100644 --- a/src/scriptengine/script_challenges.cpp +++ b/src/scriptengine/script_challenges.cpp @@ -53,7 +53,7 @@ namespace Scripting /** Get total number of challenges */ int getChallengeCount() { - return ::Track::getCurrentTrack()->getChallengeList().size(); + return (int)::Track::getCurrentTrack()->getChallengeList().size(); } // getChallengeCount // -------------------------------------------------------------------- diff --git a/src/states_screens/arenas_screen.cpp b/src/states_screens/arenas_screen.cpp index 24d90ee93..ff60893de 100644 --- a/src/states_screens/arenas_screen.cpp +++ b/src/states_screens/arenas_screen.cpp @@ -342,7 +342,7 @@ void ArenasScreen::buildTrackList() if (m_unsupported_arena.size() > 0) w->setText( _P("%d arena unavailable in single player.", "%d arenas unavailable in single player.", - m_unsupported_arena.size()) ); + (int)m_unsupported_arena.size()) ); } // ------------------------------------------------------------------------------------------------------ diff --git a/src/states_screens/gp_info_screen.cpp b/src/states_screens/gp_info_screen.cpp index 161de15e8..cfea05eed 100644 --- a/src/states_screens/gp_info_screen.cpp +++ b/src/states_screens/gp_info_screen.cpp @@ -137,7 +137,7 @@ void GPInfoScreen::beforeAddingWidget() race_manager->getMinorMode(), race_manager->getNumLocalPlayers()); - int tracks = m_gp.getTrackNames().size(); + int tracks = (int)m_gp.getTrackNames().size(); bool continue_visible = saved_gp && saved_gp->getNextTrack() > 0 && saved_gp->getNextTrack() < tracks;