瀏覽代碼

Clang-Tidy - modernize-use-bool-literals.

Yao Wei Tjong 姚伟忠 8 年之前
父節點
當前提交
0f3d3a2621

+ 1 - 1
Source/Urho3D/AngelScript/ScriptAPIDump.cpp

@@ -173,7 +173,7 @@ void Script::OutputAPIRow(DumpMode mode, const String& row, bool removeReference
 
 
         // s/(\w+)\[\]/Array<\1>/g
         // s/(\w+)\[\]/Array<\1>/g
         unsigned posBegin = String::NPOS;
         unsigned posBegin = String::NPOS;
-        while (1)   // Loop to cater for array of array of T
+        while (true)   // Loop to cater for array of array of T
         {
         {
             unsigned posEnd = out.Find("[]");
             unsigned posEnd = out.Find("[]");
             if (posEnd == String::NPOS)
             if (posEnd == String::NPOS)

+ 1 - 1
Source/Urho3D/Database/SQLite/SQLiteConnection.cpp

@@ -90,7 +90,7 @@ DbResult DbConnection::Execute(const String& sql, bool useCursorEvent)
     bool filtered = false;
     bool filtered = false;
     bool aborted = false;
     bool aborted = false;
 
 
-    while (1)
+    while (true)
     {
     {
         rc = sqlite3_step(pStmt);
         rc = sqlite3_step(pStmt);
         if (rc == SQLITE_ROW)
         if (rc == SQLITE_ROW)

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

@@ -330,7 +330,7 @@ SharedPtr<Image> TextureCube::GetImage(CubeMapFace face) const
     else if (format_ == Graphics::GetRGBFormat())
     else if (format_ == Graphics::GetRGBFormat())
         rawImage->SetSize(width_, height_, 3);
         rawImage->SetSize(width_, height_, 3);
     else
     else
-        assert(0);
+        assert(false);
 
 
     GetData(face, 0, rawImage->GetData());
     GetData(face, 0, rawImage->GetData());
     return SharedPtr<Image>(rawImage);
     return SharedPtr<Image>(rawImage);

+ 3 - 3
Source/Urho3D/UI/FontFaceBitmap.cpp

@@ -93,7 +93,7 @@ bool FontFaceBitmap::Load(const unsigned char* fontData, unsigned fontDataSize,
         if (pageElem.IsNull())
         if (pageElem.IsNull())
         {
         {
             URHO3D_LOGERROR("Could not find Page element for page: " + String(i));
             URHO3D_LOGERROR("Could not find Page element for page: " + String(i));
-            return 0;
+            return false;
         }
         }
 
 
         // Assume the font image is in the same directory as the font description file
         // Assume the font image is in the same directory as the font description file
@@ -105,11 +105,11 @@ bool FontFaceBitmap::Load(const unsigned char* fontData, unsigned fontDataSize,
         if (!fontFile || !fontImage->Load(*fontFile))
         if (!fontFile || !fontImage->Load(*fontFile))
         {
         {
             URHO3D_LOGERROR("Failed to load font image file");
             URHO3D_LOGERROR("Failed to load font image file");
-            return 0;
+            return false;
         }
         }
         SharedPtr<Texture2D> texture = LoadFaceTexture(fontImage);
         SharedPtr<Texture2D> texture = LoadFaceTexture(fontImage);
         if (!texture)
         if (!texture)
-            return 0;
+            return false;
 
 
         textures_.Push(texture);
         textures_.Push(texture);