Browse Source

Merge pull request #37463 from akien-mga/fix-Wmaybe-uninitialized-tools

Fix more -Wmaybe-uninitialized warnings with target=release_debug
Rémi Verschelde 5 years ago
parent
commit
eab934e868

+ 1 - 1
editor/import/resource_importer_texture.cpp

@@ -424,7 +424,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
 	String normal_map = p_options["roughness/src_normal"];
 
 	Ref<Image> normal_image;
-	Image::RoughnessChannel roughness_channel;
+	Image::RoughnessChannel roughness_channel = Image::ROUGHNESS_CHANNEL_R;
 
 	if (mipmaps && roughness > 1 && FileAccess::exists(normal_map)) {
 		normal_image.instance();

+ 2 - 5
editor/plugins/mesh_instance_3d_editor_plugin.cpp

@@ -337,18 +337,15 @@ void MeshInstance3DEditor::_create_uv_lines(int p_layer) {
 		const Vector2 *r = uv.ptr();
 
 		Vector<int> indices = a[Mesh::ARRAY_INDEX];
-		const int *ri;
+		const int *ri = NULL;
 
 		int ic;
-		bool use_indices;
 
 		if (indices.size()) {
 			ic = indices.size();
 			ri = indices.ptr();
-			use_indices = true;
 		} else {
 			ic = uv.size();
-			use_indices = false;
 		}
 
 		for (int j = 0; j < ic; j += 3) {
@@ -356,7 +353,7 @@ void MeshInstance3DEditor::_create_uv_lines(int p_layer) {
 			for (int k = 0; k < 3; k++) {
 
 				MeshInstance3DEditorEdgeSort edge;
-				if (use_indices) {
+				if (ri) {
 					edge.a = r[ri[j + k]];
 					edge.b = r[ri[j + ((k + 1) % 3)]];
 				} else {

+ 1 - 2
editor/plugins/polygon_2d_editor_plugin.cpp

@@ -1031,7 +1031,7 @@ void Polygon2DEditor::_uv_draw() {
 		uvs = node->get_polygon();
 	}
 
-	const float *weight_r;
+	const float *weight_r = NULL;
 
 	if (uv_edit_mode[3]->is_pressed()) {
 		int bone_selected = -1;
@@ -1044,7 +1044,6 @@ void Polygon2DEditor::_uv_draw() {
 		}
 
 		if (bone_selected != -1 && node->get_bone_weights(bone_selected).size() == uvs.size()) {
-
 			weight_r = node->get_bone_weights(bone_selected).ptr();
 		}
 	}

+ 1 - 1
modules/basis_universal/register_types.cpp

@@ -98,7 +98,7 @@ static Vector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Image::
 		params.m_mip_gen = false; //sorry, please some day support provided mipmaps.
 		params.m_source_images.push_back(buimg);
 
-		BasisDecompressFormat decompress_format;
+		BasisDecompressFormat decompress_format = BASIS_DECOMPRESS_RG;
 		params.m_check_for_alpha = false;
 
 		switch (p_channels) {

+ 2 - 1
servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp

@@ -29,6 +29,7 @@
 /*************************************************************************/
 
 #include "rasterizer_storage_rd.h"
+
 #include "core/engine.h"
 #include "core/project_settings.h"
 #include "servers/rendering/shader_language.h"
@@ -1664,7 +1665,7 @@ void RasterizerStorageRD::MaterialData::update_textures(const Map<StringName, Va
 	RasterizerStorageRD *singleton = (RasterizerStorageRD *)RasterizerStorage::base_singleton;
 #ifdef TOOLS_ENABLED
 	Texture *roughness_detect_texture = nullptr;
-	RS::TextureDetectRoughnessChannel roughness_channel;
+	RS::TextureDetectRoughnessChannel roughness_channel = RS::TEXTURE_DETECT_ROUGNHESS_R;
 	Texture *normal_detect_texture = nullptr;
 #endif