Browse Source

Fix compilation warnings

Source/Core/FontDatabase.cpp: In member function ‘void* Rocket::Core::FontDatabase::LoadFace(const String&)’:
Source/Core/FontDatabase.cpp:257:10: warning: converting ‘false’ to pointer type ‘void*’ [-Wconversion-null]
   return false;

Source/Core/TextureResource.cpp: In member function ‘bool Rocket::Core::TextureResource::Load(Rocket::Core::RenderInterface*) const’:
Source/Core/TextureResource.cpp:165:70: warning: passing NULL to non-pointer argument 1 of ‘std::pair<_T1, _T2>::pair(const _T1&, const _T2&) [with _T1 = long long unsigned int; _T2 = Rocket::Core::Vector2<int>]’ [-Wconversion-null]
     texture_data[render_interface] = TextureData(NULL, Vector2i(0, 0));
                                                                      ^
Source/Core/TextureResource.cpp:177:68: warning: passing NULL to non-pointer argument 1 of ‘std::pair<_T1, _T2>::pair(const _T1&, const _T2&) [with _T1 = long long unsigned int; _T2 = Rocket::Core::Vector2<int>]’ [-Wconversion-null]
   texture_data[render_interface] = TextureData(NULL, Vector2i(0, 0));
Victor Luchitz 12 years ago
parent
commit
30c79bf59e
2 changed files with 3 additions and 3 deletions
  1. 1 1
      Source/Core/FontDatabase.cpp
  2. 2 2
      Source/Core/TextureResource.cpp

+ 1 - 1
Source/Core/FontDatabase.cpp

@@ -279,7 +279,7 @@ void* FontDatabase::LoadFace(const String& file_name)
 
 
 	if (!handle)
 	if (!handle)
 	{
 	{
-		return false;
+		return NULL;
 	}
 	}
 
 
 	size_t length = file_interface->Length(handle);
 	size_t length = file_interface->Length(handle);

+ 2 - 2
Source/Core/TextureResource.cpp

@@ -162,7 +162,7 @@ bool TextureResource::Load(RenderInterface* render_interface) const
 			else
 			else
 			{
 			{
 				Log::Message(Log::LT_WARNING, "Failed to generate internal texture %s.", source.CString());
 				Log::Message(Log::LT_WARNING, "Failed to generate internal texture %s.", source.CString());
-				texture_data[render_interface] = TextureData(NULL, Vector2i(0, 0));
+				texture_data[render_interface] = TextureData(0, Vector2i(0, 0));
 
 
 				return false;
 				return false;
 			}
 			}
@@ -174,7 +174,7 @@ bool TextureResource::Load(RenderInterface* render_interface) const
 	if (!render_interface->LoadTexture(handle, dimensions, source))
 	if (!render_interface->LoadTexture(handle, dimensions, source))
 	{
 	{
 		Log::Message(Log::LT_WARNING, "Failed to load texture from %s.", source.CString());
 		Log::Message(Log::LT_WARNING, "Failed to load texture from %s.", source.CString());
-		texture_data[render_interface] = TextureData(NULL, Vector2i(0, 0));
+		texture_data[render_interface] = TextureData(0, Vector2i(0, 0));
 
 
 		return false;
 		return false;
 	}
 	}