From c28728d903ae0ffa0b1a8b1c400b5a228b6e319b Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 23 Sep 2014 16:23:22 +1000 Subject: [PATCH] Removed more compiler warnings for 64 bit windows compilation. --- src/graphics/camera.hpp | 4 ++-- src/graphics/glwrap.cpp | 13 ++++++----- src/graphics/gpuparticles.cpp | 4 ++-- src/graphics/irr_driver.cpp | 2 +- src/graphics/lod_node.cpp | 2 +- src/graphics/post_processing.cpp | 4 ++-- src/graphics/render.cpp | 6 ++--- src/graphics/render_geometry.cpp | 23 +++++++++++-------- src/graphics/render_lighting.cpp | 2 +- src/graphics/shaders_util.hpp | 2 +- src/guiengine/widgets/spinner_widget.cpp | 2 +- src/input/wiimote_manager.hpp | 4 +++- src/io/file_manager.cpp | 4 +++- src/karts/kart_model.cpp | 2 +- src/modes/soccer_world.cpp | 2 +- src/modes/three_strikes_battle.cpp | 2 +- src/modes/world.cpp | 2 +- src/network/game_setup.hpp | 2 +- src/network/network_manager.hpp | 14 +++++------ src/network/network_string.hpp | 2 +- src/network/protocol_manager.cpp | 6 ++--- src/network/protocols/get_public_address.cpp | 2 +- src/online/http_request.hpp | 4 ++-- src/online/online_player_profile.cpp | 2 +- src/race/race_manager.cpp | 10 ++++---- src/states_screens/easter_egg_screen.cpp | 6 ++--- src/states_screens/gp_info_screen.cpp | 4 ++-- .../grand_prix_editor_screen.cpp | 2 +- src/states_screens/kart_selection.cpp | 6 ++--- src/states_screens/race_gui.cpp | 3 ++- src/states_screens/race_gui_overworld.cpp | 3 ++- src/states_screens/race_result_gui.cpp | 2 +- src/states_screens/soccer_setup_screen.cpp | 14 +++++------ 33 files changed, 87 insertions(+), 75 deletions(-) diff --git a/src/graphics/camera.hpp b/src/graphics/camera.hpp index db5937a89..c105ee4d3 100644 --- a/src/graphics/camera.hpp +++ b/src/graphics/camera.hpp @@ -201,7 +201,7 @@ public: LEAK_CHECK() /** Returns the number of cameras used. */ - static unsigned int getNumCameras() { return m_all_cameras.size(); } + static unsigned int getNumCameras() { return (unsigned int)m_all_cameras.size(); } // ------------------------------------------------------------------------ /** Returns a camera. */ @@ -223,7 +223,7 @@ public: */ static Camera* createCamera(AbstractKart* kart) { - Camera *c = new Camera(m_all_cameras.size(), kart); + Camera *c = new Camera((int)m_all_cameras.size(), kart); m_all_cameras.push_back(c); return c; } // createCamera diff --git a/src/graphics/glwrap.cpp b/src/graphics/glwrap.cpp index 6e568eddb..b2bdac849 100644 --- a/src/graphics/glwrap.cpp +++ b/src/graphics/glwrap.cpp @@ -172,7 +172,7 @@ GLuint LoadShader(const char * file, unsigned type) int InfoLogLength; Log::info("GLWrap", "Compiling shader : %s", file); char const * SourcePointer = Code.c_str(); - int length = strlen(SourcePointer); + int length = (int)strlen(SourcePointer); glShaderSource(Id, 1, &SourcePointer, &length); glCompileShader(Id); @@ -366,16 +366,17 @@ FrameBuffer::~FrameBuffer() void FrameBuffer::Bind() { glBindFramebuffer(GL_FRAMEBUFFER, fbo); - glViewport(0, 0, width, height); + glViewport(0, 0, (int)width, (int)height); GLenum bufs[] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2 }; - glDrawBuffers(RenderTargets.size(), bufs); + glDrawBuffers((int)RenderTargets.size(), bufs); } void FrameBuffer::Blit(const FrameBuffer &Src, FrameBuffer &Dst, GLbitfield mask, GLenum filter) { glBindFramebuffer(GL_READ_FRAMEBUFFER, Src.fbo); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, Dst.fbo); - glBlitFramebuffer(0, 0, Src.width, Src.height, 0, 0, Dst.width, Dst.height, mask, filter); + glBlitFramebuffer(0, 0, (int)Src.width, (int)Src.height, 0, 0, + (int)Dst.width, (int)Dst.height, mask, filter); glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); } @@ -384,7 +385,7 @@ void FrameBuffer::BlitToDefault(size_t x0, size_t y0, size_t x1, size_t y1) { glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - glBlitFramebuffer(0, 0, width, height, x0, y0, x1, y1, GL_COLOR_BUFFER_BIT, GL_NEAREST); + glBlitFramebuffer(0, 0, (int)width, (int)height, (int)x0, (int)y0, (int)x1, (int)y1, GL_COLOR_BUFFER_BIT, GL_NEAREST); glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); } @@ -583,7 +584,7 @@ void draw2DImageFromRTT(GLuint texture, size_t texture_w, size_t texture_h, tex_width, tex_height, tex_center_pos_x, tex_center_pos_y; - getSize(texture_w, texture_h, true, + getSize((int)texture_w, (int)texture_h, true, destRect, sourceRect, width, height, center_pos_x, center_pos_y, tex_width, tex_height, tex_center_pos_x, tex_center_pos_y); diff --git a/src/graphics/gpuparticles.cpp b/src/graphics/gpuparticles.cpp index d8e36019e..063ec713d 100644 --- a/src/graphics/gpuparticles.cpp +++ b/src/graphics/gpuparticles.cpp @@ -77,8 +77,8 @@ void ParticleSystemProxy::setHeightmap(const std::vector > &h { track_x = f1, track_z = f2, track_x_len = f3, track_z_len = f4; - unsigned width = hm.size(); - unsigned height = hm[0].size(); + unsigned width = (unsigned)hm.size(); + unsigned height = (unsigned)hm[0].size(); float *hm_array = new float[width * height]; for (unsigned i = 0; i < width; i++) { diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 91b5103e4..74ea167d3 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -2505,7 +2505,7 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy, void IrrDriver::clearLights() { u32 i; - const u32 max = m_lights.size(); + const u32 max = (int)m_lights.size(); for (i = 0; i < max; i++) { m_lights[i]->drop(); diff --git a/src/graphics/lod_node.cpp b/src/graphics/lod_node.cpp index d872668fa..07ffa7251 100644 --- a/src/graphics/lod_node.cpp +++ b/src/graphics/lod_node.cpp @@ -78,7 +78,7 @@ int LODNode::getLevel() scene::ICameraSceneNode* curr_cam = irr_driver->getSceneManager()->getActiveCamera(); Camera* camera = Camera::getActiveCamera(); if (camera == NULL) - return m_detail.size() - 1; + return (int)m_detail.size() - 1; AbstractKart* kart = camera->getKart(); const Vec3 &pos = kart->getFrontXYZ(); diff --git a/src/graphics/post_processing.cpp b/src/graphics/post_processing.cpp index 5bf32eefa..aac0e3d0e 100644 --- a/src/graphics/post_processing.cpp +++ b/src/graphics/post_processing.cpp @@ -352,7 +352,7 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a FullScreenShader::ComputeGaussian17TapHShader::getInstance()->SetTextureUnits({ in_fbo.getRTT()[0], irr_driver->getFBO(FBO_LINEAR_DEPTH).getRTT()[0] }); glBindImageTexture(FullScreenShader::ComputeGaussian17TapHShader::getInstance()->TU_dest, auxiliary.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_R16F); FullScreenShader::ComputeGaussian17TapHShader::getInstance()->setUniforms(core::vector2df(inv_width, inv_height)); - glDispatchCompute(in_fbo.getWidth() / 8 + 1, in_fbo.getHeight() / 8 + 1, 1); + glDispatchCompute((int)in_fbo.getWidth() / 8 + 1, (int)in_fbo.getHeight() / 8 + 1, 1); } } if (irr_driver->hasARBComputeShaders()) @@ -372,7 +372,7 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a FullScreenShader::ComputeGaussian17TapVShader::getInstance()->SetTextureUnits({ auxiliary.getRTT()[0], irr_driver->getFBO(FBO_LINEAR_DEPTH).getRTT()[0] }); glBindImageTexture(FullScreenShader::ComputeGaussian17TapVShader::getInstance()->TU_dest, in_fbo.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_R16F); FullScreenShader::ComputeGaussian17TapVShader::getInstance()->setUniforms(core::vector2df(inv_width, inv_height)); - glDispatchCompute(in_fbo.getWidth() / 8 + 1, in_fbo.getHeight() / 8 + 1, 1); + glDispatchCompute((int)in_fbo.getWidth() / 8 + 1, (int)in_fbo.getHeight() / 8 + 1, 1); } } if (irr_driver->hasARBComputeShaders()) diff --git a/src/graphics/render.cpp b/src/graphics/render.cpp index 0d5997fea..a58330f27 100644 --- a/src/graphics/render.cpp +++ b/src/graphics/render.cpp @@ -223,7 +223,7 @@ void IrrDriver::renderGLSL(float dt) const float *tmp = vertex.data(); for (unsigned int i = 0; i < vertex.size(); i += 1024 * 6) { - unsigned count = MIN2(vertex.size() - i, 1024 * 6); + unsigned count = MIN2((int)vertex.size() - i, 1024 * 6); glBufferSubData(GL_ARRAY_BUFFER, 0, count * sizeof(float), &tmp[i]); glDrawArrays(GL_LINES, 0, count / 3); @@ -842,7 +842,7 @@ void IrrDriver::renderGlow(std::vector& glows) glClearColor(0, 0, 0, 0); glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT); - const u32 glowcount = glows.size(); + const u32 glowcount = (int)glows.size(); ColorizeProvider * const cb = (ColorizeProvider *) m_shaders->m_callbacks[ES_COLORIZE]; glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); @@ -879,7 +879,7 @@ void IrrDriver::renderGlow(std::vector& glows) { glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, (const void*)(GlowPassCmd::getInstance()->Offset * sizeof(DrawElementsIndirectCommand)), - GlowPassCmd::getInstance()->Size, + (int)GlowPassCmd::getInstance()->Size, sizeof(DrawElementsIndirectCommand)); } } diff --git a/src/graphics/render_geometry.cpp b/src/graphics/render_geometry.cpp index c6cfc53f3..295b106bc 100644 --- a/src/graphics/render_geometry.cpp +++ b/src/graphics/render_geometry.cpp @@ -271,7 +271,7 @@ void draw(const T *Shader, const GLMesh *mesh, uniforms... Args) size_t count = mesh->IndexCount; Shader->setUniforms(Args...); - glDrawElementsBaseVertex(ptype, count, itype, (GLvoid *)mesh->vaoOffset, mesh->vaoBaseVertex); + glDrawElementsBaseVertex(ptype, (int)count, itype, (GLvoid *)mesh->vaoOffset, (int)mesh->vaoBaseVertex); } template @@ -371,7 +371,7 @@ void multidraw1stPass(Args...args) T::InstancedFirstPassShader::getInstance()->setUniforms(args...); glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, (const void*)(SolidPassCmd::getInstance()->Offset[T::MaterialType] * sizeof(DrawElementsIndirectCommand)), - SolidPassCmd::getInstance()->Size[T::MaterialType], + (int)SolidPassCmd::getInstance()->Size[T::MaterialType], sizeof(DrawElementsIndirectCommand)); } } @@ -495,8 +495,8 @@ void multidraw2ndPass(const std::vector &Handles, Args... args) T::InstancedSecondPassShader::getInstance()->setUniforms(args...); glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, (const void*)(SolidPassCmd::getInstance()->Offset[T::MaterialType] * sizeof(DrawElementsIndirectCommand)), - SolidPassCmd::getInstance()->Size[T::MaterialType], - sizeof(DrawElementsIndirectCommand)); + (int)SolidPassCmd::getInstance()->Size[T::MaterialType], + (int)sizeof(DrawElementsIndirectCommand)); } } @@ -739,7 +739,8 @@ void IrrDriver::renderTransparent() glUseProgram(MeshShader::DisplaceMaskShader::getInstance()->Program); MeshShader::DisplaceMaskShader::getInstance()->setUniforms(AbsoluteTransformation); - glDrawElementsBaseVertex(ptype, count, itype, (GLvoid *)mesh.vaoOffset, mesh.vaoBaseVertex); + glDrawElementsBaseVertex(ptype, (int)count, itype, + (GLvoid *)mesh.vaoOffset, (int)mesh.vaoBaseVertex); } irr_driver->getFBO(FBO_DISPLACE).Bind(); @@ -768,7 +769,7 @@ void IrrDriver::renderTransparent() core::vector2df(cb->getDirX(), cb->getDirY()), core::vector2df(cb->getDir2X(), cb->getDir2Y())); - glDrawElementsBaseVertex(ptype, count, itype, (GLvoid *)mesh.vaoOffset, mesh.vaoBaseVertex); + glDrawElementsBaseVertex(ptype, (int)count, itype, (GLvoid *)mesh.vaoOffset, (int)mesh.vaoBaseVertex); } irr_driver->getFBO(FBO_COLORS).Bind(); @@ -787,7 +788,7 @@ void drawShadow(const T *Shader, unsigned cascade, const GLMesh *mesh, uniforms. size_t count = mesh->IndexCount; Shader->setUniforms(cascade, Args...); - glDrawElementsBaseVertex(ptype, count, itype, (GLvoid *)mesh->vaoOffset, mesh->vaoBaseVertex); + glDrawElementsBaseVertex(ptype, (int)count, itype, (GLvoid *)mesh->vaoOffset, (int)mesh->vaoBaseVertex); } template @@ -871,7 +872,9 @@ static void multidrawShadow(unsigned i, Args ...args) if (ShadowPassCmd::getInstance()->Size[i][Mat]) { Shader::getInstance()->setUniforms(i, args...); - glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, (const void*)(ShadowPassCmd::getInstance()->Offset[i][Mat] * sizeof(DrawElementsIndirectCommand)), ShadowPassCmd::getInstance()->Size[i][Mat], sizeof(DrawElementsIndirectCommand)); + glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, + (const void*)(ShadowPassCmd::getInstance()->Offset[i][Mat] * sizeof(DrawElementsIndirectCommand)), + (int)ShadowPassCmd::getInstance()->Size[i][Mat], sizeof(DrawElementsIndirectCommand)); } } @@ -1003,7 +1006,9 @@ void multidrawRSM(Args...args) if (RSMPassCmd::getInstance()->Size[Mat]) { Shader::getInstance()->setUniforms(args...); - glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, (const void*)(RSMPassCmd::getInstance()->Offset[Mat] * sizeof(DrawElementsIndirectCommand)), RSMPassCmd::getInstance()->Size[Mat], sizeof(DrawElementsIndirectCommand)); + glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, + (const void*)(RSMPassCmd::getInstance()->Offset[Mat] * sizeof(DrawElementsIndirectCommand)), + (int)RSMPassCmd::getInstance()->Size[Mat], sizeof(DrawElementsIndirectCommand)); } } diff --git a/src/graphics/render_lighting.cpp b/src/graphics/render_lighting.cpp index 56f1b6b0e..710f1c3b3 100644 --- a/src/graphics/render_lighting.cpp +++ b/src/graphics/render_lighting.cpp @@ -57,7 +57,7 @@ static void renderPointLights(unsigned count) unsigned IrrDriver::UpdateLightsInfo(scene::ICameraSceneNode * const camnode, float dt) { - const u32 lightcount = m_lights.size(); + const u32 lightcount = (u32)m_lights.size(); const core::vector3df &campos = camnode->getAbsolutePosition(); std::vector BucketedLN[15]; diff --git a/src/graphics/shaders_util.hpp b/src/graphics/shaders_util.hpp index 31778f70b..6b1563bed 100644 --- a/src/graphics/shaders_util.hpp +++ b/src/graphics/shaders_util.hpp @@ -79,7 +79,7 @@ struct UniformHelper template static void setUniformsHelper(const std::vector &uniforms, const std::vector &v, Args... arg) { - glUniform1fv(uniforms[N], v.size(), v.data()); + glUniform1fv(uniforms[N], (int)v.size(), v.data()); setUniformsHelper(uniforms, arg...); } diff --git a/src/guiengine/widgets/spinner_widget.cpp b/src/guiengine/widgets/spinner_widget.cpp index 25329645d..451bf21b3 100644 --- a/src/guiengine/widgets/spinner_widget.cpp +++ b/src/guiengine/widgets/spinner_widget.cpp @@ -376,7 +376,7 @@ stringw SpinnerWidget::getStringValue() const void SpinnerWidget::setValue(irr::core::stringw new_value) { - const int size = m_labels.size(); + const int size = (int)m_labels.size(); for (int n=0; ncreateMemoryReadFile(b, content.size(), "tempfile", true); + io::IReadFile * ireadfile = + m_file_system->createMemoryReadFile(b, (int)content.size(), + "tempfile", true); io::IXMLReader * reader = m_file_system->createXMLReader(ireadfile); XMLNode* node = new XMLNode(reader); reader->drop(); diff --git a/src/karts/kart_model.cpp b/src/karts/kart_model.cpp index fe7e85e05..464acb111 100644 --- a/src/karts/kart_model.cpp +++ b/src/karts/kart_model.cpp @@ -390,7 +390,7 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim // Enable rim lighting for the kart irr_driver->applyObjectPassShader(lod_node, true); std::vector &lodnodes = lod_node->getAllNodes(); - const u32 max = lodnodes.size(); + const u32 max = (u32)lodnodes.size(); for (u32 i = 0; i < max; i++) { irr_driver->applyObjectPassShader(lodnodes[i], true); diff --git a/src/modes/soccer_world.cpp b/src/modes/soccer_world.cpp index 4b7e2cd8e..c853570fe 100644 --- a/src/modes/soccer_world.cpp +++ b/src/modes/soccer_world.cpp @@ -401,7 +401,7 @@ void SoccerWorld::moveKartAfterRescue(AbstractKart* kart) /** Set position and team for the karts */ void SoccerWorld::initKartList() { - const unsigned int kart_amount = m_karts.size(); + const unsigned int kart_amount = (unsigned int)m_karts.size(); int team_karts_amount[NB_SOCCER_TEAMS]; memset(team_karts_amount, 0, sizeof(team_karts_amount)); diff --git a/src/modes/three_strikes_battle.cpp b/src/modes/three_strikes_battle.cpp index ceb413a27..7c1d3937a 100644 --- a/src/modes/three_strikes_battle.cpp +++ b/src/modes/three_strikes_battle.cpp @@ -88,7 +88,7 @@ void ThreeStrikesBattle::reset() { WorldWithRank::reset(); - const unsigned int kart_amount = m_karts.size(); + const unsigned int kart_amount = (unsigned int)m_karts.size(); for(unsigned int n=0; n getPlayers() { return m_players; } - int getPlayerCount() { return m_players.size(); } + int getPlayerCount() { return (int)m_players.size(); } /*! \brief Get a network player profile matching a universal id. * \param id : Global id of the player (the one in the SQL database) * \return The profile of the player matching the id. diff --git a/src/network/network_manager.hpp b/src/network/network_manager.hpp index 80cd42210..13ae87f15 100644 --- a/src/network/network_manager.hpp +++ b/src/network/network_manager.hpp @@ -98,13 +98,13 @@ class NetworkManager : public AbstractSingleton virtual bool isConnectedTo(TransportAddress peer); virtual bool isServer() = 0; - inline bool isClient() { return !isServer(); } - bool isPlayingOnline() { return m_playing_online; } - STKHost* getHost() { return m_localhost; } - std::vector getPeers() { return m_peers; } - unsigned int getPeerCount() { return m_peers.size(); } - TransportAddress getPublicAddress() { return m_public_address; } - GameSetup* getGameSetup() { return m_game_setup; } + inline bool isClient() { return !isServer(); } + bool isPlayingOnline() { return m_playing_online; } + STKHost* getHost() { return m_localhost; } + std::vector getPeers() { return m_peers; } + unsigned int getPeerCount() { return (int)m_peers.size(); } + TransportAddress getPublicAddress() { return m_public_address; } + GameSetup* getGameSetup() { return m_game_setup; } protected: NetworkManager(); diff --git a/src/network/network_string.hpp b/src/network/network_string.hpp index b1616f430..188455725 100644 --- a/src/network/network_string.hpp +++ b/src/network/network_string.hpp @@ -154,7 +154,7 @@ class NetworkString int size() const { - return m_string.size(); + return (int)m_string.size(); } uint8_t* getBytes() { return &m_string[0]; }; diff --git a/src/network/protocol_manager.cpp b/src/network/protocol_manager.cpp index 967540a71..75b623a82 100644 --- a/src/network/protocol_manager.cpp +++ b/src/network/protocol_manager.cpp @@ -357,7 +357,7 @@ void ProtocolManager::update() { // before updating, notice protocols that they have received events pthread_mutex_lock(&m_events_mutex); // secure threads - int size = m_events_to_process.size(); + int size = (int)m_events_to_process.size(); int offset = 0; for (int i = 0; i < size; i++) { @@ -383,7 +383,7 @@ void ProtocolManager::asynchronousUpdate() { // before updating, notice protocols that they have received information pthread_mutex_lock(&m_events_mutex); // secure threads - int size = m_events_to_process.size(); + int size = (int)m_events_to_process.size(); int offset = 0; for (int i = 0; i < size; i++) { @@ -435,7 +435,7 @@ void ProtocolManager::asynchronousUpdate() int ProtocolManager::runningProtocolsCount() { - return m_protocols.size(); + return (int)m_protocols.size(); } PROTOCOL_STATE ProtocolManager::getProtocolState(uint32_t id) diff --git a/src/network/protocols/get_public_address.cpp b/src/network/protocols/get_public_address.cpp index 8e4095065..29885bbbf 100644 --- a/src/network/protocols/get_public_address.cpp +++ b/src/network/protocols/get_public_address.cpp @@ -111,7 +111,7 @@ void GetPublicAddress::asynchronousUpdate() std::vector stun_servers = UserConfigParams::m_stun_servers; RandomGenerator random_gen; - int rand_result = random_gen.get(stun_servers.size()); + int rand_result = random_gen.get((int)stun_servers.size()); Log::verbose("GetPublicAddress", "Using STUN server %s", stun_servers[rand_result].c_str()); diff --git a/src/online/http_request.hpp b/src/online/http_request.hpp index faba9f49d..7383b047f 100644 --- a/src/online/http_request.hpp +++ b/src/online/http_request.hpp @@ -147,8 +147,8 @@ namespace Online assert(isPreparing()); std::string s = StringUtils::toString(value); - char *s1 = curl_easy_escape(m_curl_session, name.c_str(), name.size()); - char *s2 = curl_easy_escape(m_curl_session, s.c_str(), s.size()); + char *s1 = curl_easy_escape(m_curl_session, name.c_str(), (int)name.size()); + char *s2 = curl_easy_escape(m_curl_session, s.c_str(), (int)s.size()); m_parameters.append(std::string(s1) + "=" + s2 + "&"); curl_free(s1); curl_free(s2); diff --git a/src/online/online_player_profile.cpp b/src/online/online_player_profile.cpp index 8fa3d4222..842ac0e0c 100644 --- a/src/online/online_player_profile.cpp +++ b/src/online/online_player_profile.cpp @@ -400,7 +400,7 @@ namespace Online else if(to_notify.size() > 3) { message = _("%d friends are now online.", - to_notify.size()); + (int)to_notify.size()); } MessageQueue::add(MessageQueue::MT_FRIEND, message); } diff --git a/src/race/race_manager.cpp b/src/race/race_manager.cpp index d6eeaf72e..2c77233ea 100644 --- a/src/race/race_manager.cpp +++ b/src/race/race_manager.cpp @@ -352,7 +352,7 @@ void RaceManager::startNew(bool from_overworld) m_grand_prix.getId(), m_difficulty, m_num_karts, - m_player_karts.size()); + (int)m_player_karts.size()); // Start the race with the appropriate track // ========================================= @@ -503,7 +503,7 @@ void RaceManager::next() m_grand_prix.getId(), m_difficulty, m_num_karts, - m_player_karts.size()); + (int)m_player_karts.size()); if(gp != NULL) { //if so addept it @@ -519,7 +519,7 @@ void RaceManager::next() ->getUniqueID(), m_grand_prix.getId(), m_difficulty, - m_player_karts.size(), + (int)m_player_karts.size(), m_track_number, m_kart_status ) @@ -639,7 +639,7 @@ void RaceManager::exitRace(bool delete_world) m_grand_prix.getId(), m_difficulty, m_num_karts, - m_player_karts.size()); + (int)m_player_karts.size()); if(gp != NULL) gp->remove(); } StateManager::get()->resetAndGoToScreen( MainMenuScreen::getInstance() ); @@ -816,7 +816,7 @@ void RaceManager::setupPlayerKartInfo() std::sort(kart_info.begin(), kart_info.end()); // Set the player kart information - setNumPlayers(kart_info.size()); + setNumPlayers((int)kart_info.size()); // Set the global player ID for each player for(unsigned int i=0; iclearAllChildren(); const std::vector& groups = track_manager->getAllTrackGroups(); - const int group_amount = groups.size(); + const int group_amount = (int)groups.size(); if (group_amount > 1) { @@ -210,7 +210,7 @@ void EasterEggScreen::buildTrackList() // Build track list if (curr_group_name == ALL_TRACK_GROUPS_ID) { - const int trackAmount = track_manager->getNumberOfTracks(); + const int trackAmount = (int)track_manager->getNumberOfTracks(); for (int n=0; n& curr_group = track_manager->getTracksInGroup( curr_group_name ); - const int trackAmount = curr_group.size(); + const int trackAmount = (int)curr_group.size(); for (int n=0; ngetNumberOfRaceTracks() - : track_manager->getTracksInGroup(m_group_name).size(); + : (int)track_manager->getTracksInGroup(m_group_name).size(); m_num_tracks_spinner->setMax(max_num_tracks); if(m_num_tracks_spinner->getValue() > max_num_tracks) { @@ -310,7 +310,7 @@ void GPInfoScreen::eventCallback(Widget *, const std::string &name, // can be bigger than the maximum. (Might be a TODO to fix this) int max_num_tracks = m_group_name=="all" ? track_manager->getNumberOfRaceTracks() - : track_manager->getTracksInGroup(m_group_name).size(); + : (int)track_manager->getTracksInGroup(m_group_name).size(); m_num_tracks_spinner->setMax(max_num_tracks); if (m_num_tracks_spinner->getValue() > max_num_tracks) m_num_tracks_spinner->setValue(max_num_tracks); diff --git a/src/states_screens/grand_prix_editor_screen.cpp b/src/states_screens/grand_prix_editor_screen.cpp index 0e2b5c536..b60244db3 100644 --- a/src/states_screens/grand_prix_editor_screen.cpp +++ b/src/states_screens/grand_prix_editor_screen.cpp @@ -181,7 +181,7 @@ void GrandPrixEditorScreen::loadTrackList (const std::string& gpname) const std::vector tracks = gp->getTrackNames(true); tracks_widget->clearItems(); - tracks_widget->setItemCountHint(tracks.size()); + tracks_widget->setItemCountHint((int)tracks.size()); for (unsigned int t = 0; t < tracks.size(); t++) { Track* curr = track_manager->getTrack(tracks[t]); diff --git a/src/states_screens/kart_selection.cpp b/src/states_screens/kart_selection.cpp index 84304e083..f38fcd201 100644 --- a/src/states_screens/kart_selection.cpp +++ b/src/states_screens/kart_selection.cpp @@ -360,7 +360,7 @@ PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent, kart_model.getWheelGraphicsPosition(3) ); for(size_t i=0 ; i < kart_model.getSpeedWeightedObjectsCount() ; i++) { - const SpeedWeightedObject& obj = kart_model.getSpeedWeightedObject(i); + const SpeedWeightedObject& obj = kart_model.getSpeedWeightedObject((int)i); m_model_view->addModel(obj.m_model, obj.m_position); } m_model_view->setRotateContinuously( 35.0f ); @@ -1601,7 +1601,7 @@ void KartSelectionScreen::updateKartWidgetModel(uint8_t widget_id, kart_model.getWheelGraphicsPosition(3) ); for (size_t i = 0; i < kart_model.getSpeedWeightedObjectsCount(); i++) { - const SpeedWeightedObject& obj = kart_model.getSpeedWeightedObject(i); + const SpeedWeightedObject& obj = kart_model.getSpeedWeightedObject((int)i); w3->addModel(obj.m_model, obj.m_position); } w3->update(0); @@ -1989,7 +1989,7 @@ bool KartSelectionScreen::validateKartChoices() // players than karts then just allow duplicates DynamicRibbonWidget* w = getWidget("karts"); assert( w != NULL ); - const unsigned int availableKartCount = w->getItems().size(); + const unsigned int availableKartCount = (unsigned int)w->getItems().size(); if (amount > availableKartCount) return true; // Check everyone for duplicates diff --git a/src/states_screens/race_gui.cpp b/src/states_screens/race_gui.cpp index fddfa5705..5accb0fd0 100644 --- a/src/states_screens/race_gui.cpp +++ b/src/states_screens/race_gui.cpp @@ -362,7 +362,8 @@ void RaceGUI::drawGlobalMiniMap() } else if (new_rtt_mini_map != NULL) { - core::rect source(0, 0, new_rtt_mini_map->getWidth(), new_rtt_mini_map->getHeight()); + core::rect source(0, 0, (int)new_rtt_mini_map->getWidth(), + (int)new_rtt_mini_map->getHeight()); draw2DImageFromRTT(new_rtt_mini_map->getRTT()[0], new_rtt_mini_map->getWidth(), new_rtt_mini_map->getHeight(), dest, source, NULL, video::SColor(127, 255, 255, 255), true); diff --git a/src/states_screens/race_gui_overworld.cpp b/src/states_screens/race_gui_overworld.cpp index cdef71b1e..6301ef6e5 100644 --- a/src/states_screens/race_gui_overworld.cpp +++ b/src/states_screens/race_gui_overworld.cpp @@ -337,7 +337,8 @@ void RaceGUIOverworld::drawGlobalMiniMap() } else if (new_rtt_mini_map != NULL) { - core::rect source(0, 0, new_rtt_mini_map->getWidth(), new_rtt_mini_map->getHeight()); + core::rect source(0, 0, (int)new_rtt_mini_map->getWidth(), + (int)new_rtt_mini_map->getHeight()); draw2DImageFromRTT(new_rtt_mini_map->getRTT()[0], new_rtt_mini_map->getWidth(), new_rtt_mini_map->getHeight(), dest, source, NULL, video::SColor(127, 255, 255, 255), true); diff --git a/src/states_screens/race_result_gui.cpp b/src/states_screens/race_result_gui.cpp index 45b0b6035..8b568dc8b 100644 --- a/src/states_screens/race_result_gui.cpp +++ b/src/states_screens/race_result_gui.cpp @@ -94,7 +94,7 @@ void RaceResultGUI::init() // Calculate screenshot scrolling parameters const std::vector tracks = race_manager->getGrandPrix().getTrackNames(); - int n_tracks = tracks.size(); + int n_tracks = (int)tracks.size(); int currentTrack = race_manager->getTrackNumber(); m_start_track = currentTrack; if (n_tracks > m_max_tracks) diff --git a/src/states_screens/soccer_setup_screen.cpp b/src/states_screens/soccer_setup_screen.cpp index e3be1f18e..e4c80d8e5 100644 --- a/src/states_screens/soccer_setup_screen.cpp +++ b/src/states_screens/soccer_setup_screen.cpp @@ -63,7 +63,7 @@ void SoccerSetupScreen::eventCallback(Widget* widget, const std::string& name, if(name == "continue") { - int nb_players = m_kart_view_info.size(); + int nb_players = (int)m_kart_view_info.size(); if (getNumKartsInTeam(SOCCER_TEAM_RED) == 0 || getNumKartsInTeam(SOCCER_TEAM_BLUE) == 0) @@ -266,7 +266,7 @@ GUIEngine::EventPropagation SoccerSetupScreen::filterActions(PlayerAction action ButtonWidget* bt_continue = getWidget("continue"); GUIEngine::EventPropagation result = EVENT_LET; SoccerTeam team_switch = SOCCER_TEAM_NONE; - int nb_players = m_kart_view_info.size(); + int nb_players = (int)m_kart_view_info.size(); switch(action) { @@ -373,7 +373,7 @@ GUIEngine::EventPropagation SoccerSetupScreen::filterActions(PlayerAction action // ----------------------------------------------------------------------------- void SoccerSetupScreen::onUpdate(float delta) { - int nb_players = m_kart_view_info.size(); + int nb_players = (int)m_kart_view_info.size(); if(m_schedule_continue) { @@ -391,7 +391,7 @@ void SoccerSetupScreen::onUpdate(float delta) bool SoccerSetupScreen::areAllKartsConfirmed() const { bool all_confirmed = true; - int nb_players = m_kart_view_info.size(); + int nb_players = (int)m_kart_view_info.size(); for(int i=0 ; i < nb_players ; i++) { if(!m_kart_view_info[i].confirmed) @@ -407,7 +407,7 @@ bool SoccerSetupScreen::areAllKartsConfirmed() const int SoccerSetupScreen::getNumKartsInTeam(int team) { int karts_in_team = 0; - int nb_players = m_kart_view_info.size(); + int nb_players = (int)m_kart_view_info.size(); for(int i=0 ; i < nb_players ; i++) { if(m_kart_view_info[i].team == team) @@ -420,7 +420,7 @@ int SoccerSetupScreen::getNumKartsInTeam(int team) int SoccerSetupScreen::getNumConfirmedKarts() { int confirmed_karts = 0; - int nb_players = m_kart_view_info.size(); + int nb_players = (int)m_kart_view_info.size(); for(int i=0 ; i < nb_players ; i++) { if(m_kart_view_info[i].confirmed == true) @@ -444,7 +444,7 @@ void SoccerSetupScreen::updateKartViewsLayout() const int center_y = central_div->m_y + central_div->m_h/2; // Count the number of karts per team - int nb_players = m_kart_view_info.size(); + int nb_players = (int)m_kart_view_info.size(); int nb_karts_per_team[2] = {0,0}; for(int i=0 ; i < nb_players ; i++) nb_karts_per_team[m_kart_view_info[i].team]++;