Преглед изворни кода

found via cppcheck:
remove code that will never run
make definition and declaration names for parameters match
change floats that were being set to bool values
remove pointer that is never used

firefly2442 пре 7 година
родитељ
комит
f066991aa7

+ 3 - 3
core/os/dir_access.cpp

@@ -293,7 +293,7 @@ String DirAccess::get_full_path(const String &p_path, AccessType p_access) {
 	return full;
 }
 
-Error DirAccess::copy(String p_from, String p_to, int chmod_flags) {
+Error DirAccess::copy(String p_from, String p_to, int p_chmod_flags) {
 
 	//printf("copy %s -> %s\n",p_from.ascii().get_data(),p_to.ascii().get_data());
 	Error err;
@@ -330,9 +330,9 @@ Error DirAccess::copy(String p_from, String p_to, int chmod_flags) {
 		fdst->store_8(fsrc->get_8());
 	}
 
-	if (err == OK && chmod_flags != -1) {
+	if (err == OK && p_chmod_flags != -1) {
 		fdst->close();
-		err = fdst->_chmod(p_to, chmod_flags);
+		err = fdst->_chmod(p_to, p_chmod_flags);
 		// If running on a platform with no chmod support (i.e., Windows), don't fail
 		if (err == ERR_UNAVAILABLE)
 			err = OK;

+ 2 - 2
core/os/dir_access.h

@@ -92,8 +92,8 @@ public:
 	static bool exists(String p_dir);
 	virtual size_t get_space_left() = 0;
 
-	Error copy_dir(String p_from, String p_to, int chmod_flags = -1);
-	virtual Error copy(String p_from, String p_to, int chmod_flags = -1);
+	Error copy_dir(String p_from, String p_to, int p_chmod_flags = -1);
+	virtual Error copy(String p_from, String p_to, int p_chmod_flags = -1);
 	virtual Error rename(String p_from, String p_to) = 0;
 	virtual Error remove(String p_name) = 0;
 

+ 1 - 1
drivers/gles3/rasterizer_storage_gles3.h

@@ -1180,7 +1180,7 @@ public:
 
 			clear = true;
 			inactive = true;
-			inactive_time = false;
+			inactive_time = 0.0;
 
 			glGenBuffers(2, particle_buffers);
 			glGenVertexArrays(2, particle_vaos);

+ 0 - 1
editor/plugins/baked_lightmap_editor_plugin.cpp

@@ -20,7 +20,6 @@ void BakedLightmapEditorPlugin::_bake() {
 			case BakedLightmap::BAKE_ERROR_CANT_CREATE_IMAGE:
 				EditorNode::get_singleton()->show_warning(TTR("Failed creating lightmap images, make sure path is writable."));
 				break;
-			defaut : {}
 		}
 	}
 }

+ 0 - 2
scene/gui/tree.cpp

@@ -2352,8 +2352,6 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
 						last_keypress = 0;
 				}
 			} break;
-
-				last_keypress = 0;
 		}
 	}
 

+ 1 - 1
scene/resources/environment.cpp

@@ -1218,7 +1218,7 @@ Environment::Environment() {
 	ssao_radius2 = 0;
 	ssao_intensity2 = 1;
 	ssao_bias = 0.01;
-	ssao_direct_light_affect = false;
+	ssao_direct_light_affect = 0.0;
 	ssao_blur = SSAO_BLUR_3x3;
 	set_ssao_edge_sharpness(4);
 	set_ssao_quality(SSAO_QUALITY_LOW);

+ 0 - 1
servers/audio_server.cpp

@@ -122,7 +122,6 @@ int AudioDriverManager::get_driver_count() {
 }
 
 void AudioDriverManager::initialize(int p_driver) {
-	AudioDriver *driver;
 	int failed_driver = -1;
 
 	// Check if there is a selected driver