Fix a few harmless maybe uninitialized warnings with GCC 5.4.

GCC seems to detect uninitialized into function calls now, but then isn't
always smart enough to see that it is actually initialized. Disabling this
warning entirely seems a bit too much, so initialize a bit more now.
This commit is contained in:
Brecht Van Lommel 2017-07-20 23:51:15 +02:00
parent 0d4fd7528f
commit db8bc1d982
9 changed files with 25 additions and 24 deletions

@ -50,8 +50,7 @@ enum {
* Two triangles has vertex indices in the original Blender-side face.
* If face is already a quad tri_b will not be initialized.
*/
inline void face_split_tri_indices(const int num_verts,
const int face_flag,
inline void face_split_tri_indices(const int face_flag,
int tri_a[3],
int tri_b[3])
{
@ -59,21 +58,19 @@ inline void face_split_tri_indices(const int num_verts,
tri_a[0] = 0;
tri_a[1] = 1;
tri_a[2] = 3;
if(num_verts == 4) {
tri_b[0] = 2;
tri_b[1] = 3;
tri_b[2] = 1;
}
tri_b[0] = 2;
tri_b[1] = 3;
tri_b[2] = 1;
}
else /*if(face_flag & FACE_FLAG_DIVIDE_13)*/ {
tri_a[0] = 0;
tri_a[1] = 1;
tri_a[2] = 2;
if(num_verts == 4) {
tri_b[0] = 0;
tri_b[1] = 2;
tri_b[2] = 3;
}
tri_b[0] = 0;
tri_b[1] = 2;
tri_b[2] = 3;
}
}
@ -250,7 +247,7 @@ static void mikk_compute_tangents(BL::Mesh& b_mesh,
for(int i = 0; i < nverts.size(); i++) {
int tri_a[3], tri_b[3];
face_split_tri_indices(nverts[i], face_flags[i], tri_a, tri_b);
face_split_tri_indices(face_flags[i], tri_a, tri_b);
tangent[0] = float4_to_float3(userdata.tangent[i*4 + tri_a[0]]);
tangent[1] = float4_to_float3(userdata.tangent[i*4 + tri_a[1]]);
@ -376,7 +373,7 @@ static void attr_create_vertex_color(Scene *scene,
for(l->data.begin(c); c != l->data.end(); ++c, ++i) {
int tri_a[3], tri_b[3];
face_split_tri_indices(nverts[i], face_flags[i], tri_a, tri_b);
face_split_tri_indices(face_flags[i], tri_a, tri_b);
uchar4 colors[4];
colors[0] = color_float_to_byte(color_srgb_to_scene_linear_v3(get_float3(c->color1())));
@ -469,7 +466,7 @@ static void attr_create_uv_map(Scene *scene,
for(l->data.begin(t); t != l->data.end(); ++t, ++i) {
int tri_a[3], tri_b[3];
face_split_tri_indices(nverts[i], face_flags[i], tri_a, tri_b);
face_split_tri_indices(face_flags[i], tri_a, tri_b);
float3 uvs[4];
uvs[0] = get_float3(t->uv1());

@ -51,8 +51,8 @@ static inline BL::Mesh object_to_mesh(BL::BlendData& data,
bool calc_undeformed,
Mesh::SubdivisionType subdivision_type)
{
bool subsurf_mod_show_render;
bool subsurf_mod_show_viewport;
bool subsurf_mod_show_render = false;
bool subsurf_mod_show_viewport = false;
if(subdivision_type != Mesh::SUBDIVISION_NONE) {
BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length()-1];

@ -206,9 +206,9 @@ void TaskScheduler::init(int num_threads)
threads.resize(num_threads);
const int num_groups = system_cpu_group_count();
unsigned short num_process_groups;
unsigned short num_process_groups = 0;
vector<unsigned short> process_groups;
int current_group_threads;
int current_group_threads = 0;
if(num_groups > 1) {
process_groups.resize(num_groups);
num_process_groups = system_cpu_process_groups(num_groups,

@ -132,7 +132,7 @@ static void image_buf_fill_checker_slice(unsigned char *rect,
float hsv[3] = {0.0f, 0.9f, 0.9f};
float rgb[3];
float dark_linear_color, bright_linear_color;
float dark_linear_color = 0.0f, bright_linear_color = 0.0f;
if (rect_float != NULL) {
dark_linear_color = srgb_to_linearrgb(0.25f);
bright_linear_color = srgb_to_linearrgb(0.58f);

@ -4754,6 +4754,9 @@ static void *do_projectpaint_thread(void *ph_v)
copy_v3_v3(texrgb, texrgba);
mask *= texrgba[3];
}
else {
zero_v3(texrgb);
}
/* extra mask for normal, layer stencil, .. */
mask *= ((float)projPixel->mask) * (1.0f / 65535.0f);

@ -426,7 +426,7 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr
Scene *scene = CTX_data_scene(C);
Paint *paint = BKE_paint_get_active_from_context(C);
Palette *palette = BKE_paint_palette(paint);
PaletteColor *color;
PaletteColor *color = NULL;
Brush *br = BKE_paint_brush(BKE_paint_get_active_from_context(C));
unsigned int col;
const unsigned char *cp;

@ -1169,6 +1169,7 @@ static int image_sequence_get_len(ListBase *frames, int *ofs)
}
return frame_curr - (*ofs);
}
*ofs = 0;
return 0;
}

@ -1104,7 +1104,7 @@ void IMB_exr_write_channels(void *handle)
if (data->channels.first) {
const size_t num_pixels = ((size_t)data->width) * data->height;
half *rect_half = NULL, *current_rect_half;
half *rect_half = NULL, *current_rect_half = NULL;
/* We allocate teporary storage for half pixels for all the channels at once. */
if (data->num_half_channels != 0) {

@ -301,8 +301,8 @@ void IMB_rectblend(ImBuf *dbuf, ImBuf *obuf, ImBuf *sbuf, unsigned short *dmask,
int destx, int desty, int origx, int origy, int srcx, int srcy, int width, int height,
IMB_BlendMode mode, bool accumulate)
{
unsigned int *drect = NULL, *orect, *srect = NULL, *dr, *or, *sr;
float *drectf = NULL, *orectf, *srectf = NULL, *drf, *orf, *srf;
unsigned int *drect = NULL, *orect = NULL, *srect = NULL, *dr, *or, *sr;
float *drectf = NULL, *orectf = NULL, *srectf = NULL, *drf, *orf, *srf;
unsigned short *cmaskrect = curvemask, *cmr;
unsigned short *dmaskrect = dmask, *dmr;
unsigned short *texmaskrect = texmask, *tmr;