Преглед изворни кода

Rename ToUInt64(String) etc to ToU64(String) etc

1vanK пре 3 година
родитељ
комит
b6058dc478
35 измењених фајлова са 113 додато и 113 уклоњено
  1. 1 1
      Source/Samples/41_DatabaseDemo/DatabaseDemo.cpp
  2. 1 1
      Source/Samples/52_NATPunchtrough/NATPunchtrough.cpp
  3. 3 3
      Source/Tools/AssetImporter/AssetImporter.cpp
  4. 1 1
      Source/Tools/OgreImporter/OgreImporter.cpp
  5. 6 6
      Source/Tools/RampGenerator/RampGenerator.cpp
  6. 6 6
      Source/Tools/SpritePacker/SpritePacker.cpp
  7. 4 4
      Source/Urho3D/AngelScript/CoreAPI.cpp
  8. 12 12
      Source/Urho3D/AngelScript/Generated_GlobalFunctions.cpp
  9. 2 2
      Source/Urho3D/Core/ProcessUtils.cpp
  10. 14 14
      Source/Urho3D/Core/StringUtils.cpp
  11. 10 10
      Source/Urho3D/Core/StringUtils.h
  12. 2 2
      Source/Urho3D/Core/Variant.cpp
  13. 12 12
      Source/Urho3D/Engine/Engine.cpp
  14. 1 1
      Source/Urho3D/Graphics/Material.cpp
  15. 2 2
      Source/Urho3D/Graphics/Terrain.cpp
  16. 1 1
      Source/Urho3D/GraphicsAPI/OpenGL/OGLShaderProgram.cpp
  17. 2 2
      Source/Urho3D/Input/Input.cpp
  18. 2 2
      Source/Urho3D/Math/BigInt.cpp
  19. 1 1
      Source/Urho3D/Network/HttpRequest.cpp
  20. 1 1
      Source/Urho3D/Resource/JSONValue.cpp
  21. 1 1
      Source/Urho3D/Resource/PListFile.cpp
  22. 6 6
      Source/Urho3D/Resource/XMLElement.cpp
  23. 2 2
      Source/Urho3D/Scene/Node.cpp
  24. 1 1
      Source/Urho3D/UI/UIElement.cpp
  25. 1 1
      Source/Urho3D/Urho2D/TmxFile2D.cpp
  26. 1 1
      bin/Data/Scripts/41_DatabaseDemo.as
  27. 1 1
      bin/Data/Scripts/52_NATPunchtrough.as
  28. 3 3
      bin/Data/Scripts/Editor/AttributeEditor.as
  29. 3 3
      bin/Data/Scripts/Editor/EditorImport.as
  30. 2 2
      bin/Data/Scripts/Editor/EditorMaterial.as
  31. 1 1
      bin/Data/Scripts/Editor/EditorParticleEffect.as
  32. 2 2
      bin/Data/Scripts/Editor/EditorPreferences.as
  33. 2 2
      bin/Data/Scripts/Editor/EditorSettings.as
  34. 2 2
      bin/Data/Scripts/Editor/EditorSpawn.as
  35. 1 1
      bin/Data/Scripts/Editor/EditorTerrain.as

+ 1 - 1
Source/Samples/41_DatabaseDemo/DatabaseDemo.cpp

@@ -159,7 +159,7 @@ void DatabaseDemo::HandleInput(const String& input)
         if (input.StartsWith("set") && tokens.Size() > 1)
         {
             if (setting == "maxrows")
-                maxRows_ = Max(ToUInt(tokens[1]), 1U);
+                maxRows_ = Max(ToU32(tokens[1]), 1U);
             else if (setting == "connstr")
             {
                 String newConnectionString(input.Substring(input.Find(" ", input.Find("connstr")) + 1));

+ 1 - 1
Source/Samples/52_NATPunchtrough/NATPunchtrough.cpp

@@ -171,7 +171,7 @@ void NATPunchtrough::ShowLogMessage(const String& row)
 void NATPunchtrough::HandleSaveNatSettings(StringHash eventType, VariantMap& eventData)
 {
     // Save NAT server configuration
-    GetSubsystem<Network>()->SetNATServerInfo(natServerAddress_->GetText(), ToInt(natServerPort_->GetText()));
+    GetSubsystem<Network>()->SetNATServerInfo(natServerAddress_->GetText(), ToI32(natServerPort_->GetText()));
     ShowLogMessage("Saving NAT settings: " + natServerAddress_->GetText() + ":" + natServerPort_->GetText());
 }
 

+ 3 - 3
Source/Tools/AssetImporter/AssetImporter.cpp

@@ -388,7 +388,7 @@ void Run(const Vector<String>& arguments)
             }
             else if (argument == "mb" && !value.Empty())
             {
-                maxBones_ = ToUInt(value);
+                maxBones_ = ToU32(value);
                 if (maxBones_ < 1)
                     maxBones_ = 1;
                 ++i;
@@ -1960,7 +1960,7 @@ void CopyTextures(const HashSet<String>& usedTextures, const String& sourcePath)
         // Handle assimp embedded textures
         if (i->Length() && i->At(0) == '*')
         {
-            unsigned texIndex = ToInt(i->Substring(1));
+            unsigned texIndex = ToI32(i->Substring(1));
             if (texIndex >= scene_->mNumTextures)
                 PrintLine("Skipping out of range texture index " + String(texIndex));
             else
@@ -2349,7 +2349,7 @@ String GetMaterialTextureName(const String& nameIn)
 {
     // Detect assimp embedded texture
     if (nameIn.Length() && nameIn[0] == '*')
-        return GenerateTextureName(ToInt(nameIn.Substring(1)));
+        return GenerateTextureName(ToI32(nameIn.Substring(1)));
     else
         return (useSubdirs_ ? "Textures/" : "") + nameIn;
 }

+ 1 - 1
Source/Tools/OgreImporter/OgreImporter.cpp

@@ -112,7 +112,7 @@ void Run(const Vector<String>& arguments)
                 }
                 else if (argument == "mb" && i < arguments.Size() - 1)
                 {
-                    maxBones_ = ToUInt(arguments[i + 1]);
+                    maxBones_ = ToU32(arguments[i + 1]);
                     if (maxBones_ < 1)
                         maxBones_ = 1;
                     ++i;

+ 6 - 6
Source/Tools/RampGenerator/RampGenerator.cpp

@@ -62,13 +62,13 @@ void Run(const Vector<String>& arguments)
     {
         String inputFile = arguments[0];
         String ouputFile = arguments[1];
-        int width = ToInt(arguments[2]);
+        int width = ToI32(arguments[2]);
         int dim = 1;
         if (arguments.Size() > 3)
-            dim = ToInt(arguments[3]);
+            dim = ToI32(arguments[3]);
         int blurLevel = 0;
         if (arguments.Size() > 4)
-            blurLevel = ToInt(arguments[4]);
+            blurLevel = ToI32(arguments[4]);
 
         const int height = dim == 2 ? width : 1;
 
@@ -91,12 +91,12 @@ void Run(const Vector<String>& arguments)
     }
     else // Generate a regular power based ramp
     {
-        int width = ToInt(arguments[1]);
+        int width = ToI32(arguments[1]);
         float power = ToFloat(arguments[2]);
 
         int dimensions = 1;
         if (arguments.Size() > 3)
-            dimensions = ToInt(arguments[3]);
+            dimensions = ToI32(arguments[3]);
 
         if (width < 2)
             ErrorExit("Width must be at least 2");
@@ -209,7 +209,7 @@ int PopFirstInt(Vector<String>& words)
 {
     if (words.Size() > 0)
     {
-        int ret = ToInt(words[0]);
+        int ret = ToI32(words[0]);
         words.Erase(0);
         return ret;
     }

+ 6 - 6
Source/Tools/SpritePacker/SpritePacker.cpp

@@ -117,12 +117,12 @@ void Run(Vector<String>& arguments)
 
         if (arg.StartsWith("-"))
         {
-            if (arg == "-px")      { padX = ToUInt(arguments[0]); arguments.Erase(0); }
-            else if (arg == "-py") { padY = ToUInt(arguments[0]); arguments.Erase(0); }
-            else if (arg == "-ox") { offsetX = ToUInt(arguments[0]); arguments.Erase(0); }
-            else if (arg == "-oy") { offsetY = ToUInt(arguments[0]); arguments.Erase(0); }
-            else if (arg == "-frameWidth") { frameWidth = ToUInt(arguments[0]); arguments.Erase(0); }
-            else if (arg == "-frameHeight") { frameHeight = ToUInt(arguments[0]); arguments.Erase(0); }
+            if (arg == "-px")      { padX = ToU32(arguments[0]); arguments.Erase(0); }
+            else if (arg == "-py") { padY = ToU32(arguments[0]); arguments.Erase(0); }
+            else if (arg == "-ox") { offsetX = ToU32(arguments[0]); arguments.Erase(0); }
+            else if (arg == "-oy") { offsetY = ToU32(arguments[0]); arguments.Erase(0); }
+            else if (arg == "-frameWidth") { frameWidth = ToU32(arguments[0]); arguments.Erase(0); }
+            else if (arg == "-frameHeight") { frameHeight = ToU32(arguments[0]); arguments.Erase(0); }
             else if (arg == "-trim") { trim = true; }
             else if (arg == "-xml")  { spriteSheetFileName = arguments[0]; arguments.Erase(0); }
             else if (arg == "-h")  { help = true; break; }

+ 4 - 4
Source/Urho3D/AngelScript/CoreAPI.cpp

@@ -43,10 +43,10 @@ static void RegisterStringUtils(asIScriptEngine* engine)
     engine->RegisterObjectMethod("String", "bool ToBool() const", AS_FUNCTIONPR_OBJFIRST(ToBool, (const String&), bool), AS_CALL_CDECL_OBJFIRST);
     engine->RegisterObjectMethod("String", "float ToFloat() const", AS_FUNCTIONPR_OBJFIRST(ToFloat, (const String&), float), AS_CALL_CDECL_OBJFIRST);
     engine->RegisterObjectMethod("String", "double ToDouble() const", AS_FUNCTIONPR_OBJFIRST(ToDouble, (const String&), double), AS_CALL_CDECL_OBJFIRST);
-    engine->RegisterObjectMethod("String", "int ToInt(int base = 10) const", AS_FUNCTIONPR_OBJFIRST(ToInt, (const String&, int), int), AS_CALL_CDECL_OBJFIRST);
-    engine->RegisterObjectMethod("String", "uint ToUInt(int base = 10) const", AS_FUNCTIONPR_OBJFIRST(ToUInt, (const String&, int), unsigned), AS_CALL_CDECL_OBJFIRST);
-    engine->RegisterObjectMethod("String", "int64 ToInt64(int base = 10) const", AS_FUNCTIONPR_OBJFIRST(ToInt64, (const String&, int), long long), AS_CALL_CDECL_OBJFIRST);
-    engine->RegisterObjectMethod("String", "uint64 ToUInt64(int base = 10) const", AS_FUNCTIONPR_OBJFIRST(ToUInt64, (const String&, int), unsigned long long), AS_CALL_CDECL_OBJFIRST);
+    engine->RegisterObjectMethod("String", "int ToI32(int base = 10) const", AS_FUNCTIONPR_OBJFIRST(ToI32, (const String&, i32), i32), AS_CALL_CDECL_OBJFIRST);
+    engine->RegisterObjectMethod("String", "uint ToU32(int base = 10) const", AS_FUNCTIONPR_OBJFIRST(ToU32, (const String&, i32), u32), AS_CALL_CDECL_OBJFIRST);
+    engine->RegisterObjectMethod("String", "int64 ToI64(int base = 10) const", AS_FUNCTIONPR_OBJFIRST(ToI64, (const String&, i32), i64), AS_CALL_CDECL_OBJFIRST);
+    engine->RegisterObjectMethod("String", "uint64 ToU64(int base = 10) const", AS_FUNCTIONPR_OBJFIRST(ToU64, (const String&, i32), u64), AS_CALL_CDECL_OBJFIRST);
     engine->RegisterObjectMethod("String", "Color ToColor() const", AS_FUNCTIONPR_OBJFIRST(ToColor, (const String&), Color), AS_CALL_CDECL_OBJFIRST);
     engine->RegisterObjectMethod("String", "IntRect ToIntRect() const", AS_FUNCTIONPR_OBJFIRST(ToIntRect, (const String&), IntRect), AS_CALL_CDECL_OBJFIRST);
     engine->RegisterObjectMethod("String", "IntVector2 ToIntVector2() const", AS_FUNCTIONPR_OBJFIRST(ToIntVector2, (const String&), IntVector2), AS_CALL_CDECL_OBJFIRST);

+ 12 - 12
Source/Urho3D/AngelScript/Generated_GlobalFunctions.cpp

@@ -448,16 +448,16 @@ void ASRegisterGeneratedGlobalFunctions(asIScriptEngine* engine)
     // float ToFloat(const char* source) | File: ../Core/StringUtils.h
     // Error: type "const char*" can not automatically bind
 
-    // int ToInt(const String& source, int base = 10) | File: ../Core/StringUtils.h
-    engine->RegisterGlobalFunction("int ToInt(const String&in, int = 10)", AS_FUNCTIONPR(ToInt, (const String&, int), int), AS_CALL_CDECL);
+    // i32 ToI32(const String& source, i32 base = 10) | File: ../Core/StringUtils.h
+    engine->RegisterGlobalFunction("int ToI32(const String&in, int = 10)", AS_FUNCTIONPR(ToI32, (const String&, i32), i32), AS_CALL_CDECL);
 
-    // int ToInt(const char* source, int base = 10) | File: ../Core/StringUtils.h
+    // i32 ToI32(const char* source, i32 base = 10) | File: ../Core/StringUtils.h
     // Error: type "const char*" can not automatically bind
 
-    // long long ToInt64(const String& source, int base = 10) | File: ../Core/StringUtils.h
-    engine->RegisterGlobalFunction("int64 ToInt64(const String&in, int = 10)", AS_FUNCTIONPR(ToInt64, (const String&, int), long long), AS_CALL_CDECL);
+    // i64 ToI64(const String& source, i32 base = 10) | File: ../Core/StringUtils.h
+    engine->RegisterGlobalFunction("int64 ToI64(const String&in, int = 10)", AS_FUNCTIONPR(ToI64, (const String&, i32), i64), AS_CALL_CDECL);
 
-    // long long ToInt64(const char* source, int base = 10) | File: ../Core/StringUtils.h
+    // i64 ToI64(const char* source, i32 base = 10) | File: ../Core/StringUtils.h
     // Error: type "const char*" can not automatically bind
 
     // IntRect ToIntRect(const String& source) | File: ../Core/StringUtils.h
@@ -520,16 +520,16 @@ void ASRegisterGeneratedGlobalFunctions(asIScriptEngine* engine)
     // String ToStringHex(unsigned value) | File: ../Core/StringUtils.h
     engine->RegisterGlobalFunction("String ToStringHex(uint)", AS_FUNCTIONPR(ToStringHex, (unsigned), String), AS_CALL_CDECL);
 
-    // unsigned ToUInt(const String& source, int base = 10) | File: ../Core/StringUtils.h
-    engine->RegisterGlobalFunction("uint ToUInt(const String&in, int = 10)", AS_FUNCTIONPR(ToUInt, (const String&, int), unsigned), AS_CALL_CDECL);
+    // u32 ToU32(const String& source, i32 base = 10) | File: ../Core/StringUtils.h
+    engine->RegisterGlobalFunction("uint ToU32(const String&in, int = 10)", AS_FUNCTIONPR(ToU32, (const String&, i32), u32), AS_CALL_CDECL);
 
-    // unsigned ToUInt(const char* source, int base = 10) | File: ../Core/StringUtils.h
+    // u32 ToU32(const char* source, i32 base = 10) | File: ../Core/StringUtils.h
     // Error: type "const char*" can not automatically bind
 
-    // unsigned long long ToUInt64(const String& source, int base = 10) | File: ../Core/StringUtils.h
-    engine->RegisterGlobalFunction("uint64 ToUInt64(const String&in, int = 10)", AS_FUNCTIONPR(ToUInt64, (const String&, int), unsigned long long), AS_CALL_CDECL);
+    // u64 ToU64(const String& source, i32 base = 10) | File: ../Core/StringUtils.h
+    engine->RegisterGlobalFunction("uint64 ToU64(const String&in, int = 10)", AS_FUNCTIONPR(ToU64, (const String&, i32), u64), AS_CALL_CDECL);
 
-    // unsigned long long ToUInt64(const char* source, int base = 10) | File: ../Core/StringUtils.h
+    // u64 ToU64(const char* source, i32 base = 10) | File: ../Core/StringUtils.h
     // Error: type "const char*" can not automatically bind
 
     // unsigned ToUpper(unsigned ch) | File: ../Core/StringUtils.h

+ 2 - 2
Source/Urho3D/Core/ProcessUtils.cpp

@@ -621,8 +621,8 @@ String GetOSVersion()
     {
         Vector<String> kernel_version = String(kernel_r).Split('.');
         String version = "macOS/Mac OS X ";
-        int major = ToInt(kernel_version[0]);
-        int minor = ToInt(kernel_version[1]);
+        int major = ToI32(kernel_version[0]);
+        int minor = ToI32(kernel_version[1]);
 
         // https://en.wikipedia.org/wiki/Darwin_(operating_system)
         if (major == 18) // macOS Mojave

+ 14 - 14
Source/Urho3D/Core/StringUtils.cpp

@@ -89,12 +89,12 @@ bool ToBool(const char* source)
     return false;
 }
 
-int ToInt(const String& source, int base)
+i32 ToI32(const String& source, i32 base)
 {
-    return ToInt(source.CString(), base);
+    return ToI32(source.CString(), base);
 }
 
-int ToInt(const char* source, int base)
+i32 ToI32(const char* source, i32 base)
 {
     if (!source)
         return 0;
@@ -103,10 +103,10 @@ int ToInt(const char* source, int base)
     if (base < 2 || base > 36)
         base = 0;
 
-    return (int)strtol(source, nullptr, base);
+    return (i32)strtol(source, nullptr, base);
 }
 
-long long ToInt64(const char* source, int base)
+i64 ToI64(const char* source, i32 base)
 {
     if (!source)
         return 0;
@@ -118,17 +118,17 @@ long long ToInt64(const char* source, int base)
     return strtoll(source, nullptr, base);
 }
 
-long long ToInt64(const String& source, int base)
+i64 ToI64(const String& source, i32 base)
 {
-    return ToInt64(source.CString(), base);
+    return ToI64(source.CString(), base);
 }
 
-unsigned ToUInt(const String& source, int base)
+u32 ToU32(const String& source, i32 base)
 {
-    return ToUInt(source.CString(), base);
+    return ToU32(source.CString(), base);
 }
 
-unsigned long long ToUInt64(const char* source, int base)
+u64 ToU64(const char* source, i32 base)
 {
     if (!source)
         return 0;
@@ -140,12 +140,12 @@ unsigned long long ToUInt64(const char* source, int base)
     return strtoull(source, nullptr, base);
 }
 
-unsigned long long ToUInt64(const String& source, int base)
+u64 ToU64(const String& source, i32 base)
 {
-    return ToUInt64(source.CString(), base);
+    return ToU64(source.CString(), base);
 }
 
-unsigned ToUInt(const char* source, int base)
+u32 ToU32(const char* source, i32 base)
 {
     if (!source)
         return 0;
@@ -153,7 +153,7 @@ unsigned ToUInt(const char* source, int base)
     if (base < 2 || base > 36)
         base = 0;
 
-    return (unsigned)strtoul(source, nullptr, base);
+    return (u32)strtoul(source, nullptr, base);
 }
 
 float ToFloat(const String& source)

+ 10 - 10
Source/Urho3D/Core/StringUtils.h

@@ -21,21 +21,21 @@ URHO3D_API double ToDouble(const String& source);
 /// Parse a double from a C string.
 URHO3D_API double ToDouble(const char* source);
 /// Parse an integer from a string. Assumed to be decimal by default (base 10). Use base 0 to autodetect from string.
-URHO3D_API int ToInt(const String& source, int base = 10);
+URHO3D_API i32 ToI32(const String& source, i32 base = 10);
 /// Parse an integer from a C string. Assumed to be decimal by default (base 10). Use base 0 to autodetect from string.
-URHO3D_API int ToInt(const char* source, int base = 10);
+URHO3D_API i32 ToI32(const char* source, i32 base = 10);
 /// Parse an unsigned integer from a string. Assumed to be decimal by default (base 10). Use base 0 to autodetect from string.
-URHO3D_API unsigned ToUInt(const String& source, int base = 10);
+URHO3D_API u32 ToU32(const String& source, i32 base = 10);
 /// Parse an unsigned integer from a C string. Assumed to be decimal by default (base 10). Use base 0 to autodetect from string.
-URHO3D_API unsigned ToUInt(const char* source, int base = 10);
+URHO3D_API u32 ToU32(const char* source, i32 base = 10);
 /// Parse an 64 bit integer from a string. Assumed to be decimal by default (base 10). Use base 0 to autodetect from string.
-URHO3D_API long long ToInt64(const String& source, int base = 10);
+URHO3D_API i64 ToI64(const String& source, i32 base = 10);
 /// Parse an 64 bit integer from a C string. Assumed to be decimal by default (base 10). Use base 0 to autodetect from string.
-URHO3D_API long long ToInt64(const char* source, int base = 10);
+URHO3D_API i64 ToI64(const char* source, i32 base = 10);
 /// Parse an unsigned 64 bit integer from a string. Assumed to be decimal by default (base 10). Use base 0 to autodetect from string.
-URHO3D_API unsigned long long ToUInt64(const String& source, int base = 10);
+URHO3D_API u64 ToU64(const String& source, i32 base = 10);
 /// Parse an unsigned 64 bit integer from a C string. Assumed to be decimal by default (base 10). Use base 0 to autodetect from string.
-URHO3D_API unsigned long long ToUInt64(const char* source, int base = 10);
+URHO3D_API u64 ToU64(const char* source, i32 base = 10);
 /// Parse a Color from a string.
 URHO3D_API Color ToColor(const String& source);
 /// Parse a Color from a C string.
@@ -126,8 +126,8 @@ template <> inline String FromString<String>(const char* source) { return source
 template <> inline bool FromString<bool>(const char* source) { return ToBool(source); }
 template <> inline float FromString<float>(const char* source) { return ToFloat(source); }
 template <> inline double FromString<double>(const char* source) { return ToDouble(source); }
-template <> inline int FromString<int>(const char* source) { return ToInt(source); }
-template <> inline unsigned FromString<unsigned>(const char* source) { return ToUInt(source); }
+template <> inline i32 FromString<i32>(const char* source) { return ToI32(source); }
+template <> inline u32 FromString<u32>(const char* source) { return ToU32(source); }
 template <> inline Color FromString<Color>(const char* source) { return ToColor(source); }
 template <> inline IntRect FromString<IntRect>(const char* source) { return ToIntRect(source); }
 template <> inline IntVector2 FromString<IntVector2>(const char* source) { return ToIntVector2(source); }

+ 2 - 2
Source/Urho3D/Core/Variant.cpp

@@ -253,11 +253,11 @@ void Variant::FromString(VariantType type, const char* value)
     switch (type)
     {
     case VAR_INT:
-        *this = ToInt(value);
+        *this = ToI32(value);
         break;
 
     case VAR_INT64:
-        *this = ToInt64(value);
+        *this = ToI64(value);
         break;
 
     case VAR_BOOL:

+ 12 - 12
Source/Urho3D/Engine/Engine.cpp

@@ -899,35 +899,35 @@ VariantMap Engine::ParseParameters(const Vector<String>& arguments)
             }
             else if (argument == "x" && !value.Empty())
             {
-                ret[EP_WINDOW_WIDTH] = ToInt(value);
+                ret[EP_WINDOW_WIDTH] = ToI32(value);
                 ++i;
             }
             else if (argument == "y" && !value.Empty())
             {
-                ret[EP_WINDOW_HEIGHT] = ToInt(value);
+                ret[EP_WINDOW_HEIGHT] = ToI32(value);
                 ++i;
             }
             else if (argument == "monitor" && !value.Empty()) {
-                ret[EP_MONITOR] = ToInt(value);
+                ret[EP_MONITOR] = ToI32(value);
                 ++i;
             }
             else if (argument == "hz" && !value.Empty()) {
-                ret[EP_REFRESH_RATE] = ToInt(value);
+                ret[EP_REFRESH_RATE] = ToI32(value);
                 ++i;
             }
             else if (argument == "m" && !value.Empty())
             {
-                ret[EP_MULTI_SAMPLE] = ToInt(value);
+                ret[EP_MULTI_SAMPLE] = ToI32(value);
                 ++i;
             }
             else if (argument == "b" && !value.Empty())
             {
-                ret[EP_SOUND_BUFFER] = ToInt(value);
+                ret[EP_SOUND_BUFFER] = ToI32(value);
                 ++i;
             }
             else if (argument == "r" && !value.Empty())
             {
-                ret[EP_SOUND_MIX_RATE] = ToInt(value);
+                ret[EP_SOUND_MIX_RATE] = ToI32(value);
                 ++i;
             }
             else if (argument == "pp" && !value.Empty())
@@ -957,23 +957,23 @@ VariantMap Engine::ParseParameters(const Vector<String>& arguments)
             }
             else if (argument == "mq" && !value.Empty())
             {
-                ret[EP_MATERIAL_QUALITY] = ToInt(value);
+                ret[EP_MATERIAL_QUALITY] = ToI32(value);
                 ++i;
             }
             else if (argument == "tq" && !value.Empty())
             {
-                ret[EP_TEXTURE_QUALITY] = ToInt(value);
+                ret[EP_TEXTURE_QUALITY] = ToI32(value);
                 ++i;
             }
             else if (argument == "tf" && !value.Empty())
             {
-                ret[EP_TEXTURE_FILTER_MODE] = ToInt(value);
+                ret[EP_TEXTURE_FILTER_MODE] = ToI32(value);
                 ++i;
             }
             else if (argument == "af" && !value.Empty())
             {
                 ret[EP_TEXTURE_FILTER_MODE] = FILTER_ANISOTROPIC;
-                ret[EP_TEXTURE_ANISOTROPY] = ToInt(value);
+                ret[EP_TEXTURE_ANISOTROPY] = ToI32(value);
                 ++i;
             }
             else if (argument == "touch")
@@ -981,7 +981,7 @@ VariantMap Engine::ParseParameters(const Vector<String>& arguments)
 #ifdef URHO3D_TESTING
             else if (argument == "timeout" && !value.Empty())
             {
-                ret[EP_TIME_OUT] = ToInt(value);
+                ret[EP_TIME_OUT] = ToI32(value);
                 ++i;
             }
 #endif

+ 1 - 1
Source/Urho3D/Graphics/Material.cpp

@@ -95,7 +95,7 @@ TextureUnit ParseTextureUnitName(String name)
             unit = TU_ENVIRONMENT;
         // Finally check for specifying the texture unit directly as a number
         else if (name.Length() < 3)
-            unit = (TextureUnit)Clamp(ToInt(name), 0, MAX_TEXTURE_UNITS - 1);
+            unit = (TextureUnit)Clamp(ToI32(name), 0, MAX_TEXTURE_UNITS - 1);
     }
 
     if (unit == MAX_TEXTURE_UNITS)

+ 2 - 2
Source/Urho3D/Graphics/Terrain.cpp

@@ -919,8 +919,8 @@ void Terrain::CreateGeometry()
             Vector<String> coords = (*i)->GetName().Substring(6).Split('_');
             if (coords.Size() == 2)
             {
-                int x = ToInt(coords[0]);
-                int z = ToInt(coords[1]);
+                int x = ToI32(coords[0]);
+                int z = ToI32(coords[1]);
                 if (x < numPatches_.x_ && z < numPatches_.y_)
                     nodeOk = true;
             }

+ 1 - 1
Source/Urho3D/GraphicsAPI/OpenGL/OGLShaderProgram.cpp

@@ -30,7 +30,7 @@ static unsigned NumberPostfix(const String& str)
     for (unsigned i = 0; i < str.Length(); ++i)
     {
         if (IsDigit(str[i]))
-            return ToUInt(str.CString() + i);
+            return ToU32(str.CString() + i);
     }
 
     return M_MAX_UNSIGNED;

+ 2 - 2
Source/Urho3D/Input/Input.cpp

@@ -2477,7 +2477,7 @@ void Input::HandleScreenJoystickTouch(StringHash eventType, VariantMap& eventDat
         {
             evt.type = eventType == E_TOUCHBEGIN ? SDL_JOYBUTTONDOWN : SDL_JOYBUTTONUP;
             evt.jbutton.which = joystickID;
-            evt.jbutton.button = (Uint8)ToUInt(name.Substring(6));
+            evt.jbutton.button = (Uint8)ToU32(name.Substring(6));
         }
         else
         {
@@ -2510,7 +2510,7 @@ void Input::HandleScreenJoystickTouch(StringHash eventType, VariantMap& eventDat
         {
             evt.type = SDL_JOYHATMOTION;
             evt.jaxis.which = joystickID;
-            evt.jhat.hat = (Uint8)ToUInt(name.Substring(3));
+            evt.jhat.hat = (Uint8)ToU32(name.Substring(3));
             evt.jhat.value = HAT_CENTER;
             if (eventType != E_TOUCHEND)
             {

+ 2 - 2
Source/Urho3D/Math/BigInt.cpp

@@ -205,11 +205,11 @@ BigInt::BigInt(const String& str)
     for (; i > firstDigitPos; i -= BASE_DIGITS)
     {
         String chunk = str.Substring(i, BASE_DIGITS);
-        magnitude_.Push(ToInt64(chunk)); // To Digit
+        magnitude_.Push(ToI64(chunk)); // To Digit
     }
 
     String lastChunk = str.Substring(firstDigitPos, BASE_DIGITS + i - firstDigitPos);
-    magnitude_.Push(ToInt64(lastChunk)); // To Digit
+    magnitude_.Push(ToI64(lastChunk)); // To Digit
 }
 
 BigInt::BigInt(i32 value)

+ 1 - 1
Source/Urho3D/Network/HttpRequest.cpp

@@ -84,7 +84,7 @@ void HttpRequest::ThreadFunction()
     i32 portStart = host.Find(':');
     if (portStart != String::NPOS)
     {
-        port = ToInt(host.Substring(portStart + 1));
+        port = ToI32(host.Substring(portStart + 1));
         host = host.Substring(0, portStart);
     } else if (protocol.Compare("https", false) >= 0)
         port = 443;

+ 1 - 1
Source/Urho3D/Resource/JSONValue.cpp

@@ -564,7 +564,7 @@ VariantMap JSONValue::GetVariantMap() const
     for (ConstJSONObjectIterator i = Begin(); i != End(); ++i)
     {
         /// \todo Ideally this should allow any strings, but for now the convention is that the keys need to be hexadecimal StringHashes
-        StringHash key(ToUInt(i->first_, 16));
+        StringHash key(ToU32(i->first_, 16));
         Variant variant = i->second_.GetVariant();
         variantMap[key] = variant;
     }

+ 1 - 1
Source/Urho3D/Resource/PListFile.cpp

@@ -371,7 +371,7 @@ bool PListFile::LoadValue(PListValue& value, const XMLElement& valueElem)
     else if (valueType == "real")
         value.SetFloat(ToFloat(valueElem.GetValue()));
     else if (valueType == "integer")
-        value.SetInt(ToInt(valueElem.GetValue()));
+        value.SetInt(ToI32(valueElem.GetValue()));
     else if (valueType == "true")
         value.SetBool(true);
     else if (valueType == "false")

+ 6 - 6
Source/Urho3D/Resource/XMLElement.cpp

@@ -763,9 +763,9 @@ bool XMLElement::GetBuffer(const String& name, void* dest, i32 size) const
     if (size < bytes.Size())
         return false;
 
-    u8* destBytes = (u8*)dest;
+    byte* destBytes = (byte*)dest;
     for (i32 i = 0; i < bytes.Size(); ++i)
-        destBytes[i] = (u8)ToInt(bytes[i]);
+        destBytes[i] = static_cast<byte>(ToI32(bytes[i]));
     return true;
 }
 
@@ -786,22 +786,22 @@ double XMLElement::GetDouble(const String& name) const
 
 unsigned XMLElement::GetUInt(const String& name) const
 {
-    return ToUInt(GetAttribute(name));
+    return ToU32(GetAttribute(name));
 }
 
 int XMLElement::GetInt(const String& name) const
 {
-    return ToInt(GetAttribute(name));
+    return ToI32(GetAttribute(name));
 }
 
 unsigned long long XMLElement::GetUInt64(const String& name) const
 {
-    return ToUInt64(GetAttribute(name));
+    return ToU64(GetAttribute(name));
 }
 
 long long XMLElement::GetInt64(const String& name) const
 {
-    return ToInt64(GetAttribute(name));
+    return ToI64(GetAttribute(name));
 }
 
 IntRect XMLElement::GetIntRect(const String& name) const

+ 2 - 2
Source/Urho3D/Scene/Node.cpp

@@ -1918,7 +1918,7 @@ Animatable* Node::FindAttributeAnimationTarget(const String& name, String& outNa
             char s = name.Front();
             if (s >= '0' && s <= '9')
             {
-                i32 index = ToInt(name);
+                i32 index = ToI32(name);
                 node = node->GetChild(index);
             }
             else
@@ -1961,7 +1961,7 @@ Animatable* Node::FindAttributeAnimationTarget(const String& name, String& outNa
         }
         else
         {
-            i32 index = ToInt(componentNames[1]);
+            i32 index = ToI32(componentNames[1]);
             Vector<Component*> components;
             node->GetComponents(components, StringHash(componentNames.Front()));
             if (index >= components.Size())

+ 1 - 1
Source/Urho3D/UI/UIElement.cpp

@@ -1915,7 +1915,7 @@ Animatable* UIElement::FindAttributeAnimationTarget(const String& name, String&
             char s = name.Front();
             if (s >= '0' && s <= '9')
             {
-                i32 index = ToInt(name);
+                i32 index = ToI32(name);
                 element = element->GetChild(index);
             }
             else

+ 1 - 1
Source/Urho3D/Urho2D/TmxFile2D.cpp

@@ -145,7 +145,7 @@ bool TmxTileLayer2D::Load(const XMLElement& element, const TileMapInfo2D& info)
             for (int x = 0; x < width_; ++x)
             {
                 gidVector[currentIndex].Replace("\n", "");
-                unsigned gid = ToUInt(gidVector[currentIndex]);
+                unsigned gid = ToU32(gidVector[currentIndex]);
                 if (gid > 0)
                 {
                     SharedPtr<Tile2D> tile(new Tile2D());

+ 1 - 1
bin/Data/Scripts/41_DatabaseDemo.as

@@ -131,7 +131,7 @@ void HandleInput(const String&in input)
         if (input.StartsWith("set") && tokens.length > 1)
         {
             if (setting == "maxrows")
-                maxRows = Max(tokens[1].ToUInt(), 1);
+                maxRows = Max(tokens[1].ToU32(), 1);
             else if (setting == "connstr") {
                 String newConnectionString(input.Substring(input.Find(" ", input.Find("connstr")) + 1));
                 DbConnection@ newConnection = database.Connect(newConnectionString);

+ 1 - 1
bin/Data/Scripts/52_NATPunchtrough.as

@@ -150,7 +150,7 @@ Button@ CreateButton(const String&in text, int width, IntVector2 pos)
 void HandleSaveNatSettings(StringHash eventType, VariantMap& eventData)
 {
     // Save NAT server configuration
-    network.SetNATServerInfo(natServerAddress.text, natServerPort.text.ToInt());
+    network.SetNATServerInfo(natServerAddress.text, natServerPort.text.ToI32());
     ShowLogMessage("Saving NAT settings: " + natServerAddress.text + ":" + natServerPort.text);
 }
 

+ 3 - 3
bin/Data/Scripts/Editor/AttributeEditor.as

@@ -232,7 +232,7 @@ void HandleBitSelectionEdit(StringHash eventType, VariantMap& eventData)
         LineEdit@ attrEdit = eventData["Element"].GetPtr();
 
         inUpdateBitSelection = true;
-        SetBitSelection(attrEdit.parent, attrEdit.text.ToInt());
+        SetBitSelection(attrEdit.parent, attrEdit.text.ToI32());
         inUpdateBitSelection = false;
     }
 
@@ -870,7 +870,7 @@ void SanitizeNumericalValue(VariantType type, String& value)
     if ((type >= VAR_FLOAT && type <= VAR_COLOR) || type == VAR_RECT)
         value = String(value.ToFloat());
     else if (type == VAR_INT || type == VAR_INTRECT || type == VAR_INTVECTOR2 || type == VAR_INTVECTOR3)
-        value = String(value.ToInt());
+        value = String(value.ToI32());
     else if (type == VAR_DOUBLE)
         value = String(value.ToDouble());
 }
@@ -906,7 +906,7 @@ void GetEditorValue(UIElement@ parent, VariantType type, Array<String>@ enumName
     else if (type == VAR_INT)
     {
         if (enumNames is null || enumNames.empty)
-            FillValue(values, Variant(attrEdit.text.ToInt()));
+            FillValue(values, Variant(attrEdit.text.ToI32()));
         else
         {
             DropDownList@ ddl = parent.children[1];

+ 3 - 3
bin/Data/Scripts/Editor/EditorImport.as

@@ -256,14 +256,14 @@ void ImportTundraScene(const String&in fileName)
             }
             if (compType == "EC_RigidBody" || compType == "RigidBody")
             {
-                shapeType = GetComponentAttribute(compElem, "Shape type").ToInt();
+                shapeType = GetComponentAttribute(compElem, "Shape type").ToI32();
                 mass = GetComponentAttribute(compElem, "Mass").ToFloat();
                 bodySize = GetComponentAttribute(compElem, "Size").ToVector3();
                 collisionMeshName = GetComponentAttribute(compElem, "Collision mesh ref");
                 trigger = GetComponentAttribute(compElem, "Phantom").ToBool();
                 kinematic = GetComponentAttribute(compElem, "Kinematic").ToBool();
-                collisionLayer = GetComponentAttribute(compElem, "Collision Layer").ToInt();
-                collisionMask = GetComponentAttribute(compElem, "Collision Mask").ToInt();
+                collisionLayer = GetComponentAttribute(compElem, "Collision Layer").ToI32();
+                collisionMask = GetComponentAttribute(compElem, "Collision Mask").ToI32();
                 ProcessRef(collisionMeshName);
             }
 

+ 2 - 2
bin/Data/Scripts/Editor/EditorMaterial.as

@@ -819,7 +819,7 @@ void EditTechniqueQuality(StringHash eventType, VariantMap& eventData)
         return;
 
     LineEdit@ attrEdit = eventData["Element"].GetPtr();
-    uint newQualityLevel = attrEdit.text.ToUInt();
+    uint newQualityLevel = attrEdit.text.ToU32();
     uint index = attrEdit.vars["Index"].GetUInt();
 
     BeginMaterialEdit();
@@ -893,7 +893,7 @@ void EditRenderOrder(StringHash eventType, VariantMap& eventData)
     BeginMaterialEdit();
 
     LineEdit@ attrEdit = eventData["Element"].GetPtr();
-    editMaterial.renderOrder = attrEdit.text.ToInt();
+    editMaterial.renderOrder = attrEdit.text.ToI32();
 
     EndMaterialEdit();
 }

+ 1 - 1
bin/Data/Scripts/Editor/EditorParticleEffect.as

@@ -619,7 +619,7 @@ void EditParticleEffectNumParticles(StringHash eventType, VariantMap& eventData)
 
     LineEdit@ element = eventData["Element"].GetPtr();
 
-    editParticleEffect.numParticles = element.text.ToInt();
+    editParticleEffect.numParticles = element.text.ToI32();
     particleEffectEmitter.ApplyEffect();
 
     EndParticleEffectEdit();

+ 2 - 2
bin/Data/Scripts/Editor/EditorPreferences.as

@@ -396,7 +396,7 @@ void ToggleGrid2DMode(StringHash eventType, VariantMap& eventData)
 void EditGridSize(StringHash eventType, VariantMap& eventData)
 {
     LineEdit@ edit = eventData["Element"].GetPtr();
-    gridSize = edit.text.ToInt();
+    gridSize = edit.text.ToI32();
     edit.text = String(gridSize);
     UpdateGrid();
 }
@@ -404,7 +404,7 @@ void EditGridSize(StringHash eventType, VariantMap& eventData)
 void EditGridSubdivisions(StringHash eventType, VariantMap& eventData)
 {
     LineEdit@ edit = eventData["Element"].GetPtr();
-    gridSubdivisions = edit.text.ToInt();
+    gridSubdivisions = edit.text.ToI32();
     edit.text = String(gridSubdivisions);
     UpdateGrid();
 }

+ 2 - 2
bin/Data/Scripts/Editor/EditorSettings.as

@@ -396,7 +396,7 @@ void EditShadowQuality(StringHash eventType, VariantMap& eventData)
 void EditMaxOccluderTriangles(StringHash eventType, VariantMap& eventData)
 {
     LineEdit@ edit = eventData["Element"].GetPtr();
-    renderer.maxOccluderTriangles = edit.text.ToInt();
+    renderer.maxOccluderTriangles = edit.text.ToI32();
     if (eventType == StringHash("TextFinished"))
         edit.text = String(renderer.maxOccluderTriangles);
 }
@@ -452,7 +452,7 @@ void EditCubemapName(StringHash eventType, VariantMap& eventData)
 void EditCubemapSize(StringHash eventType, VariantMap& eventData)
 {
     LineEdit@ edit = eventData["Element"].GetPtr();
-    cubeMapGen_Size = edit.text.ToInt();
+    cubeMapGen_Size = edit.text.ToI32();
 }
 
 void EditDefaultTags(StringHash eventType, VariantMap& eventData)

+ 2 - 2
bin/Data/Scripts/Editor/EditorSpawn.as

@@ -172,7 +172,7 @@ void ToggleParentToSelected(StringHash eventType, VariantMap& eventData)
 void UpdateNumberSpawnedObjects(StringHash eventType, VariantMap& eventData)
 {
     LineEdit@ edit = eventData["Element"].GetPtr();
-    numberSpawnedObjects = edit.text.ToUInt();
+    numberSpawnedObjects = edit.text.ToU32();
     edit.text = String(numberSpawnedObjects);
     RefreshPickedObjects();
 }
@@ -186,7 +186,7 @@ void EditSpawnRadius(StringHash eventType, VariantMap& eventData)
 void EditSpawnCount(StringHash eventType, VariantMap& eventData)
 {
     LineEdit@ edit = eventData["Element"].GetPtr();
-    spawnCount = edit.text.ToUInt();
+    spawnCount = edit.text.ToU32();
 }
 
 void RefreshPickedObjects()

+ 1 - 1
bin/Data/Scripts/Editor/EditorTerrain.as

@@ -330,7 +330,7 @@ class TerrainEditor
 
         LineEdit@ lineEdit = window.GetChild("CreateTerrainValue", true);
 
-        uint lineEditLength = lineEdit.text.Trimmed().ToUInt();
+        uint lineEditLength = lineEdit.text.Trimmed().ToU32();
 
         // The parse failed, so use a decent default
         if (lineEditLength == 0)