Browse Source

Fix format string warnings on OS X

- %d expects an int so I added a cast to ensure we give it an int
  as on 64-bit what size() returns is larger than an int.
Nur Monson 12 năm trước cách đây
mục cha
commit
c9db46302c
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      Core/Contents/Source/PolyShader.cpp

+ 3 - 3
Core/Contents/Source/PolyShader.cpp

@@ -82,7 +82,7 @@ void ProgramParam::createParamData(int *retType, const String& type, const Strin
 			if(values.size() == 2) {
 				val->set(atof(values[0].c_str()), atof(values[1].c_str()));
 			} else {
-				printf("Error: A Vector2 must have 2 values (%d provided)!\n", values.size());
+				printf("Error: A Vector2 must have 2 values (%d provided)!\n", (int)values.size());
 			}
 			return;				
 		} else if(type == "Vector3") {
@@ -93,7 +93,7 @@ void ProgramParam::createParamData(int *retType, const String& type, const Strin
 			if(values.size() == 3) {
 				val->set(atof(values[0].c_str()), atof(values[1].c_str()), atof(values[2].c_str()));
 			} else {
-				printf("Error: A Vector3 must have 3 values (%d provided)!\n", values.size());
+				printf("Error: A Vector3 must have 3 values (%d provided)!\n", (int)values.size());
 			}
 			return;
 		} else if(type == "Color") {
@@ -104,7 +104,7 @@ void ProgramParam::createParamData(int *retType, const String& type, const Strin
 			if(values.size() == 4) {
 				val->setColor(atof(values[0].c_str()), atof(values[1].c_str()), atof(values[2].c_str()), atof(values[3].c_str()));
 			} else {
-				printf("Error: A Color must have 4 values (%d provided)!\n", values.size());
+				printf("Error: A Color must have 4 values (%d provided)!\n", (int)values.size());
 			}
 			return;			
 		} else {