[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [61066] trunk/blender/source/blender: code cleanup: warnings

Sergey Sharybin sergey.vfx at gmail.com
Sun Nov 3 10:25:56 CET 2013


Could see multiple allocations with the same block name of __func__. In
this particular case it's rather harmless (for until someone goes
initialize and adds return statement or so :), but i would rather be strict
about block names being unique named in general.

Any good reason not using "bmo wireframe verts_{src,neg,pos}" instead of
__func__?


On Sun, Nov 3, 2013 at 11:19 AM, Campbell Barton <ideasman42 at gmail.com>wrote:

> Revision: 61066
>
> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=61066
> Author:   campbellbarton
> Date:     2013-11-03 05:19:55 +0000 (Sun, 03 Nov 2013)
> Log Message:
> -----------
> code cleanup: warnings
>
> Modified Paths:
> --------------
>     trunk/blender/source/blender/bmesh/operators/bmo_wireframe.c
>     trunk/blender/source/blender/editors/transform/transform.c
>
> Modified: trunk/blender/source/blender/bmesh/operators/bmo_wireframe.c
> ===================================================================
> --- trunk/blender/source/blender/bmesh/operators/bmo_wireframe.c
>  2013-11-02 23:40:39 UTC (rev 61065)
> +++ trunk/blender/source/blender/bmesh/operators/bmo_wireframe.c
>  2013-11-03 05:19:55 UTC (rev 61066)
> @@ -172,9 +172,9 @@
>         BMIter itersub;
>
>         /* filled only with boundary verts */
> -       BMVert **verts_src      = MEM_mallocN(sizeof(BMVert **) *
> totvert_orig, __func__);
> -       BMVert **verts_neg      = MEM_mallocN(sizeof(BMVert **) *
> totvert_orig, __func__);
> -       BMVert **verts_pos      = MEM_mallocN(sizeof(BMVert **) *
> totvert_orig, __func__);
> +       BMVert **verts_src      = MEM_mallocN(sizeof(BMVert *) *
> totvert_orig, __func__);
> +       BMVert **verts_neg      = MEM_mallocN(sizeof(BMVert *) *
> totvert_orig, __func__);
> +       BMVert **verts_pos      = MEM_mallocN(sizeof(BMVert *) *
> totvert_orig, __func__);
>
>         /* will over-alloc, but makes for easy lookups by index to keep
> aligned  */
>         BMVert **verts_boundary = use_boundary ?
>
> Modified: trunk/blender/source/blender/editors/transform/transform.c
> ===================================================================
> --- trunk/blender/source/blender/editors/transform/transform.c  2013-11-02
> 23:40:39 UTC (rev 61065)
> +++ trunk/blender/source/blender/editors/transform/transform.c  2013-11-03
> 05:19:55 UTC (rev 61066)
> @@ -4262,7 +4262,7 @@
>                 }
>         }
>         BLI_snprintf(str + ofs, MAX_INFO_LEN - ofs, IFACE_(" or Alt) Even
> Thickness %s"),
> -                    WM_bool_as_string(t->flag & T_ALT_TRANSFORM));
> +                    WM_bool_as_string((t->flag & T_ALT_TRANSFORM) != 0));
>         /* done with header string */
>
>
> @@ -6946,7 +6946,7 @@
>                 }
>         }
>         ofs += BLI_snprintf(str + ofs, MAX_INFO_LEN - ofs, IFACE_(" or
> Alt) Expand to fit %s"),
> -                           WM_bool_as_string(t->flag & T_ALT_TRANSFORM));
> +                           WM_bool_as_string((t->flag & T_ALT_TRANSFORM)
> != 0));
>  }
>
>  static void applySeqSlideValue(TransInfo *t, const float val[2])
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>



-- 
With best regards, Sergey Sharybin


More information about the Bf-committers mailing list