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
This commit is contained in:
firefly2442 2018-01-03 21:17:30 -07:00
parent 914f51031c
commit f066991aa7
7 changed files with 7 additions and 11 deletions

View file

@ -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;

View file

@ -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;

View file

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

View file

@ -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 : {}
}
}
}

View file

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

View file

@ -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);

View file

@ -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