From 37e7c73f439c0d8cbfd0f1c02b7ef5916fd748ae Mon Sep 17 00:00:00 2001 From: erihel Date: Sat, 22 Sep 2012 11:48:41 +0200 Subject: [PATCH] * Removed some warnings --- lib/simpleini/SimpleIni.h | 18 +++++++++--------- src/CBot/CBotString.cpp | 2 +- src/ui/key.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/simpleini/SimpleIni.h b/lib/simpleini/SimpleIni.h index c75408e3..ab4749f6 100644 --- a/lib/simpleini/SimpleIni.h +++ b/lib/simpleini/SimpleIni.h @@ -2861,16 +2861,16 @@ public: // the distribution but are publically available from unicode.org // at http://www.unicode.org/Public/PROGRAMS/CVTUTF/ ConversionResult retval; - const UTF8 * pUtf8 = (const UTF8 *) a_pInputData; + const UTF8 * pUtf8 = static_cast(a_pInputData); if (sizeof(wchar_t) == sizeof(UTF32)) { - UTF32 * pUtf32 = (UTF32 *) a_pOutputData; + UTF32 * pUtf32 = static_cast(a_pOutputData); retval = ConvertUTF8toUTF32( &pUtf8, pUtf8 + a_uInputDataLen, &pUtf32, pUtf32 + a_uOutputDataSize, lenientConversion); } else if (sizeof(wchar_t) == sizeof(UTF16)) { - UTF16 * pUtf16 = (UTF16 *) a_pOutputData; + UTF16 * pUtf16 = static_cast(a_pOutputData); retval = ConvertUTF8toUTF16( &pUtf8, pUtf8 + a_uInputDataLen, &pUtf16, pUtf16 + a_uOutputDataSize, @@ -2881,7 +2881,7 @@ public: else { size_t retval = mbstowcs(a_pOutputData, a_pInputData, a_uOutputDataSize); - return retval != (size_t)(-1); + return retval != static_cast(-1); } } @@ -2908,7 +2908,7 @@ public: } else { size_t uLen = wcstombs(NULL, a_pInputData, 0); - if (uLen == (size_t)(-1)) { + if (uLen == static_cast(-1)) { return uLen; } return uLen + 1; // include NULL terminator @@ -2948,16 +2948,16 @@ public: // the distribution but are publically available from unicode.org // at http://www.unicode.org/Public/PROGRAMS/CVTUTF/ ConversionResult retval; - UTF8 * pUtf8 = (UTF8 *) a_pOutputData; + UTF8 * pUtf8 = static_cast (a_pOutputData); if (sizeof(wchar_t) == sizeof(UTF32)) { - const UTF32 * pUtf32 = (const UTF32 *) a_pInputData; + const UTF32 * pUtf32 = static_cast (a_pInputData); retval = ConvertUTF32toUTF8( &pUtf32, pUtf32 + uInputLen, &pUtf8, pUtf8 + a_uOutputDataSize, lenientConversion); } else if (sizeof(wchar_t) == sizeof(UTF16)) { - const UTF16 * pUtf16 = (const UTF16 *) a_pInputData; + const UTF16 * pUtf16 = static_cast (a_pInputData); retval = ConvertUTF16toUTF8( &pUtf16, pUtf16 + uInputLen, &pUtf8, pUtf8 + a_uOutputDataSize, @@ -2968,7 +2968,7 @@ public: else { size_t retval = wcstombs(a_pOutputData, a_pInputData, a_uOutputDataSize); - return retval != (size_t) -1; + return retval != static_cast (-1); } } }; diff --git a/src/CBot/CBotString.cpp b/src/CBot/CBotString.cpp index 84f9ca2f..e52cd05f 100644 --- a/src/CBot/CBotString.cpp +++ b/src/CBot/CBotString.cpp @@ -188,7 +188,7 @@ CBotString CBotString::Right(int nCount) const if ( i < 0 ) i = 0; int j; - for (int j = 0 ; i < m_lg && i < 1999; ++i) + for (j = 0 ; i < m_lg && i < 1999; ++i) { chain[j++] = m_ptr[i]; } diff --git a/src/ui/key.h b/src/ui/key.h index be28b6ef..1943f611 100644 --- a/src/ui/key.h +++ b/src/ui/key.h @@ -50,7 +50,7 @@ class CKey : public CControl protected: bool TestKey(int key); - int m_key[2]; + unsigned int m_key[2]; bool m_bCatch; CApplication *m_app;