mirror of
https://github.com/godotengine/godot
synced 2024-09-05 18:49:46 +00:00
Merge pull request #37351 from akien-mga/fix-warnings-Wmaybe-initialized
Fix some -Wmaybe-uninitialized warnings
This commit is contained in:
commit
9a7dbc2aca
|
@ -1680,7 +1680,7 @@ Error Image::generate_mipmap_roughness(RoughnessChannel p_roughness_channel, con
|
||||||
int pixel_ofs = y * w + x;
|
int pixel_ofs = y * w + x;
|
||||||
Color c = _get_color_at_ofs(ptr, pixel_ofs);
|
Color c = _get_color_at_ofs(ptr, pixel_ofs);
|
||||||
|
|
||||||
float roughness;
|
float roughness = 0;
|
||||||
|
|
||||||
switch (p_roughness_channel) {
|
switch (p_roughness_channel) {
|
||||||
case ROUGHNESS_CHANNEL_R: {
|
case ROUGHNESS_CHANNEL_R: {
|
||||||
|
|
|
@ -174,7 +174,8 @@ static Ref<Image> basis_universal_unpacker(const Vector<uint8_t> &p_buffer) {
|
||||||
//format = basist::transcoder_texture_format::cTFETC1; // get this from renderer
|
//format = basist::transcoder_texture_format::cTFETC1; // get this from renderer
|
||||||
//imgfmt = Image::FORMAT_RGTC_RG;
|
//imgfmt = Image::FORMAT_RGTC_RG;
|
||||||
} else {
|
} else {
|
||||||
//decompress
|
// FIXME: There wasn't anything here, but then imgformat is used uninitialized.
|
||||||
|
ERR_FAIL_V(image);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case BASIS_DECOMPRESS_RGB: {
|
case BASIS_DECOMPRESS_RGB: {
|
||||||
|
|
|
@ -749,7 +749,6 @@ void RasterizerSceneHighEndRD::_render_list(RenderingDevice::DrawListID p_draw_l
|
||||||
RD::get_singleton()->draw_list_bind_uniform_set(draw_list, default_vec4_xform_uniform_set, TRANSFORMS_UNIFORM_SET);
|
RD::get_singleton()->draw_list_bind_uniform_set(draw_list, default_vec4_xform_uniform_set, TRANSFORMS_UNIFORM_SET);
|
||||||
|
|
||||||
MaterialData *prev_material = nullptr;
|
MaterialData *prev_material = nullptr;
|
||||||
// ShaderData *prev_shader = nullptr;
|
|
||||||
|
|
||||||
RID prev_vertex_array_rd;
|
RID prev_vertex_array_rd;
|
||||||
RID prev_index_array_rd;
|
RID prev_index_array_rd;
|
||||||
|
@ -809,12 +808,11 @@ void RasterizerSceneHighEndRD::_render_list(RenderingDevice::DrawListID p_draw_l
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderVersion shader_version = SHADER_VERSION_MAX;
|
ShaderVersion shader_version = SHADER_VERSION_MAX; // Assigned to silence wrong -Wmaybe-initialized.
|
||||||
|
|
||||||
switch (p_pass_mode) {
|
switch (p_pass_mode) {
|
||||||
case PASS_MODE_COLOR:
|
case PASS_MODE_COLOR:
|
||||||
case PASS_MODE_COLOR_TRANSPARENT: {
|
case PASS_MODE_COLOR_TRANSPARENT: {
|
||||||
|
|
||||||
if (e->uses_lightmap) {
|
if (e->uses_lightmap) {
|
||||||
shader_version = SHADER_VERSION_LIGHTMAP_COLOR_PASS;
|
shader_version = SHADER_VERSION_LIGHTMAP_COLOR_PASS;
|
||||||
} else if (e->uses_vct) {
|
} else if (e->uses_vct) {
|
||||||
|
@ -822,7 +820,6 @@ void RasterizerSceneHighEndRD::_render_list(RenderingDevice::DrawListID p_draw_l
|
||||||
} else {
|
} else {
|
||||||
shader_version = SHADER_VERSION_COLOR_PASS;
|
shader_version = SHADER_VERSION_COLOR_PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case PASS_MODE_COLOR_SPECULAR: {
|
case PASS_MODE_COLOR_SPECULAR: {
|
||||||
if (e->uses_lightmap) {
|
if (e->uses_lightmap) {
|
||||||
|
|
|
@ -617,6 +617,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
|
||||||
} break;
|
} break;
|
||||||
case VS::ARRAY_INDEX: {
|
case VS::ARRAY_INDEX: {
|
||||||
|
|
||||||
|
ERR_FAIL_NULL_V(iw, ERR_INVALID_DATA);
|
||||||
ERR_FAIL_COND_V(p_index_array_len <= 0, ERR_INVALID_DATA);
|
ERR_FAIL_COND_V(p_index_array_len <= 0, ERR_INVALID_DATA);
|
||||||
ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_INT32_ARRAY, ERR_INVALID_PARAMETER);
|
ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_INT32_ARRAY, ERR_INVALID_PARAMETER);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue