diff options
author | Hein-Pieter van Braam <hp@tmm.cx> | 2017-09-01 22:33:39 +0200 |
---|---|---|
committer | Hein-Pieter van Braam <hp@tmm.cx> | 2017-09-02 01:59:26 +0200 |
commit | 9c63ab99f0a505b0f60079bb30cc453b4415fddc (patch) | |
tree | 7014cb6e8c2e71a0583656f76d3d37d719a74fb0 /servers/visual | |
parent | dac150108ab3c1f41d5fd86cc6853f883064caaf (diff) |
Fix use of unitialized variables
The second in my quest to make Godot 3.x compile with -Werror on GCC7
Diffstat (limited to 'servers/visual')
-rw-r--r-- | servers/visual/shader_language.cpp | 2 | ||||
-rw-r--r-- | servers/visual/visual_server_scene.cpp | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 09f8a3775e..c7b537c8ea 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -2586,7 +2586,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons } bool index_valid = false; - DataType member_type; + DataType member_type = TYPE_VOID; switch (expr->get_datatype()) { case TYPE_BVEC2: diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 61ebc6e6de..0d70b7fc0e 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -948,13 +948,13 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons Vector3 z_vec = transform.basis.get_axis(Vector3::AXIS_Z).normalized(); //z_vec points agsint the camera, like in default opengl - float x_min, x_max; - float y_min, y_max; - float z_min, z_max; + float x_min = 0.f, x_max = 0.f; + float y_min = 0.f, y_max = 0.f; + float z_min = 0.f, z_max = 0.f; - float x_min_cam, x_max_cam; - float y_min_cam, y_max_cam; - float z_min_cam, z_max_cam; + float x_min_cam = 0.f, x_max_cam = 0.f; + float y_min_cam = 0.f, y_max_cam = 0.f; + float z_min_cam = 0.f, z_max_cam = 0.f; float bias_scale = 1.0; @@ -1503,7 +1503,7 @@ void VisualServerScene::_render_scene(const Transform p_cam_transform, const Cam InstanceLightData *light = static_cast<InstanceLightData *>(ins->base_data); - float coverage; + float coverage = 0.f; { //compute coverage |