Fixed some 64-bit related compiler warnings on VS.

This commit is contained in:
hiker 2017-04-07 00:41:08 +10:00
parent 5e5d86bc6d
commit 8a1d0bae34
6 changed files with 14 additions and 8 deletions

View File

@ -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;

View File

@ -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];
}

View File

@ -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
{

View File

@ -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

View File

@ -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. */

View File

@ -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