Quiet warnings
authorJulian Eisel <eiseljulian@gmail.com>
Thu, 3 Sep 2015 23:04:37 +0000 (01:04 +0200)
committerJulian Eisel <eiseljulian@gmail.com>
Thu, 3 Sep 2015 23:04:37 +0000 (01:04 +0200)
We had too many warnings lately... was awaiting that someone would kill them - didn't happen -> goes to my commit ratio! :P

30 files changed:
intern/ghost/intern/GHOST_ContextGLX.cpp
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/blenkernel/intern/mesh_mapping.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenlib/intern/fileops.c
source/blender/bmesh/operators/bmo_fill_grid.c
source/blender/bmesh/operators/bmo_inset.c
source/blender/bmesh/operators/bmo_subdivide.c
source/blender/bmesh/operators/bmo_utils.c
source/blender/bmesh/tools/bmesh_bevel.c
source/blender/bmesh/tools/bmesh_intersect.c
source/blender/editors/curve/editcurve_select.c
source/blender/editors/mask/mask_add.c
source/blender/editors/mask/mask_ops.c
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/object/object_bake_api.c
source/blender/editors/sculpt_paint/paint_image_2d.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_snap.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/modifiers/intern/MOD_screw.c
source/blender/python/mathutils/mathutils_bvhtree.c
source/blender/windowmanager/intern/wm_operators.c

index 3cce223..6d26666 100644 (file)
@@ -404,5 +404,7 @@ int GHOST_X11_GL_GetAttributes(
 
        GHOST_ASSERT(i <= attribs_max, "attribute size too small");
 
+       (void)attribs_max;
+
        return i;
 }
index aa9e956..8d7d62b 100644 (file)
@@ -2626,7 +2626,7 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
        BevPoint *bevp, *bevp2, *bevp1 = NULL, *bevp0;
        const float treshold = 0.00001f;
        float min, inp;
-       float *seglen;
+       float *seglen = NULL;
        struct BevelSort *sortdata, *sd, *sd1;
        int a, b, nr, poly, resolu = 0, len = 0, segcount;
        int *segbevcount;
index 3213b59..c830506 100644 (file)
@@ -1600,7 +1600,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                                                float bottom_no[3] = {0.0f};
                                                float top_no[3] = {0.0f};
                                                float firstblend = 0.0f, lastblend = 0.0f;
-                                               int i, start, steps;
+                                               int i, start, steps = 0;
 
                                                if (nu->flagu & CU_NURB_CYCLIC) {
                                                        calc_bevfac_mapping_default(bl,
index 7f1d2e8..7557015 100644 (file)
@@ -2085,7 +2085,7 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
                        int i, edge1_index, edge2_index,
                            e1_index, e2_index, target_tri;
                        float closest_point[2], lambda, dir_vec[2];
-                       int target_uv1, target_uv2, final_pixel[2], final_index;
+                       int target_uv1 = 0, target_uv2 = 0, final_pixel[2], final_index;
 
                        const float *s_uv1, *s_uv2, *t_uv1, *t_uv2;
 
@@ -3416,7 +3416,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
                                                        {
                                                                float proxDist = -1.0f;
                                                                float hitCo[3] = {0.0f, 0.0f, 0.0f};
-                                                               int tri;
+                                                               int tri = 0;
 
                                                                /* if inverse prox and no hit found, skip this sample */
                                                                if (inner_proximity && !hit_found) continue;
index f463cab..840935c 100644 (file)
@@ -397,7 +397,7 @@ static void emDM_calcLoopTangents(DerivedMesh *dm)
                mesh2tangent.precomputedLoopNormals = tlnors;
                mesh2tangent.looptris = em->looptris;
                mesh2tangent.cd_loop_uv_offset = cd_loop_uv_offset;
-               mesh2tangent.orco = orco;
+               mesh2tangent.orco = (const float (*)[3])orco;
                mesh2tangent.tangent = tangent;
                mesh2tangent.numTessFaces = totface;
 
index ef91363..cf4c49a 100644 (file)
@@ -65,7 +65,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(
        unsigned int a;
        int i, totuv, nverts;
 
-       bool *winding;
+       bool *winding = NULL;
        BLI_buffer_declare_static(vec2f, tf_uv_buf, BLI_BUFFER_NOP, 32);
 
        totuv = 0;
@@ -94,7 +94,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(
        mp = mpoly;
        for (a = 0; a < totpoly; a++, mp++) {
                if (!selected || (!(mp->flag & ME_HIDE) && (mp->flag & ME_FACE_SEL))) {
-                       float (*tf_uv)[2];
+                       float (*tf_uv)[2] = NULL;
 
                        if (use_winding) {
                                tf_uv = (float (*)[2])BLI_buffer_resize_data(&tf_uv_buf, vec2f, mp->totloop);
index 2e46281..5192a51 100644 (file)
@@ -2383,9 +2383,9 @@ static void ccgDM_buffer_copy_edge(
        /* part one, handle all normal edges */
        for (j = 0; j < totedge; j++) {
                CCGFace *f;
-               int fhandle;
-               int totvert;
-               unsigned int S;
+               int fhandle = 0;
+               int totvert = 0;
+               unsigned int S = 0;
                CCGEdge *e = ccgdm->edgeMap[j].edge;
                bool isloose = !ccgSubSurf_getEdgeNumFaces(e);
 
index bc95216..ef9a7c0 100644 (file)
@@ -570,7 +570,7 @@ static int recursive_operation(const char *startfrom, const char *startto,
        char *from_path = NULL, *to_path = NULL;
        struct dirent **dirlist = NULL;
        size_t from_alloc_len = -1, to_alloc_len = -1;
-       int i, n, ret = 0;
+       int i, n = 0, ret = 0;
 
        do {  /* once */
                /* ensure there's no trailing slash in file path */
index fd1e91a..0231874 100644 (file)
@@ -228,7 +228,7 @@ static void bm_grid_fill_array(
        unsigned int x, y;
 
        /* for use_loop_interp */
-       BMLoop *((*larr_x_a)[2]), *((*larr_x_b)[2]), *((*larr_y_a)[2]), *((*larr_y_b)[2]);
+       BMLoop *((*larr_x_a)[2]) = NULL, *((*larr_x_b)[2]) = NULL, *((*larr_y_a)[2]) = NULL, *((*larr_y_b)[2]) = NULL;
 
        float (*weight_table)[4];
 
index 118a19d..bb746a6 100644 (file)
@@ -276,7 +276,7 @@ static void bmo_face_inset_individual(
        BMLoop *l_iter, *l_first;
        BMLoop *l_other;
        unsigned int i;
-       float e_length_prev;
+       float e_length_prev = 0.0f;
 
        l_first = BM_FACE_FIRST_LOOP(f);
 
index 45e3c8d..72dd7c2 100644 (file)
@@ -787,7 +787,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
        BLI_array_declare(verts);
        float smooth, fractal, along_normal;
        bool use_sphere, use_single_edge, use_grid_fill, use_only_quads;
-       int cornertype, seed, i, j, a, b, numcuts, totesel, smooth_falloff;
+       int cornertype, seed, i, j, a, b = 0, numcuts, totesel, smooth_falloff;
        
        BMO_slot_buffer_flag_enable(bm, op->slots_in, "edges", BM_EDGE, SUBD_SPLIT);
        
index 964d0b1..60bb22f 100644 (file)
@@ -491,8 +491,8 @@ void bmo_rotate_uvs_exec(BMesh *bm, BMOperator *op)
                BMO_ITER (fs, &fs_iter, op->slots_in, "faces", BM_FACE) {
                        if (use_ccw == false) {  /* same loops direction */
                                BMLoop *lf;     /* current face loops */
-                               MLoopUV *f_luv; /* first face loop uv */
-                               float p_uv[2];  /* previous uvs */
+                               MLoopUV *f_luv = NULL; /* first face loop uv */
+                               float p_uv[2] = {0.0f, 0.0f};   /* previous uvs */
                                float t_uv[2];  /* tmp uvs */
 
                                int n = 0;
@@ -516,8 +516,8 @@ void bmo_rotate_uvs_exec(BMesh *bm, BMOperator *op)
                        else { /* counter loop direction */
                                BMLoop *lf;     /* current face loops */
                                MLoopUV *p_luv; /* previous loop uv */
-                               MLoopUV *luv;
-                               float t_uv[2];  /* current uvs */
+                               MLoopUV *luv = NULL;
+                               float t_uv[2] = {0.0f, 0.0f};   /* current uvs */
 
                                int n = 0;
                                BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) {
@@ -594,7 +594,7 @@ void bmo_rotate_colors_exec(BMesh *bm, BMOperator *op)
                BMO_ITER (fs, &fs_iter, op->slots_in, "faces", BM_FACE) {
                        if (use_ccw == false) {  /* same loops direction */
                                BMLoop *lf;     /* current face loops */
-                               MLoopCol *f_lcol; /* first face loop color */
+                               MLoopCol *f_lcol = NULL; /* first face loop color */
                                MLoopCol p_col; /* previous color */
                                MLoopCol t_col; /* tmp color */
 
@@ -619,7 +619,7 @@ void bmo_rotate_colors_exec(BMesh *bm, BMOperator *op)
                        else {  /* counter loop direction */
                                BMLoop *lf;     /* current face loops */
                                MLoopCol *p_lcol; /* previous loop color */
-                               MLoopCol *lcol;
+                               MLoopCol *lcol = NULL;
                                MLoopCol t_col; /* current color */
 
                                int n = 0;
index c7f77a7..9fba5b1 100644 (file)
@@ -4032,7 +4032,7 @@ static float find_superellipse_chord_u(float u0, float d2goal, float r)
  * Return the u's in *r_params, which should point to an array of size n+1. */
 static void find_even_superellipse_params(int n, float r, float *r_params)
 {
-       float d2low, d2high, d2, d2final, u;
+       float d2low, d2high, d2 = 0.0f, d2final, u;
        int i, j, n2;
        const int maxiters = 40;
        const float d2tol = 1e-6f;
index 169ad49..19cf2d2 100644 (file)
@@ -1000,7 +1000,7 @@ bool BM_mesh_intersect(
 
                                if (BM_vert_in_edge(e, v_prev)) {
                                        v_prev = BM_edge_split(bm, e, v_prev, NULL, CLAMPIS(fac, 0.0f, 1.0f));
-                                       BLI_assert( BM_vert_in_edge(e, v_end));
+                                       BLI_assert(BM_vert_in_edge(e, v_end));
 
                                        if (!BM_edge_exists(v_prev, vi) &&
                                            !BM_vert_splice_check_double(v_prev, vi) &&
@@ -1017,6 +1017,7 @@ bool BM_mesh_intersect(
                                        }
                                }
                        }
+                       UNUSED_VARS_NDEBUG(v_end);
                }
        }
 #endif
index cbb533a..885e8c6 100644 (file)
@@ -1579,7 +1579,7 @@ static void curve_select_shortest_path_surf(Nurb *nu, int vert_src, int vert_dst
 {
        Heap *heap;
 
-       int i, vert_curr;
+       int i, vert_curr = 0;
 
        int totu = nu->pntsu;
        int totv = nu->pntsv;
@@ -1725,4 +1725,4 @@ void CURVE_OT_shortest_path_pick(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/** \} */
\ No newline at end of file
+/** \} */
index 2dae956..822bb42 100644 (file)
@@ -74,7 +74,7 @@ bool ED_mask_find_nearest_diff_point(const bContext *C,
        MaskSplinePoint *point = NULL;
        float dist_best_sq = FLT_MAX, co[2];
        int width, height;
-       float u;
+       float u = 0.0f;
        float scalex, scaley;
 
        ED_mask_get_size(sa, &width, &height);
index 929c4f7..bf8630f 100644 (file)
@@ -516,7 +516,7 @@ static bool spline_under_mouse_get(const bContext *C,
        MaskLayer *mask_layer;
        int width, height;
        float pixel_co[2];
-       float closest_dist_squared;
+       float closest_dist_squared = 0.0f;
        MaskLayer *closest_layer = NULL;
        MaskSpline *closest_spline = NULL;
        bool undistort = false;
@@ -2209,7 +2209,7 @@ static int mask_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
                                }
                                if (end >= start) {
                                        int tot_point;
-                                       int tot_point_shape_start;
+                                       int tot_point_shape_start = 0;
                                        MaskSpline *new_spline = BKE_mask_spline_add(mask_layer);
                                        MaskSplinePoint *new_point;
                                        int b;
index d521b2c..96972f9 100644 (file)
@@ -668,7 +668,7 @@ UvVertMap *BM_uv_vert_map_create(
        
        BM_ITER_MESH_INDEX (efa, &iter, bm, BM_FACES_OF_MESH, a) {
                if ((use_select == false) || BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
-                       float (*tf_uv)[2];
+                       float (*tf_uv)[2] = NULL;
 
                        if (use_winding) {
                                tf_uv = (float (*)[2])BLI_buffer_resize_data(&tf_uv_buf, vec2f, efa->len);
@@ -779,7 +779,7 @@ UvElementMap *BM_uv_element_map_create(
        /* vars from original func */
        UvElementMap *element_map;
        UvElement *buf;
-       bool *winding;
+       bool *winding = NULL;
        BLI_buffer_declare_static(vec2f, tf_uv_buf, BLI_BUFFER_NOP, BM_DEFAULT_NGON_STACK_SIZE);
 
        MLoopUV *luv;
@@ -820,7 +820,7 @@ UvElementMap *BM_uv_element_map_create(
                }
 
                if (!selected || BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
-                       float (*tf_uv)[2];
+                       float (*tf_uv)[2] = NULL;
 
                        if (use_winding) {
                                tf_uv = (float (*)[2])BLI_buffer_resize_data(&tf_uv_buf, vec2f, efa->len);
index b382fba..2c4f7a8 100644 (file)
@@ -563,7 +563,7 @@ static int bake(
        Object *ob_cage = NULL;
 
        BakeHighPolyData *highpoly = NULL;
-       int tot_highpoly;
+       int tot_highpoly = 0;
 
        char restrict_flag_low = ob_low->restrictflag;
        char restrict_flag_cage = 0;
index 03a96fb..3113f03 100644 (file)
@@ -1591,7 +1591,7 @@ void paint_2d_gradient_fill(
        if (do_float) {
                for (x_px = 0; x_px < ibuf->x; x_px++) {
                        for (y_px = 0; y_px < ibuf->y; y_px++) {
-                               float f;
+                               float f = 0.0f;
                                float p[2] = {x_px - image_init[0], y_px - image_init[1]};
 
                                switch (br->gradient_fill_mode) {
@@ -1619,7 +1619,7 @@ void paint_2d_gradient_fill(
        else {
                for (x_px = 0; x_px < ibuf->x; x_px++) {
                        for (y_px = 0; y_px < ibuf->y; y_px++) {
-                               float f;
+                               float f = 0.0f;
                                float p[2] = {x_px - image_init[0], y_px - image_init[1]};
 
                                switch (br->gradient_fill_mode) {
index 2a1ae89..90cb7c0 100644 (file)
@@ -2695,7 +2695,7 @@ static void project_paint_face_init(
                                                interp_v3_v3v3(edge_verts_inset_clip[1], insetCos[fidx1], insetCos[fidx2], fac2);
 
 
-                                               if (pixel_bounds_uv(seam_subsection, &bounds_px, ibuf->x, ibuf->y)) {
+                                               if (pixel_bounds_uv((const float (*)[2])seam_subsection, &bounds_px, ibuf->x, ibuf->y)) {
                                                        /* bounds between the seam rect and the uvspace bucket pixels */
 
                                                        has_isect = 0;
@@ -4458,7 +4458,7 @@ static void *do_projectpaint_thread(void *ph_v)
                                                /* these could probably be cached instead of being done per pixel */
                                                float tangent[2];
                                                float line_len_sq_inv, line_len;
-                                               float f;
+                                               float f = 0.0f;
                                                float color_f[4];
                                                float p[2] = {projPixel->projCoSS[0] - lastpos[0], projPixel->projCoSS[1] - lastpos[1]};
 
@@ -4586,7 +4586,7 @@ static void *do_projectpaint_thread(void *ph_v)
                                        falloff = BKE_brush_curve_strength_clamped(ps->brush, dist, brush_radius);
 
                                        if (falloff > 0.0f) {
-                                               float texrgb[3];
+                                               float texrgb[3] = {0.0f, 0.0f, 0.0f};
                                                float mask;
 
                                                if (ps->do_masking) {
index 2a1b324..bb11fa0 100644 (file)
@@ -2156,7 +2156,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
        float paintweight;
        int *indexar;
        float totw;
-       unsigned int index, totindex;
+       unsigned int index, totindex = 0;
        float alpha;
        float mval[2];
        bool use_vert_sel;
index 462b619..8ca74fa 100644 (file)
@@ -453,7 +453,7 @@ static void text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int x,
 {
        const bool use_syntax = (st->showsyntax && format);
        FlattenString fs;
-       int columns, size, n, w = 0, padding, amount = 0;
+       int columns, size, n, w = 0, padding = 0, amount = 0;
        const char *in = NULL;
 
        for (n = flatten_string(st, &fs, str), str = fs.buf; n > 0; n--) {
index 3a8fa2a..f8f5a2c 100644 (file)
@@ -1119,7 +1119,7 @@ static void createTransArmatureVerts(TransInfo *t)
        bool mirror = ((arm->flag & ARM_MIRROR_EDIT) != 0);
        int total_mirrored = 0, i;
        int oldtot;
-       BoneInitData *bid;
+       BoneInitData *bid = NULL;
        
        t->total = 0;
        for (ebo = edbo->first; ebo; ebo = ebo->next) {
index 21bc25f..2eacb6c 100644 (file)
@@ -2163,8 +2163,8 @@ static bool peelDerivedMesh(
 
                        if (data.bvhdata.tree != NULL) {
                                data.ob = ob;
-                               data.obmat = obmat;
-                               data.timat = timat;
+                               data.obmat = (const float (*)[4])obmat;
+                               data.timat = (const float (*)[3])timat;
                                data.ray_start = ray_start;
                                data.looptri = looptri;
                                data.polynors = dm->getPolyDataArray(dm, CD_NORMAL);  /* can be NULL */
index 12292f4..903d655 100644 (file)
@@ -718,7 +718,7 @@ static char *code_generate_vertex(ListBase *nodes, const GPUMatType type)
        GPUNode *node;
        GPUInput *input;
        char *code;
-       char *vertcode;
+       char *vertcode = NULL;
        
        for (node = nodes->first; node; node = node->next) {
                for (input = node->inputs.first; input; input = input->next) {
index 7523c7c..b20d7d8 100644 (file)
@@ -235,7 +235,8 @@ static void displaceModifier_do(
 
                        clnors = CustomData_get_layer(ldata, CD_NORMAL);
                        vert_clnors = MEM_mallocN(sizeof(*vert_clnors) * (size_t)numVerts, __func__);
-                       BKE_mesh_normals_loop_to_vertex(numVerts, dm->getLoopArray(dm), dm->getNumLoops(dm), clnors, vert_clnors);
+                       BKE_mesh_normals_loop_to_vertex(numVerts, dm->getLoopArray(dm), dm->getNumLoops(dm),
+                                                       (const float (*)[3])clnors, vert_clnors);
                }
                else {
                        direction = MOD_DISP_DIR_NOR;
index db65f44..33a8520 100644 (file)
@@ -176,7 +176,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        MLoopUV **mloopuv_layers = BLI_array_alloca(mloopuv_layers, mloopuv_layers_tot);
        float uv_u_scale;
        float uv_v_minmax[2] = {FLT_MAX, -FLT_MAX};
-       float uv_v_range_inv;
+       float uv_v_range_inv = 0.0f;
        float uv_axis_plane[4];
 
        char axis_char = 'X';
@@ -196,7 +196,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
 
        unsigned int edge_offset;
        
-       MPoly *mpoly_orig, *mpoly_new, *mp_new;
+       MPoly *mpoly_orig = NULL, *mpoly_new, *mp_new;
        MLoop *mloop_orig, *mloop_new, *ml_new;
        MEdge *medge_orig, *med_orig, *med_new, *med_new_firstloop, *medge_new;
        MVert *mvert_new, *mvert_orig, *mv_orig, *mv_new, *mv_new_base;
@@ -877,7 +877,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
                const unsigned int step_last = step_tot - (close ? 1 : 2);
                const unsigned int mpoly_index_orig = totpoly ? edge_poly_map[i] : UINT_MAX;
                const bool has_mpoly_orig = (mpoly_index_orig != UINT_MAX);
-               float uv_v_offset_a, uv_v_offset_b;
+               float uv_v_offset_a = 0.0f, uv_v_offset_b = 0.0f;
 
                const unsigned int mloop_index_orig[2] = {
                    vert_loop_map ? vert_loop_map[medge_new[i].v1] : UINT_MAX,
index 8a488fd..bf06b88 100644 (file)
@@ -277,7 +277,7 @@ static void py_bvhtree_raycast_cb(void *userdata, int index, const BVHTreeRay *r
 {
        const PyBVHTree *self = userdata;
 
-       const float (*coords)[3] = self->coords;
+       const float (*coords)[3] = (const float (*)[3])self->coords;
        const unsigned int *tri = self->tris[index];
        const float *tri_co[3] = {coords[tri[0]], coords[tri[1]], coords[tri[2]]};
        float dist;
@@ -306,7 +306,7 @@ static void py_bvhtree_nearest_point_cb(void *userdata, int index, const float c
 {
        PyBVHTree *self = userdata;
 
-       const float (*coords)[3] = self->coords;
+       const float (*coords)[3] = (const float (*)[3])self->coords;
        const unsigned int *tri = self->tris[index];
        const float *tri_co[3] = {coords[tri[0]], coords[tri[1]], coords[tri[2]]};
        float nearest_tmp[3], dist_sq;
index 9c5e7fc..c9dd072 100644 (file)
@@ -4448,7 +4448,7 @@ static void radial_control_cancel(bContext *C, wmOperator *op)
 static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *event)
 {
        RadialControl *rc = op->customdata;
-       float new_value, dist, zoom[2];
+       float new_value, dist = 0.0f, zoom[2];
        float delta[2], ret = OPERATOR_RUNNING_MODAL;
        bool snap;
        float angle_precision = 0.0f;