Browse Source

Serializer.cpp: fix warnings

1vanK 3 năm trước cách đây
mục cha
commit
56c44a1420
1 tập tin đã thay đổi với 5 bổ sung5 xóa
  1. 5 5
      Source/Urho3D/IO/Serializer.cpp

+ 5 - 5
Source/Urho3D/IO/Serializer.cpp

@@ -164,17 +164,17 @@ bool Serializer::WriteString(const String& value)
 {
     const char* chars = value.CString();
     // Count length to the first zero, because ReadString() does the same
-    unsigned length = String::CStringLength(chars);
+    i32 length = String::CStringLength(chars);
     return Write(chars, length + 1) == length + 1;
 }
 
 bool Serializer::WriteFileID(const String& value)
 {
     bool success = true;
-    unsigned length = Min(value.Length(), 4U);
+    i32 length = Min(value.Length(), 4);
 
     success &= Write(value.CString(), length) == length;
-    for (unsigned i = value.Length(); i < 4; ++i)
+    for (i32 i = value.Length(); i < 4; ++i)
         success &= WriteByte(' ');
     return success;
 }
@@ -209,8 +209,8 @@ bool Serializer::WriteResourceRefList(const ResourceRefList& value)
 
     success &= WriteStringHash(value.type_);
     success &= WriteVLE(value.names_.Size());
-    for (unsigned i = 0; i < value.names_.Size(); ++i)
-        success &= WriteString(value.names_[i]);
+    for (const String& name : value.names_)
+        success &= WriteString(name);
 
     return success;
 }