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 /modules | |
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 'modules')
-rw-r--r-- | modules/gdscript/gd_function.cpp | 6 | ||||
-rw-r--r-- | modules/squish/image_compress_squish.cpp | 6 | ||||
-rw-r--r-- | modules/stb_vorbis/audio_stream_ogg_vorbis.cpp | 2 | ||||
-rw-r--r-- | modules/stb_vorbis/audio_stream_ogg_vorbis.h | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script_yield_nodes.cpp | 2 |
5 files changed, 13 insertions, 5 deletions
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index e6f65fe0c2..cba1baaca3 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -290,8 +290,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a #ifdef DEBUG_ENABLED - uint64_t function_start_time; - uint64_t function_call_time; + uint64_t function_start_time = 0; + uint64_t function_call_time = 0; if (GDScriptLanguage::get_singleton()->profiling) { function_start_time = OS::get_singleton()->get_ticks_usec(); @@ -691,7 +691,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a } #ifdef DEBUG_ENABLED - uint64_t call_time; + uint64_t call_time = 0; if (GDScriptLanguage::get_singleton()->profiling) { call_time = OS::get_singleton()->get_ticks_usec(); diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index 29073a8499..072f18b990 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -91,7 +91,7 @@ void image_compress_squish(Image *p_image, Image::CompressSource p_source) { if (p_image->get_format() <= Image::FORMAT_RGBA8) { int squish_comp = squish::kColourRangeFit; - Image::Format target_format; + Image::Format target_format = Image::FORMAT_RGBA8; Image::DetectChannels dc = p_image->get_detected_channels(); @@ -140,6 +140,10 @@ void image_compress_squish(Image *p_image, Image::CompressSource p_source) { squish_comp |= squish::kDxt5; } break; + default: { + ERR_PRINT("Unknown image format, defaulting to RGBA8"); + break; + } } PoolVector<uint8_t> data; diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index ed184fc486..13e9d5c730 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -31,7 +31,9 @@ #include "os/file_access.h" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #include "thirdparty/misc/stb_vorbis.c" +#pragma GCC diagnostic pop void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_frames) { diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.h b/modules/stb_vorbis/audio_stream_ogg_vorbis.h index a459e6f31d..31fa589140 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.h +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.h @@ -34,7 +34,9 @@ #include "servers/audio/audio_stream.h" #define STB_VORBIS_HEADER_ONLY +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #include "thirdparty/misc/stb_vorbis.c" +#pragma GCC diagnostic pop #undef STB_VORBIS_HEADER_ONLY class AudioStreamOGGVorbis; diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp index 4b8e17421b..b6d4021ca3 100644 --- a/modules/visual_script/visual_script_yield_nodes.cpp +++ b/modules/visual_script/visual_script_yield_nodes.cpp @@ -516,7 +516,7 @@ public: } else { //yield - Object *object; + Object *object = NULL; switch (call_mode) { |