summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoshyaar <poommetee@protonmail.com>2018-01-04 13:22:09 +0700
committerGitHub <noreply@github.com>2018-01-04 13:22:09 +0700
commitdbefa06d79237e3a0241d169eaf05fc98c89101a (patch)
tree424ea3f7d04d415bdaee86e4cfaf8be0bfb89e1d
parent914f51031c54a36891418451ffe9a0490d2ab561 (diff)
parentf066991aa7bdf8c5e06f2255ea1df96e5daeac9f (diff)
Merge pull request #15229 from firefly2442/cppcheck
Minor cppcheck fixes
-rw-r--r--core/os/dir_access.cpp6
-rw-r--r--core/os/dir_access.h4
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.h2
-rw-r--r--editor/plugins/baked_lightmap_editor_plugin.cpp1
-rw-r--r--scene/gui/tree.cpp2
-rw-r--r--scene/resources/environment.cpp2
-rw-r--r--servers/audio_server.cpp1
7 files changed, 7 insertions, 11 deletions
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp
index c906fa7333..eadb8e8546 100644
--- a/core/os/dir_access.cpp
+++ b/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;
diff --git a/core/os/dir_access.h b/core/os/dir_access.h
index f29f61e838..c94ced657b 100644
--- a/core/os/dir_access.h
+++ b/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;
diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h
index 4ef4926a1a..74bd0a3cc1 100644
--- a/drivers/gles3/rasterizer_storage_gles3.h
+++ b/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);
diff --git a/editor/plugins/baked_lightmap_editor_plugin.cpp b/editor/plugins/baked_lightmap_editor_plugin.cpp
index 08f4d06ef7..6849563ae2 100644
--- a/editor/plugins/baked_lightmap_editor_plugin.cpp
+++ b/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 : {}
}
}
}
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 08f1bdff3d..f5eafba513 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -2352,8 +2352,6 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
last_keypress = 0;
}
} break;
-
- last_keypress = 0;
}
}
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index 6216893667..b2c91f90eb 100644
--- a/scene/resources/environment.cpp
+++ b/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);
diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp
index 0317fe45ae..f2198bdf2f 100644
--- a/servers/audio_server.cpp
+++ b/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