Merge pull request #15229 from firefly2442/cppcheck

Minor cppcheck fixes
This commit is contained in:
Noshyaar 2018-01-04 13:22:09 +07:00 committed by GitHub
commit dbefa06d79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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; 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()); //printf("copy %s -> %s\n",p_from.ascii().get_data(),p_to.ascii().get_data());
Error err; Error err;
@ -330,9 +330,9 @@ Error DirAccess::copy(String p_from, String p_to, int chmod_flags) {
fdst->store_8(fsrc->get_8()); fdst->store_8(fsrc->get_8());
} }
if (err == OK && chmod_flags != -1) { if (err == OK && p_chmod_flags != -1) {
fdst->close(); 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 running on a platform with no chmod support (i.e., Windows), don't fail
if (err == ERR_UNAVAILABLE) if (err == ERR_UNAVAILABLE)
err = OK; err = OK;

View File

@ -92,8 +92,8 @@ public:
static bool exists(String p_dir); static bool exists(String p_dir);
virtual size_t get_space_left() = 0; virtual size_t get_space_left() = 0;
Error copy_dir(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 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 rename(String p_from, String p_to) = 0;
virtual Error remove(String p_name) = 0; virtual Error remove(String p_name) = 0;

View File

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

View File

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

View File

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

View File

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

View File

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