Cleanup: indentation, naming
authorCampbell Barton <ideasman42@gmail.com>
Wed, 2 Jan 2019 06:03:45 +0000 (17:03 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 2 Jan 2019 06:07:47 +0000 (17:07 +1100)
Use rna naming conventions for unit-settings callbacks.

17 files changed:
source/blender/editors/curve/editcurve.c
source/blender/editors/gpencil/gpencil_merge.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/object/object_relations.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_particle.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_wm.c
source/blender/python/intern/bpy_rna.c

index 8c725dc8b9c414a5b575d6133c9e141ddc460f9a..84f8f17d4ee60150ef8681e6057de12fb4082b1b 100644 (file)
@@ -6133,8 +6133,9 @@ static const EnumPropertyItem curve_delete_type_items[] = {
        {0, NULL, 0, NULL, NULL}
 };
 
-static const EnumPropertyItem *rna_curve_delete_type_itemf(bContext *C, PointerRNA *UNUSED(ptr),
-                                                            PropertyRNA *UNUSED(prop), bool *r_free)
+static const EnumPropertyItem *rna_curve_delete_type_itemf(
+        bContext *C, PointerRNA *UNUSED(ptr),
+        PropertyRNA *UNUSED(prop), bool *r_free)
 {
        EnumPropertyItem *item = NULL;
        int totitem = 0;
index 02f71b193981f94bbd20b0395acfdf1167e4eb78..3641308ae175627cc6db2023342ce22598792e03 100644 (file)
@@ -208,9 +208,9 @@ static void gpencil_dissolve_points(bContext *C)
  * All the data is saved to be sorted and used later.
  */
 static void gpencil_calc_points_factor(
-                       bContext *C, const int mode, int totpoints,
-                       const bool clear_point, const bool clear_stroke,
-                       tGPencilPointCache *src_array)
+        bContext *C, const int mode, int totpoints,
+        const bool clear_point, const bool clear_stroke,
+        tGPencilPointCache *src_array)
 {
        bGPDspoint *pt;
        int i;
@@ -367,77 +367,77 @@ static void gpencil_get_extremes(
 }
 
 static int gpencil_analyze_strokes(
-               tGPencilPointCache *src_array, int totstrokes, int totpoints,
-               tGPencilPointCache *dst_array)
+        tGPencilPointCache *src_array, int totstrokes, int totpoints,
+        tGPencilPointCache *dst_array)
 {
-               int i;
-               int last = 0;
-               GHash *all_strokes = BLI_ghash_ptr_new(__func__);
-               /* add first stroke to array */
-               tGPencilPointCache *sort_pt = &src_array[0];
-               bGPDstroke *gps = sort_pt->gps;
-               last = gpencil_insert_to_array(src_array, dst_array, totpoints, gps, false, last);
-               float start[3];
-               float end[3];
-               float end_prv[3];
-               gpencil_get_extremes(src_array, totpoints, gps, start, end);
-               copy_v3_v3(end_prv, end);
-               BLI_ghash_insert(all_strokes, sort_pt->gps, sort_pt->gps);
-
-               /* look for near stroke */
-               bool loop = (bool)(totstrokes > 1);
-               while (loop) {
-                       bGPDstroke *gps_next = NULL;
-                       GHash *strokes = BLI_ghash_ptr_new(__func__);
-                       float dist_start = 0.0f;
-                       float dist_end = 0.0f;
-                       float dist = FLT_MAX;
-                       bool reverse = false;
-
-                       for (i = 0; i < totpoints; i++) {
-                               sort_pt = &src_array[i];
-                               /* avoid dups */
-                               if (BLI_ghash_haskey(all_strokes, sort_pt->gps)) {
-                                       continue;
+       int i;
+       int last = 0;
+       GHash *all_strokes = BLI_ghash_ptr_new(__func__);
+       /* add first stroke to array */
+       tGPencilPointCache *sort_pt = &src_array[0];
+       bGPDstroke *gps = sort_pt->gps;
+       last = gpencil_insert_to_array(src_array, dst_array, totpoints, gps, false, last);
+       float start[3];
+       float end[3];
+       float end_prv[3];
+       gpencil_get_extremes(src_array, totpoints, gps, start, end);
+       copy_v3_v3(end_prv, end);
+       BLI_ghash_insert(all_strokes, sort_pt->gps, sort_pt->gps);
+
+       /* look for near stroke */
+       bool loop = (bool)(totstrokes > 1);
+       while (loop) {
+               bGPDstroke *gps_next = NULL;
+               GHash *strokes = BLI_ghash_ptr_new(__func__);
+               float dist_start = 0.0f;
+               float dist_end = 0.0f;
+               float dist = FLT_MAX;
+               bool reverse = false;
+
+               for (i = 0; i < totpoints; i++) {
+                       sort_pt = &src_array[i];
+                       /* avoid dups */
+                       if (BLI_ghash_haskey(all_strokes, sort_pt->gps)) {
+                               continue;
+                       }
+                       if (!BLI_ghash_haskey(strokes, sort_pt->gps)) {
+                               gpencil_get_extremes(src_array, totpoints, sort_pt->gps, start, end);
+                               /* distances to previous end */
+                               dist_start = len_v3v3(end_prv, start);
+                               dist_end = len_v3v3(end_prv, end);
+
+                               if (dist > dist_start) {
+                                       gps_next = sort_pt->gps;
+                                       dist = dist_start;
+                                       reverse = false;
                                }
-                               if (!BLI_ghash_haskey(strokes, sort_pt->gps)) {
-                                       gpencil_get_extremes(src_array, totpoints, sort_pt->gps, start, end);
-                                       /* distances to previous end */
-                                       dist_start = len_v3v3(end_prv, start);
-                                       dist_end = len_v3v3(end_prv, end);
-
-                                       if (dist > dist_start) {
-                                               gps_next = sort_pt->gps;
-                                               dist = dist_start;
-                                               reverse = false;
-                                       }
-                                       if (dist > dist_end) {
-                                               gps_next = sort_pt->gps;
-                                               dist = dist_end;
-                                               reverse = true;
-                                       }
-                                       BLI_ghash_insert(strokes, sort_pt->gps, sort_pt->gps);
+                               if (dist > dist_end) {
+                                       gps_next = sort_pt->gps;
+                                       dist = dist_end;
+                                       reverse = true;
                                }
+                               BLI_ghash_insert(strokes, sort_pt->gps, sort_pt->gps);
                        }
-                       BLI_ghash_free(strokes, NULL, NULL);
-
-                       /* add the stroke to array */
-                       if (gps->next != NULL) {
-                               BLI_ghash_insert(all_strokes, gps_next, gps_next);
-                               last = gpencil_insert_to_array(src_array, dst_array, totpoints, gps_next, reverse, last);
-                               /* replace last end */
-                               sort_pt = &dst_array[last - 1];
-                               copy_v3_v3(end_prv, &sort_pt->x);
-                       }
+               }
+               BLI_ghash_free(strokes, NULL, NULL);
+
+               /* add the stroke to array */
+               if (gps->next != NULL) {
+                       BLI_ghash_insert(all_strokes, gps_next, gps_next);
+                       last = gpencil_insert_to_array(src_array, dst_array, totpoints, gps_next, reverse, last);
+                       /* replace last end */
+                       sort_pt = &dst_array[last - 1];
+                       copy_v3_v3(end_prv, &sort_pt->x);
+               }
 
-                       /* loop exit */
-                       if (last >= totpoints) {
-                               loop = false;
-                       }
+               /* loop exit */
+               if (last >= totpoints) {
+                       loop = false;
                }
+       }
 
-               BLI_ghash_free(all_strokes, NULL, NULL);
-               return last;
+       BLI_ghash_free(all_strokes, NULL, NULL);
+       return last;
 }
 
 static bool gp_strokes_merge_poll(bContext *C)
@@ -458,7 +458,7 @@ static bool gp_strokes_merge_poll(bContext *C)
        /* check hidden or locked materials */
        MaterialGPencilStyle *gp_style = ma->gp_style;
        if ((gp_style->flag & GP_STYLE_COLOR_HIDE) ||
-               (gp_style->flag & GP_STYLE_COLOR_LOCKED))
+           (gp_style->flag & GP_STYLE_COLOR_LOCKED))
        {
                return false;
        }
@@ -466,8 +466,8 @@ static bool gp_strokes_merge_poll(bContext *C)
        /* check layer */
        bGPDlayer *gpl = CTX_data_active_gpencil_layer(C);
        if ((gpl == NULL) ||
-               (gpl->flag & GP_LAYER_LOCKED) ||
-               (gpl->flag & GP_LAYER_HIDE))
+           (gpl->flag & GP_LAYER_LOCKED) ||
+           (gpl->flag & GP_LAYER_HIDE))
        {
                return false;
        }
@@ -523,7 +523,7 @@ static int gp_stroke_merge_exec(bContext *C, wmOperator *op)
 
        /* prepare the new stroke */
        bGPDstroke *gps = gpencil_prepare_stroke(C, op, totpoints);
-       
+
        /* copy original points to final stroke */
        gpencil_insert_points_to_stroke(gps, sorted_array, totpoints);
 
index ff9678550f95b2b9a3ab6ae7008930035e8da42a..204d6fe267ae4ea965a60352b628e87571d69c0a 100644 (file)
@@ -371,8 +371,8 @@ static void gp_stroke_convertcoords(tGPsdata *p, const float mval[2], float out[
 
                /* add small offset to keep stroke over the surface */
                if ((depth) &&
-                       (gpd->zdepth_offset > 0.0f) &&
-                       (*p->align_flag & GP_PROJECT_DEPTH_VIEW))
+                   (gpd->zdepth_offset > 0.0f) &&
+                   (*p->align_flag & GP_PROJECT_DEPTH_VIEW))
                {
                        *depth *= (1.0f - gpd->zdepth_offset);
                }
index 867b807c908d58e3efefb4629f871c3922d3d2fe..3dec9d945a1cbc159b90ce0b1153a07562e423f1 100644 (file)
@@ -385,8 +385,9 @@ static int make_proxy_exec(bContext *C, wmOperator *op)
 }
 
 /* Generic itemf's for operators that take library args */
-static const EnumPropertyItem *proxy_collection_object_itemf(bContext *C, PointerRNA *UNUSED(ptr),
-                                                             PropertyRNA *UNUSED(prop), bool *r_free)
+static const EnumPropertyItem *proxy_collection_object_itemf(
+        bContext *C, PointerRNA *UNUSED(ptr),
+        PropertyRNA *UNUSED(prop), bool *r_free)
 {
        EnumPropertyItem item_tmp = {0}, *item = NULL;
        int totitem = 0;
index ccf6f73f284629f0baaf82e2fed540ca7a9f2cfa..7ccdf32b44c958b5db32aab4ff9577caa2bbfd67 100644 (file)
@@ -529,8 +529,9 @@ static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
        brush->unprojected_radius = value;
 }
 
-static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, PointerRNA *ptr,
-                                                   PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_Brush_direction_itemf(
+        bContext *C, PointerRNA *ptr,
+        PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
 {
        ePaintMode mode = BKE_paintmode_get_active_from_context(C);
 
@@ -635,8 +636,9 @@ static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, PointerRNA
        }
 }
 
-static const EnumPropertyItem *rna_Brush_stroke_itemf(bContext *C, PointerRNA *UNUSED(ptr),
-                                                PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_Brush_stroke_itemf(
+        bContext *C, PointerRNA *UNUSED(ptr),
+        PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
 {
        ePaintMode mode = BKE_paintmode_get_active_from_context(C);
 
index b6bdb91720e6ecbd721201cc478232dfad1c415f..b92d156b674e80453873757723d4d111e053df2d 100644 (file)
@@ -302,8 +302,9 @@ static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
        BKE_curve_curve_dimension_update(cu);
 }
 
-static const EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                   PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_Curve_fill_mode_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr,
+        PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
 {
        Curve *cu = (Curve *)ptr->id.data;
 
index 3da9625eda25c383ab8fbb09e3525d44c70fc54e..0994d6287781ddf2cdcf589ffbc7ddd5c3b9326b 100644 (file)
@@ -179,8 +179,9 @@ static char *rna_ImageUser_path(PointerRNA *ptr)
        return BLI_strdup("");
 }
 
-static const EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                PropertyRNA *UNUSED(prop), bool *r_free)
+static const EnumPropertyItem *rna_Image_source_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr,
+        PropertyRNA *UNUSED(prop), bool *r_free)
 {
        Image *ima = (Image *)ptr->data;
        EnumPropertyItem *item = NULL;
index 560038edccee3ad7144e53eae65aa51c647664a7..6dd243087c470974f32a33c623023f2ce37b904b 100644 (file)
@@ -2657,8 +2657,9 @@ static const EnumPropertyItem *renderresult_layers_add_enum(RenderLayer *rl)
        return item;
 }
 
-static const EnumPropertyItem *rna_Node_image_layer_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                    PropertyRNA *UNUSED(prop), bool *r_free)
+static const EnumPropertyItem *rna_Node_image_layer_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr,
+        PropertyRNA *UNUSED(prop), bool *r_free)
 {
        bNode *node = (bNode *)ptr->data;
        Image *ima = (Image *)node->id;
@@ -2724,8 +2725,9 @@ static const EnumPropertyItem *renderresult_views_add_enum(RenderView *rv)
        return item;
 }
 
-static const EnumPropertyItem *rna_Node_image_view_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                   PropertyRNA *UNUSED(prop), bool *r_free)
+static const EnumPropertyItem *rna_Node_image_view_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr,
+        PropertyRNA *UNUSED(prop), bool *r_free)
 {
        bNode *node = (bNode *)ptr->data;
        Image *ima = (Image *)node->id;
@@ -2745,8 +2747,9 @@ static const EnumPropertyItem *rna_Node_image_view_itemf(bContext *UNUSED(C), Po
        return item;
 }
 
-static const EnumPropertyItem *rna_Node_view_layer_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                    PropertyRNA *UNUSED(prop), bool *r_free)
+static const EnumPropertyItem *rna_Node_view_layer_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr,
+        PropertyRNA *UNUSED(prop), bool *r_free)
 {
        bNode *node = (bNode *)ptr->data;
        Scene *sce = (Scene *)node->id;
@@ -2774,8 +2777,9 @@ static void rna_Node_view_layer_update(Main *bmain, Scene *scene, PointerRNA *pt
        }
 }
 
-static const EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                PropertyRNA *UNUSED(prop), bool *r_free)
+static const EnumPropertyItem *rna_Node_channel_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr,
+        PropertyRNA *UNUSED(prop), bool *r_free)
 {
        bNode *node = (bNode *)ptr->data;
        EnumPropertyItem *item = NULL;
index 661a3c25e453b63b3a511b6087d3d9c13bde3740..feb27018bcd8aac60d427a690d41c0566e6090ed 100644 (file)
@@ -471,8 +471,9 @@ static void rna_Object_parent_type_set(PointerRNA *ptr, int value)
        ED_object_parent(ob, ob->parent, value, ob->parsubstr);
 }
 
-static const EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                      PropertyRNA *UNUSED(prop), bool *r_free)
+static const EnumPropertyItem *rna_Object_parent_type_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr,
+        PropertyRNA *UNUSED(prop), bool *r_free)
 {
        Object *ob = (Object *)ptr->data;
        EnumPropertyItem *item = NULL;
index 6513fb44cf35a9f80879b6fcee3e6d90e3ac2b64..406ecd9a8eb0043eb30cc29e267a25b657100515 100644 (file)
@@ -689,8 +689,9 @@ static void rna_softbody_dependency_update(Main *bmain, Scene *scene, PointerRNA
        rna_softbody_update(bmain, scene, ptr);
 }
 
-static const EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                  PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_Effector_shape_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr,
+        PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
 {
        Object *ob = NULL;
 
index 89ddd162669fc2696717b4ffda1c0b503c2bc869..61707fa4670f9983fee7b57c340d1738df9e076f 100644 (file)
@@ -373,8 +373,9 @@ static void rna_ParticleSystem_co_hair(ParticleSystem *particlesystem, Object *o
 }
 
 
-static const EnumPropertyItem *rna_Particle_Material_itemf(bContext *C, PointerRNA *UNUSED(ptr),
-                                                      PropertyRNA *UNUSED(prop), bool *r_free)
+static const EnumPropertyItem *rna_Particle_Material_itemf(
+        bContext *C, PointerRNA *UNUSED(ptr),
+        PropertyRNA *UNUSED(prop), bool *r_free)
 {
        Object *ob = CTX_data_pointer_get(C, "object").data;
        Material *ma;
@@ -1154,8 +1155,9 @@ static int rna_ParticleDupliWeight_name_length(PointerRNA *ptr)
        return strlen(tstr);
 }
 
-static const EnumPropertyItem *rna_Particle_from_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
-                                                 PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_Particle_from_itemf(
+        bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
+        PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
 {
        /*if (part->type==PART_REACTOR) */
        /*      return part_reactor_from_items; */
@@ -1163,8 +1165,9 @@ static const EnumPropertyItem *rna_Particle_from_itemf(bContext *UNUSED(C), Poin
        return part_from_items;
 }
 
-static const EnumPropertyItem *rna_Particle_dist_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                 PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_Particle_dist_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr,
+        PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
 {
        ParticleSettings *part = ptr->id.data;
 
@@ -1174,8 +1177,9 @@ static const EnumPropertyItem *rna_Particle_dist_itemf(bContext *UNUSED(C), Poin
                return part_dist_items;
 }
 
-static const EnumPropertyItem *rna_Particle_draw_as_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                    PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_Particle_draw_as_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr,
+        PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
 {
        ParticleSettings *part = ptr->id.data;
 
@@ -1185,8 +1189,9 @@ static const EnumPropertyItem *rna_Particle_draw_as_itemf(bContext *UNUSED(C), P
                return part_draw_as_items;
 }
 
-static const EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                   PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_Particle_ren_as_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr,
+        PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
 {
        ParticleSettings *part = ptr->id.data;
 
index d5755387ba0fbb74fd28052f86d6c59131f0cbcb..bbd58b8c4dafc8ba4f39dfb2b6cad7b7fea021e5 100644 (file)
@@ -878,8 +878,9 @@ static int rna_StringProperty_max_length_get(PointerRNA *ptr)
        return ((StringPropertyRNA *)prop)->maxlength;
 }
 
-static const EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PointerRNA *ptr,
-                                                        PropertyRNA *prop_parent, bool *r_free)
+static const EnumPropertyItem *rna_EnumProperty_default_itemf(
+        bContext *C, PointerRNA *ptr,
+        PropertyRNA *prop_parent, bool *r_free)
 {
        PropertyRNA *prop = (PropertyRNA *)ptr->data;
        EnumPropertyRNA *eprop;
index e36a124073d60bb9d79861d50a8b5cd3ca2fb4b2..18db0cae8c020c948232d2cea706fc3fe9cbb802 100644 (file)
@@ -2113,7 +2113,8 @@ void rna_TransformOrientationSlot_ui_info(
        }
 }
 
-static const EnumPropertyItem *get_unit_enum_items(int system, int type, bool *r_free)
+static const EnumPropertyItem *rna_UnitSettings_itemf_wrapper(
+        const int system, const int type, bool *r_free)
 {
        const void *usys;
        int len;
@@ -2142,28 +2143,28 @@ static const EnumPropertyItem *get_unit_enum_items(int system, int type, bool *r
        return items;
 }
 
-const EnumPropertyItem *rna_get_length_unit_items(
+const EnumPropertyItem *rna_UnitSettings_length_unit_itemf(
         bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
 {
        UnitSettings *units = ptr->data;
-       return get_unit_enum_items(units->system, B_UNIT_LENGTH, r_free);
+       return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_LENGTH, r_free);
 }
 
-const EnumPropertyItem *rna_get_mass_unit_items(
+const EnumPropertyItem *rna_UnitSettings_mass_unit_itemf(
         bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
 {
        UnitSettings *units = ptr->data;
-       return get_unit_enum_items(units->system, B_UNIT_MASS, r_free);
+       return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_MASS, r_free);
 }
 
-const EnumPropertyItem *rna_get_time_unit_items(
+const EnumPropertyItem *rna_UnitSettings_time_unit_itemf(
         bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
 {
        UnitSettings *units = ptr->data;
-       return get_unit_enum_items(units->system, B_UNIT_TIME, r_free);
+       return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_TIME, r_free);
 }
 
-static void rna_unit_system_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
+static void rna_UnitSettings_system_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
 {
        UnitSettings *unit = &scene->unit;
        if (unit->system == USER_UNIT_NONE) {
@@ -3182,7 +3183,7 @@ static void rna_def_unit_settings(BlenderRNA *brna)
        prop = RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, unit_systems);
        RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display");
-       RNA_def_property_update(prop, NC_WINDOW, "rna_unit_system_update");
+       RNA_def_property_update(prop, NC_WINDOW, "rna_UnitSettings_system_update");
 
        prop = RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, rotation_units);
@@ -3204,19 +3205,19 @@ static void rna_def_unit_settings(BlenderRNA *brna)
 
        prop = RNA_def_property(srna, "length_unit", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, DummyRNA_DEFAULT_items);
-       RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_get_length_unit_items");
+       RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_UnitSettings_length_unit_itemf");
        RNA_def_property_ui_text(prop, "Length Unit", "Unit that will be used to display length values");
        RNA_def_property_update(prop, NC_WINDOW, NULL);
 
        prop = RNA_def_property(srna, "mass_unit", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, DummyRNA_DEFAULT_items);
-       RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_get_mass_unit_items");
+       RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_UnitSettings_mass_unit_itemf");
        RNA_def_property_ui_text(prop, "Mass Unit", "Unit that will be used to display mass values");
        RNA_def_property_update(prop, NC_WINDOW, NULL);
 
        prop = RNA_def_property(srna, "time_unit", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, DummyRNA_DEFAULT_items);
-       RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_get_time_unit_items");
+       RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_UnitSettings_time_unit_itemf");
        RNA_def_property_ui_text(prop, "Time Unit", "Unit that will be used to display time values");
        RNA_def_property_update(prop, NC_WINDOW, NULL);
 }
index 0a7c71a683e1045c5d39dd91b02ddb5a82689f9f..ab2a1b3dd82acca487e8bd278597ed0606abd00d 100644 (file)
@@ -145,8 +145,9 @@ static bool rna_Screen_fullscreen_get(PointerRNA *ptr)
 
 /* UI compatible list: should not be needed, but for now we need to keep EMPTY
  * at least in the static version of this enum for python scripts. */
-static const EnumPropertyItem *rna_Area_type_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
-                                             PropertyRNA *UNUSED(prop), bool *r_free)
+static const EnumPropertyItem *rna_Area_type_itemf(
+        bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
+        PropertyRNA *UNUSED(prop), bool *r_free)
 {
        EnumPropertyItem *item = NULL;
        int totitem = 0;
index def5a04f0cf7ce4eb7846d42f4e5f293ec509b6e..f582c7ce39957d099c193867ae8078443d1334c1 100644 (file)
@@ -425,8 +425,9 @@ static PointerRNA rna_Theme_space_list_generic_get(PointerRNA *ptr)
 
 
 #ifdef WITH_OPENSUBDIV
-static const EnumPropertyItem *rna_userdef_opensubdiv_compute_type_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
-                                                                   PropertyRNA *UNUSED(prop), bool *r_free)
+static const EnumPropertyItem *rna_userdef_opensubdiv_compute_type_itemf(
+        bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
+        PropertyRNA *UNUSED(prop), bool *r_free)
 {
        EnumPropertyItem *item = NULL;
        int totitem = 0;
@@ -468,8 +469,9 @@ static void rna_userdef_opensubdiv_update(Main *bmain, Scene *UNUSED(scene), Poi
 
 #endif
 
-static const EnumPropertyItem *rna_userdef_audio_device_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
-                                                        PropertyRNA *UNUSED(prop), bool *r_free)
+static const EnumPropertyItem *rna_userdef_audio_device_itemf(
+        bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
+        PropertyRNA *UNUSED(prop), bool *r_free)
 {
        int index = 0;
        int totitem = 0;
@@ -501,8 +503,9 @@ static const EnumPropertyItem *rna_userdef_audio_device_itemf(bContext *UNUSED(C
 }
 
 #ifdef WITH_INTERNATIONAL
-static const EnumPropertyItem *rna_lang_enum_properties_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
-                                                        PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_lang_enum_properties_itemf(
+        bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
+        PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
 {
        const EnumPropertyItem *items = BLT_lang_RNA_enum_properties();
        if (items == NULL) {
index 77b9d639fa7f074690f5e42839945839102699a5..475f53d9ef117cf04c973090cbfbac29131882ca 100644 (file)
@@ -877,8 +877,9 @@ static void rna_wmKeyMapItem_keymodifier_set(PointerRNA *ptr, int value)
 }
 
 
-static const EnumPropertyItem *rna_KeyMapItem_type_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop),
-                                                   bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_KeyMapItem_type_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop),
+        bool *UNUSED(r_free))
 {
        int map_type = rna_wmKeyMapItem_map_type_get(ptr);
 
@@ -890,8 +891,9 @@ static const EnumPropertyItem *rna_KeyMapItem_type_itemf(bContext *UNUSED(C), Po
        else return rna_enum_event_type_items;
 }
 
-static const EnumPropertyItem *rna_KeyMapItem_value_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop),
-                                                    bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_KeyMapItem_value_itemf(
+        bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop),
+        bool *UNUSED(r_free))
 {
        int map_type = rna_wmKeyMapItem_map_type_get(ptr);
 
@@ -903,8 +905,9 @@ static const EnumPropertyItem *rna_KeyMapItem_value_itemf(bContext *UNUSED(C), P
                return rna_enum_event_value_items;
 }
 
-static const EnumPropertyItem *rna_KeyMapItem_propvalue_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop),
-                                                        bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_KeyMapItem_propvalue_itemf(
+        bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop),
+        bool *UNUSED(r_free))
 {
        wmWindowManager *wm = CTX_wm_manager(C);
        wmKeyConfig *kc;
index cc4ad6c93eb74a25a7953ea9ff7516c2b38e9619..f25f007033fba1daf33d4dc2c91b8a6aad0739d4 100644 (file)
@@ -1401,41 +1401,39 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
                        ret = PyUnicode_FromString(identifier);
                }
                else {
-                       {
-                               /* Static, no need to free. */
-                               const EnumPropertyItem *enum_item;
-                               bool free_dummy;
-                               RNA_property_enum_items_ex(NULL, ptr, prop, true, &enum_item, NULL, &free_dummy);
-                               BLI_assert(!free_dummy);
-
-                               /* Do not print warning in case of DummyRNA_NULL_items, this one will never match any value... */
-                               if (enum_item != DummyRNA_NULL_items) {
-                                       const char *ptr_name = RNA_struct_name_get_alloc(ptr, NULL, 0, NULL);
-
-                                       /* prefer not fail silently in case of api errors, maybe disable it later */
-                                       CLOG_WARN(BPY_LOG_RNA,
-                                                 "current value '%d' "
-                                                 "matches no enum in '%s', '%s', '%s'",
-                                                 val, RNA_struct_identifier(ptr->type),
-                                                 ptr_name, RNA_property_identifier(prop));
+                       /* Static, no need to free. */
+                       const EnumPropertyItem *enum_item;
+                       bool free_dummy;
+                       RNA_property_enum_items_ex(NULL, ptr, prop, true, &enum_item, NULL, &free_dummy);
+                       BLI_assert(!free_dummy);
+
+                       /* Do not print warning in case of DummyRNA_NULL_items, this one will never match any value... */
+                       if (enum_item != DummyRNA_NULL_items) {
+                               const char *ptr_name = RNA_struct_name_get_alloc(ptr, NULL, 0, NULL);
+
+                               /* prefer not fail silently in case of api errors, maybe disable it later */
+                               CLOG_WARN(BPY_LOG_RNA,
+                                         "current value '%d' "
+                                         "matches no enum in '%s', '%s', '%s'",
+                                         val, RNA_struct_identifier(ptr->type),
+                                         ptr_name, RNA_property_identifier(prop));
 
 #if 0                          /* gives python decoding errors while generating docs :( */
-                                       char error_str[256];
-                                       BLI_snprintf(error_str, sizeof(error_str),
-                                                    "RNA Warning: Current value \"%d\" "
-                                                    "matches no enum in '%s', '%s', '%s'",
-                                                    val, RNA_struct_identifier(ptr->type),
-                                                    ptr_name, RNA_property_identifier(prop));
-
-                                       PyErr_Warn(PyExc_RuntimeWarning, error_str);
+                               char error_str[256];
+                               BLI_snprintf(error_str, sizeof(error_str),
+                                            "RNA Warning: Current value \"%d\" "
+                                            "matches no enum in '%s', '%s', '%s'",
+                                            val, RNA_struct_identifier(ptr->type),
+                                            ptr_name, RNA_property_identifier(prop));
+
+                               PyErr_Warn(PyExc_RuntimeWarning, error_str);
 #endif
 
-                                       if (ptr_name)
-                                               MEM_freeN((void *)ptr_name);
-                               }
-
-                               ret = PyUnicode_FromString("");
+                               if (ptr_name)
+                                       MEM_freeN((void *)ptr_name);
                        }
+
+                       ret = PyUnicode_FromString("");
 #if 0
                        PyErr_Format(PyExc_AttributeError,
                                     "RNA Error: Current value \"%d\" matches no enum", val);