瀏覽代碼

Fix CppCheck 'duplicateExpression' warning

BTW, all three cases looks similar. It would be nice to refactor it
to avoid repeating code.
Boris Egorov 11 年之前
父節點
當前提交
1ce14e3321
共有 3 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      core/globals.cpp
  2. 1 1
      core/io/config_file.cpp
  3. 1 1
      core/io/resource_format_xml.cpp

+ 1 - 1
core/globals.cpp

@@ -674,7 +674,7 @@ static Variant _decode_variant(const String& p_string) {
 		int w=params[2].to_int();
 		int w=params[2].to_int();
 		int h=params[3].to_int();
 		int h=params[3].to_int();
 
 
-		if (w == 0 && w == 0) {
+		if (w == 0 && h == 0) {
 			//r_v = Image(w, h, imgformat);
 			//r_v = Image(w, h, imgformat);
 			return Image();
 			return Image();
 		};
 		};

+ 1 - 1
core/io/config_file.cpp

@@ -580,7 +580,7 @@ static Variant _decode_variant(const String& p_string) {
 		int w=params[2].to_int();
 		int w=params[2].to_int();
 		int h=params[3].to_int();
 		int h=params[3].to_int();
 
 
-		if (w == 0 && w == 0) {
+		if (w == 0 && h == 0) {
 			//r_v = Image(w, h, imgformat);
 			//r_v = Image(w, h, imgformat);
 			return Image();
 			return Image();
 		};
 		};

+ 1 - 1
core/io/resource_format_xml.cpp

@@ -571,7 +571,7 @@ Error ResourceInteractiveLoaderXML::parse_property(Variant& r_v, String &r_name)
 			int w=width.to_int();
 			int w=width.to_int();
 			int h=height.to_int();
 			int h=height.to_int();
 
 
-			if (w == 0 && w == 0) {
+			if (w == 0 && h == 0) {
 				//r_v = Image(w, h, imgformat);
 				//r_v = Image(w, h, imgformat);
 				r_v=Image();
 				r_v=Image();
 				String sdfsdfg;
 				String sdfsdfg;