From 8a1d0bae34767839a6ffc6a2d65afecc39d2c35a Mon Sep 17 00:00:00 2001 From: hiker Date: Fri, 7 Apr 2017 00:41:08 +1000 Subject: [PATCH] Fixed some 64-bit related compiler warnings on VS. --- lib/bullet/src/LinearMath/btSerializer.h | 6 +++--- src/graphics/material.hpp | 2 +- src/graphics/render_info.hpp | 5 ++++- src/guiengine/abstract_state_manager.hpp | 5 ++++- src/network/network_string.hpp | 2 +- src/utils/ptr_vector.hpp | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/bullet/src/LinearMath/btSerializer.h b/lib/bullet/src/LinearMath/btSerializer.h index 689449a73..0b2dc1087 100644 --- a/lib/bullet/src/LinearMath/btSerializer.h +++ b/lib/bullet/src/LinearMath/btSerializer.h @@ -213,7 +213,7 @@ protected: int *intPtr=0; short *shtPtr=0; -#ifdef __MINGW64__ +#if defined(__MINGW64__) || defined(_WIN64) char *cp = 0;int dataLen =0;intptr_t nr=0; #else char *cp = 0;int dataLen =0;long nr=0; @@ -251,7 +251,7 @@ protected: cp++; } { -#ifdef __MINGW64__ +#if defined(__MINGW64__) || defined(_WIN64) nr= (intptr_t)cp; #else nr= (long)cp; @@ -290,7 +290,7 @@ protected: } { -#ifdef __MINGW64__ +#if defined(__MINGW64__) || defined(_WIN64) nr= (intptr_t)cp; #else nr= (long)cp; diff --git a/src/graphics/material.hpp b/src/graphics/material.hpp index c8f52aa5b..7a873689e 100644 --- a/src/graphics/material.hpp +++ b/src/graphics/material.hpp @@ -317,7 +317,7 @@ public: { if (m_hue_settings.empty()) return 0.0f; - const unsigned int hue = m_random_hue.get(m_hue_settings.size()); + const unsigned int hue = m_random_hue.get((int)m_hue_settings.size()); assert(hue < m_hue_settings.size()); return m_hue_settings[hue]; } diff --git a/src/graphics/render_info.hpp b/src/graphics/render_info.hpp index fe669b091..4bd5f7f91 100644 --- a/src/graphics/render_info.hpp +++ b/src/graphics/render_info.hpp @@ -76,7 +76,10 @@ public: */ bool isStatic() const { return m_dynamic_hue.empty(); } // ------------------------------------------------------------------------ - unsigned int getNumberOfHue() const { return m_dynamic_hue.size(); } + unsigned int getNumberOfHue() const + { + return (unsigned int)m_dynamic_hue.size(); + } // getNumberOfHue // ------------------------------------------------------------------------ float getDynamicHue(unsigned int hue) const { diff --git a/src/guiengine/abstract_state_manager.hpp b/src/guiengine/abstract_state_manager.hpp index cd5d4d5e4..91a794def 100644 --- a/src/guiengine/abstract_state_manager.hpp +++ b/src/guiengine/abstract_state_manager.hpp @@ -170,7 +170,10 @@ namespace GUIEngine // -------------------------------------------------------------------- /** Returns the number of screens on the stack. Is used to decide * if exiting a screen would cause STK to end or not. */ - unsigned int getMenuStackSize() const { return m_menu_stack.size(); } + unsigned int getMenuStackSize() const + { + return (unsigned int)m_menu_stack.size(); + } }; // Class AbstractStateManager } // GUIEngine diff --git a/src/network/network_string.hpp b/src/network/network_string.hpp index 0c521107a..4e2239259 100644 --- a/src/network/network_string.hpp +++ b/src/network/network_string.hpp @@ -171,7 +171,7 @@ public: * difference to size() happens if the string to be sent was previously * read, and has m_current_offset != 0. Even in this case the whole * string must be sent. */ - unsigned int getTotalSize() const { return m_buffer.size(); } + unsigned int getTotalSize() const { return (unsigned int)m_buffer.size(); } // ------------------------------------------------------------------------ // All functions related to adding data to a network string /** Add 8 bit unsigned int. */ diff --git a/src/utils/ptr_vector.hpp b/src/utils/ptr_vector.hpp index 23347185b..53bba80e5 100644 --- a/src/utils/ptr_vector.hpp +++ b/src/utils/ptr_vector.hpp @@ -161,7 +161,7 @@ public: { TYPE * pointer = m_contents_vector[n]; delete pointer; - m_contents_vector[n] = (TYPE*)0xDEADBEEF; + m_contents_vector[n] = (TYPE*)(intptr_t)0xDEADBEEF; // When deleting, it's important that the same pointer cannot be // twice in the vector, resulting in a double delete