From dfa8540cdfac0d8071faa8be80d82349962c566d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 Mar 2013 02:44:55 +0000 Subject: use bool for rna funcs. --- source/blender/makesrna/RNA_access.h | 122 ++++---- source/blender/makesrna/intern/makesrna.c | 3 +- source/blender/makesrna/intern/rna_ID.c | 13 +- source/blender/makesrna/intern/rna_access.c | 320 +++++++++++---------- source/blender/makesrna/intern/rna_action.c | 13 +- source/blender/makesrna/intern/rna_actuator.c | 15 +- source/blender/makesrna/intern/rna_animation.c | 14 +- source/blender/makesrna/intern/rna_animviz.c | 7 +- source/blender/makesrna/intern/rna_armature.c | 4 +- source/blender/makesrna/intern/rna_boid.c | 11 +- source/blender/makesrna/intern/rna_brush.c | 5 +- source/blender/makesrna/intern/rna_camera.c | 9 +- source/blender/makesrna/intern/rna_cloth.c | 9 +- source/blender/makesrna/intern/rna_color.c | 9 +- source/blender/makesrna/intern/rna_constraint.c | 12 +- source/blender/makesrna/intern/rna_context.c | 6 +- source/blender/makesrna/intern/rna_controller.c | 11 +- source/blender/makesrna/intern/rna_curve.c | 10 +- source/blender/makesrna/intern/rna_dynamicpaint.c | 9 +- source/blender/makesrna/intern/rna_fcurve.c | 13 +- source/blender/makesrna/intern/rna_gpencil.c | 13 +- source/blender/makesrna/intern/rna_group.c | 7 +- source/blender/makesrna/intern/rna_image.c | 13 +- source/blender/makesrna/intern/rna_image_api.c | 8 +- source/blender/makesrna/intern/rna_internal.h | 11 +- .../blender/makesrna/intern/rna_internal_types.h | 2 +- source/blender/makesrna/intern/rna_key.c | 13 +- source/blender/makesrna/intern/rna_lamp.c | 6 +- source/blender/makesrna/intern/rna_lattice.c | 12 +- source/blender/makesrna/intern/rna_mask.c | 8 +- source/blender/makesrna/intern/rna_material.c | 7 +- source/blender/makesrna/intern/rna_mesh.c | 17 +- source/blender/makesrna/intern/rna_meta.c | 9 +- source/blender/makesrna/intern/rna_modifier.c | 10 +- source/blender/makesrna/intern/rna_movieclip.c | 7 +- source/blender/makesrna/intern/rna_nla.c | 13 +- source/blender/makesrna/intern/rna_nodetree.c | 16 +- source/blender/makesrna/intern/rna_object.c | 13 +- source/blender/makesrna/intern/rna_object_force.c | 9 +- source/blender/makesrna/intern/rna_packedfile.c | 7 +- source/blender/makesrna/intern/rna_particle.c | 11 +- source/blender/makesrna/intern/rna_pose.c | 2 +- source/blender/makesrna/intern/rna_rna.c | 3 +- source/blender/makesrna/intern/rna_scene.c | 10 +- source/blender/makesrna/intern/rna_sensor.c | 11 +- source/blender/makesrna/intern/rna_sensor_api.c | 6 +- source/blender/makesrna/intern/rna_sequencer.c | 13 +- source/blender/makesrna/intern/rna_sequencer_api.c | 10 +- source/blender/makesrna/intern/rna_space.c | 11 +- source/blender/makesrna/intern/rna_text_api.c | 3 +- source/blender/makesrna/intern/rna_texture.c | 11 +- source/blender/makesrna/intern/rna_timeline.c | 5 +- source/blender/makesrna/intern/rna_userdef.c | 24 +- source/blender/makesrna/intern/rna_wm.c | 15 +- 54 files changed, 482 insertions(+), 469 deletions(-) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index e8c1a5d0642..2ceec970cf5 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -664,10 +664,10 @@ PropertyRNA *RNA_struct_name_property(StructRNA *type); PropertyRNA *RNA_struct_iterator_property(StructRNA *type); StructRNA *RNA_struct_base(StructRNA *type); -int RNA_struct_is_ID(StructRNA *type); -int RNA_struct_is_a(StructRNA *type, StructRNA *srna); +bool RNA_struct_is_ID(StructRNA *type); +bool RNA_struct_is_a(StructRNA *type, StructRNA *srna); -int RNA_struct_undo_check(StructRNA *type); +bool RNA_struct_undo_check(StructRNA *type); StructRegisterFunc RNA_struct_register(StructRNA *type); StructUnregisterFunc RNA_struct_unregister(StructRNA *type); @@ -679,13 +679,13 @@ void RNA_struct_py_type_set(StructRNA *srna, void *py_type); void *RNA_struct_blender_type_get(StructRNA *srna); void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type); -struct IDProperty *RNA_struct_idprops(PointerRNA *ptr, int create); -int RNA_struct_idprops_check(StructRNA *srna); -int RNA_struct_idprops_register_check(StructRNA *type); -int RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier); +struct IDProperty *RNA_struct_idprops(PointerRNA *ptr, bool create); +bool RNA_struct_idprops_check(StructRNA *srna); +bool RNA_struct_idprops_register_check(StructRNA *type); +bool RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier); PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier); -int RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test); +bool RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test); /* lower level functions for access to type properties */ const struct ListBase *RNA_struct_type_properties(StructRNA *srna); @@ -712,12 +712,12 @@ PropertyUnit RNA_property_unit(PropertyRNA *prop); int RNA_property_flag(PropertyRNA *prop); void *RNA_property_py_data_get(PropertyRNA *prop); -int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop); -int RNA_property_array_check(PropertyRNA *prop); -int RNA_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int dimension); -int RNA_property_array_dimension(PointerRNA *ptr, PropertyRNA *prop, int length[]); +int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop); +bool RNA_property_array_check(PropertyRNA *prop); +int RNA_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int dimension); +int RNA_property_array_dimension(PointerRNA *ptr, PropertyRNA *prop, int length[]); char RNA_property_array_item_char(PropertyRNA *prop, int index); -int RNA_property_array_item_index(PropertyRNA *prop, char name); +int RNA_property_array_item_index(PropertyRNA *prop, char name); int RNA_property_string_maxlength(PropertyRNA *prop); @@ -737,31 +737,31 @@ void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *soft int RNA_property_float_clamp(PointerRNA *ptr, PropertyRNA *prop, float *value); int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value); -int RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **identifier); -int RNA_enum_bitflag_identifiers(EnumPropertyItem *item, const int value, const char **identifier); -int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name); -int RNA_enum_description(EnumPropertyItem *item, const int value, const char **description); +bool RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **identifier); +int RNA_enum_bitflag_identifiers(EnumPropertyItem *item, const int value, const char **identifier); +bool RNA_enum_name(EnumPropertyItem *item, const int value, const char **r_name); +bool RNA_enum_description(EnumPropertyItem *item, const int value, const char **description); void RNA_property_enum_items(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free); void RNA_property_enum_items_gettexted(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free); -int RNA_property_enum_value(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value); -int RNA_property_enum_identifier(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier); -int RNA_property_enum_name(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **name); +bool RNA_property_enum_value(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *r_value); +bool RNA_property_enum_identifier(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier); +bool RNA_property_enum_name(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **name); int RNA_property_enum_bitflag_identifiers(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier); StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop); int RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *value); -int RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop); -int RNA_property_editable_index(PointerRNA *ptr, PropertyRNA *prop, int index); -int RNA_property_editable_flag(PointerRNA *ptr, PropertyRNA *prop); /* without lib check, only checks the flag */ -int RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop); -int RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop); -int RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop); /* slow, use with care */ +bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop); +bool RNA_property_editable_index(PointerRNA *ptr, PropertyRNA *prop, int index); +bool RNA_property_editable_flag(PointerRNA *ptr, PropertyRNA *prop); /* without lib check, only checks the flag */ +bool RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop); +bool RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop); +bool RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop); /* slow, use with care */ void RNA_property_update(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop); void RNA_property_update_main(struct Main *bmain, struct Scene *scene, PointerRNA *ptr, PropertyRNA *prop); -int RNA_property_update_check(struct PropertyRNA *prop); +bool RNA_property_update_check(struct PropertyRNA *prop); void RNA_property_update_cache_add(PointerRNA *ptr, PropertyRNA *prop); void RNA_property_update_cache_flush(struct Main *bmain, struct Scene *scene); @@ -826,7 +826,7 @@ int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, Poi int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr); int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr); int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, const PointerRNA *assign_ptr); -int RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr); +bool RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr); /* efficient functions to set properties for arrays */ int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, PropertyRNA *itemprop, RawArray *array); @@ -840,13 +840,13 @@ RawPropertyType RNA_property_raw_type(PropertyRNA *prop); void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop); void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop); void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr); -int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key); +bool RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key); void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop); -int RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int key, int pos); +bool RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int key, int pos); /* copy/reset */ -int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, int index); -int RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index); +bool RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, int index); +bool RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index); /* Path * @@ -885,36 +885,36 @@ char *RNA_path_property_py(struct PointerRNA *ptr, struct PropertyRNA *prop, int * There is no support for pointers and collections here yet, these can be * added when ID properties support them. */ -int RNA_boolean_get(PointerRNA *ptr, const char *name); +int RNA_boolean_get(PointerRNA *ptr, const char *name); void RNA_boolean_set(PointerRNA *ptr, const char *name, int value); void RNA_boolean_get_array(PointerRNA *ptr, const char *name, int *values); void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const int *values); -int RNA_int_get(PointerRNA *ptr, const char *name); +int RNA_int_get(PointerRNA *ptr, const char *name); void RNA_int_set(PointerRNA *ptr, const char *name, int value); void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values); void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values); float RNA_float_get(PointerRNA *ptr, const char *name); -void RNA_float_set(PointerRNA *ptr, const char *name, float value); -void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values); -void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values); +void RNA_float_set(PointerRNA *ptr, const char *name, float value); +void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values); +void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values); -int RNA_enum_get(PointerRNA *ptr, const char *name); +int RNA_enum_get(PointerRNA *ptr, const char *name); void RNA_enum_set(PointerRNA *ptr, const char *name, int value); void RNA_enum_set_identifier(PointerRNA *ptr, const char *name, const char *id); -int RNA_enum_is_equal(struct bContext *C, PointerRNA *ptr, const char *name, const char *enumname); +bool RNA_enum_is_equal(struct bContext *C, PointerRNA *ptr, const char *name, const char *enumname); /* lower level functions that don't use a PointerRNA */ -int RNA_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int *value); -int RNA_enum_id_from_value(EnumPropertyItem *item, int value, const char **identifier); -int RNA_enum_icon_from_value(EnumPropertyItem *item, int value, int *icon); -int RNA_enum_name_from_value(EnumPropertyItem *item, int value, const char **name); +bool RNA_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int *r_value); +bool RNA_enum_id_from_value(EnumPropertyItem *item, int value, const char **r_identifier); +bool RNA_enum_icon_from_value(EnumPropertyItem *item, int value, int *r_icon); +bool RNA_enum_name_from_value(EnumPropertyItem *item, int value, const char **r_name); -void RNA_string_get(PointerRNA *ptr, const char *name, char *value); +void RNA_string_get(PointerRNA *ptr, const char *name, char *value); char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen); -int RNA_string_length(PointerRNA *ptr, const char *name); -void RNA_string_set(PointerRNA *ptr, const char *name, const char *value); +int RNA_string_length(PointerRNA *ptr, const char *name); +void RNA_string_set(PointerRNA *ptr, const char *name, const char *value); /** * Retrieve the named property from PointerRNA. @@ -925,7 +925,7 @@ void RNA_pointer_set(PointerRNA *ptr, const char *name, PointerRNA ptr_value); void RNA_pointer_add(PointerRNA *ptr, const char *name); void RNA_collection_begin(PointerRNA *ptr, const char *name, CollectionPropertyIterator *iter); -int RNA_collection_length(PointerRNA *ptr, const char *name); +int RNA_collection_length(PointerRNA *ptr, const char *name); void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value); void RNA_collection_clear(PointerRNA *ptr, const char *name); @@ -975,11 +975,11 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name); } /* check if the idproperty exists, for operators */ -int RNA_property_is_set_ex(PointerRNA *ptr, PropertyRNA *prop, int use_ghost); -int RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop); -int RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, int use_ghost); -int RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier); -int RNA_property_is_idprop(PropertyRNA *prop); +bool RNA_property_is_set_ex(PointerRNA *ptr, PropertyRNA *prop, bool use_ghost); +bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop); +bool RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, bool use_ghost); +bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier); +bool RNA_property_is_idprop(PropertyRNA *prop); /* python compatible string representation of this property, (must be freed!) */ char *RNA_property_as_string(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index); @@ -1024,21 +1024,27 @@ int RNA_parameter_length_get_data(ParameterList *parms, PropertyRNA *parm, void void RNA_parameter_length_set(ParameterList *parms, PropertyRNA *parm, int length); void RNA_parameter_length_set_data(ParameterList *parms, PropertyRNA *parm, void *data, int length); -int RNA_function_call(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms); -int RNA_function_call_lookup(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, const char *identifier, ParameterList *parms); +int RNA_function_call(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, + FunctionRNA *func, ParameterList *parms); +int RNA_function_call_lookup(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, + const char *identifier, ParameterList *parms); -int RNA_function_call_direct(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, FunctionRNA *func, const char *format, ...) +int RNA_function_call_direct(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, + FunctionRNA *func, const char *format, ...) #ifdef __GNUC__ __attribute__ ((format(printf, 5, 6))) #endif ; -int RNA_function_call_direct_lookup(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, const char *identifier, const char *format, ...) +int RNA_function_call_direct_lookup(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, + const char *identifier, const char *format, ...) #ifdef __GNUC__ __attribute__ ((format(printf, 5, 6))) #endif ; -int RNA_function_call_direct_va(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, FunctionRNA *func, const char *format, va_list args); -int RNA_function_call_direct_va_lookup(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, const char *identifier, const char *format, va_list args); +int RNA_function_call_direct_va(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, + FunctionRNA *func, const char *format, va_list args); +int RNA_function_call_direct_va_lookup(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, + const char *identifier, const char *format, va_list args); /* ID */ diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 95222a067af..f3891c20ab5 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -24,7 +24,6 @@ * \ingroup RNA */ - #include #include #include @@ -34,6 +33,8 @@ #include "MEM_guardedalloc.h" +#include "BLI_utildefines.h" + #include "RNA_access.h" #include "RNA_define.h" #include "RNA_types.h" diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 184ee23b488..edc25ec3b6d 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -24,18 +24,19 @@ * \ingroup RNA */ - #include #include -#include "RNA_access.h" -#include "RNA_define.h" - #include "DNA_ID.h" #include "DNA_vfont_types.h" #include "DNA_material_types.h" #include "DNA_object_types.h" +#include "BLI_utildefines.h" + +#include "RNA_access.h" +#include "RNA_define.h" + #include "WM_types.h" #include "rna_internal.h" @@ -196,7 +197,7 @@ StructRNA *rna_ID_refine(PointerRNA *ptr) return ID_code_to_RNA_type(GS(id->name)); } -IDProperty *rna_ID_idprops(PointerRNA *ptr, int create) +IDProperty *rna_ID_idprops(PointerRNA *ptr, bool create) { return IDP_GetProperties(ptr->data, create); } @@ -215,7 +216,7 @@ void rna_ID_fake_user_set(PointerRNA *ptr, int value) } } -IDProperty *rna_PropertyGroup_idprops(PointerRNA *ptr, int UNUSED(create)) +IDProperty *rna_PropertyGroup_idprops(PointerRNA *ptr, bool UNUSED(create)) { return ptr->data; } diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 87c991424a7..f3efbd0d53e 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -52,12 +52,11 @@ #include "BKE_main.h" #include "BKE_report.h" - -#include "WM_api.h" - #include "RNA_access.h" #include "RNA_define.h" +#include "WM_api.h" + /* flush updates */ #include "DNA_object_types.h" #include "BKE_depsgraph.h" @@ -258,7 +257,7 @@ static IDProperty *rna_idproperty_ui(PropertyRNA *prop) return NULL; } -IDProperty *RNA_struct_idprops(PointerRNA *ptr, int create) +IDProperty *RNA_struct_idprops(PointerRNA *ptr, bool create) { StructRNA *type = ptr->type; @@ -268,9 +267,9 @@ IDProperty *RNA_struct_idprops(PointerRNA *ptr, int create) return NULL; } -int RNA_struct_idprops_check(StructRNA *srna) +bool RNA_struct_idprops_check(StructRNA *srna) { - return (srna && srna->idproperties) ? 1 : 0; + return (srna && srna->idproperties); } static IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name) @@ -299,15 +298,15 @@ static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop) } } -static int rna_ensure_property_array_check(PropertyRNA *prop) +static bool rna_ensure_property_array_check(PropertyRNA *prop) { if (prop->magic == RNA_MAGIC) { - return (prop->getlength || prop->totarraylength) ? 1 : 0; + return (prop->getlength || prop->totarraylength); } else { IDProperty *idprop = (IDProperty *)prop; - return idprop->type == IDP_ARRAY ? 1 : 0; + return (idprop->type == IDP_ARRAY); } } @@ -329,7 +328,7 @@ static void rna_ensure_property_multi_array_length(PointerRNA *ptr, PropertyRNA } } -static int rna_idproperty_verify_valid(PointerRNA *ptr, PropertyRNA *prop, IDProperty *idprop) +static bool rna_idproperty_verify_valid(PointerRNA *ptr, PropertyRNA *prop, IDProperty *idprop) { /* this verifies if the idproperty actually matches the property * description and otherwise removes it. this is to ensure that @@ -339,40 +338,40 @@ static int rna_idproperty_verify_valid(PointerRNA *ptr, PropertyRNA *prop, IDPro switch (idprop->type) { case IDP_IDPARRAY: if (prop->type != PROP_COLLECTION) - return 0; + return false; break; case IDP_ARRAY: if (rna_ensure_property_array_length(ptr, prop) != idprop->len) - return 0; + return false; if (idprop->subtype == IDP_FLOAT && prop->type != PROP_FLOAT) - return 0; + return false; if (idprop->subtype == IDP_INT && !ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM)) - return 0; + return false; break; case IDP_INT: if (!ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM)) - return 0; + return false; break; case IDP_FLOAT: case IDP_DOUBLE: if (prop->type != PROP_FLOAT) - return 0; + return false; break; case IDP_STRING: if (prop->type != PROP_STRING) - return 0; + return false; break; case IDP_GROUP: if (prop->type != PROP_POINTER) - return 0; + return false; break; default: - return 0; + return false; } - return 1; + return true; } static PropertyRNA *typemap[IDP_NUMTYPES] = { @@ -549,23 +548,23 @@ StructRNA *RNA_struct_base(StructRNA *type) return type->base; } -int RNA_struct_is_ID(StructRNA *type) +bool RNA_struct_is_ID(StructRNA *type) { return (type->flag & STRUCT_ID) != 0; } -int RNA_struct_undo_check(StructRNA *type) +bool RNA_struct_undo_check(StructRNA *type) { return (type->flag & STRUCT_UNDO) != 0; } -int RNA_struct_idprops_register_check(StructRNA *type) +bool RNA_struct_idprops_register_check(StructRNA *type) { return (type->flag & STRUCT_NO_IDPROPERTIES) == 0; } /* remove an id-property */ -int RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier) +bool RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier) { IDProperty *group = RNA_struct_idprops(ptr, 0); @@ -576,25 +575,25 @@ int RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier) IDP_FreeProperty(idp); MEM_freeN(idp); - return 1; + return true; } } - return 0; + return false; } -int RNA_struct_is_a(StructRNA *type, StructRNA *srna) +bool RNA_struct_is_a(StructRNA *type, StructRNA *srna) { StructRNA *base; if (!type) - return 0; + return false; /* ptr->type is always maximally refined */ for (base = type; base; base = base->base) if (base == srna) - return 1; + return true; - return 0; + return false; } PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier) @@ -637,13 +636,13 @@ static PropertyRNA *RNA_struct_find_nested(PointerRNA *ptr, StructRNA *srna) return prop; } -int RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test) +bool RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test) { /* note, prop_test could be freed memory, only use for comparison */ /* validate the RNA is ok */ PropertyRNA *iterprop; - int found = FALSE; + bool found = false; iterprop = RNA_struct_iterator_property(ptr->type); @@ -651,7 +650,7 @@ int RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test) { /* PropertyRNA *prop = itemptr.data; */ if (prop_test == (PropertyRNA *)itemptr.data) { - found = TRUE; + found = true; break; } } @@ -812,7 +811,7 @@ int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop) return rna_ensure_property_array_length(ptr, prop); } -int RNA_property_array_check(PropertyRNA *prop) +bool RNA_property_array_check(PropertyRNA *prop) { return rna_ensure_property_array_check(prop); } @@ -1274,17 +1273,18 @@ void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA } -int RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value) +bool RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *r_value) { EnumPropertyItem *item, *item_array; - int free, found; + int free; + bool found; RNA_property_enum_items(C, ptr, prop, &item_array, NULL, &free); if (item_array) { for (item = item_array; item->identifier; item++) { if (item->identifier[0] && strcmp(item->identifier, identifier) == 0) { - *value = item->value; + *r_value = item->value; break; } } @@ -1296,97 +1296,100 @@ int RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, con } } else { - found = 0; + found = false; } return found; } -int RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **identifier) +bool RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **identifier) { for (; item->identifier; item++) { if (item->identifier[0] && item->value == value) { *identifier = item->identifier; - return 1; + return true; } } - return 0; + return false; } -int RNA_enum_bitflag_identifiers(EnumPropertyItem *item, const int value, const char **identifier) +int RNA_enum_bitflag_identifiers(EnumPropertyItem *item, const int value, const char **r_identifier) { int index = 0; for (; item->identifier; item++) { if (item->identifier[0] && item->value & value) { - identifier[index++] = item->identifier; + r_identifier[index++] = item->identifier; } } - identifier[index] = NULL; + r_identifier[index] = NULL; return index; } -int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name) +bool RNA_enum_name(EnumPropertyItem *item, const int value, const char **r_name) { for (; item->identifier; item++) { if (item->identifier[0] && item->value == value) { - *name = item->name; - return 1; + *r_name = item->name; + return true; } } - return 0; + return false; } -int RNA_enum_description(EnumPropertyItem *item, const int value, const char **description) +bool RNA_enum_description(EnumPropertyItem *item, const int value, const char **r_description) { for (; item->identifier; item++) { if (item->identifier[0] && item->value == value) { - *description = item->description; - return 1; + *r_description = item->description; + return true; } } - return 0; + return false; } -int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, - const char **identifier) +bool RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, + const char **identifier) { EnumPropertyItem *item = NULL; - int result, free; + int free; RNA_property_enum_items(C, ptr, prop, &item, NULL, &free); if (item) { + bool result; result = RNA_enum_identifier(item, value, identifier); if (free) MEM_freeN(item); return result; } - return 0; + return false; } -int RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **name) +bool RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **name) { EnumPropertyItem *item = NULL; - int result, free; + int free; RNA_property_enum_items(C, ptr, prop, &item, NULL, &free); if (item) { + bool result; result = RNA_enum_name(item, value, name); if (free) MEM_freeN(item); return result; } - return 0; + return false; } int RNA_property_enum_bitflag_identifiers(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier) { EnumPropertyItem *item = NULL; - int result, free; + int free; RNA_property_enum_items(C, ptr, prop, &item, NULL, &free); if (item) { + int result; result = RNA_enum_bitflag_identifiers(item, value, identifier); if (free) MEM_freeN(item); @@ -1417,7 +1420,7 @@ int RNA_property_ui_icon(PropertyRNA *prop) return rna_ensure_property(prop)->icon; } -int RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop) +bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop) { ID *id = ptr->id.data; int flag; @@ -1427,17 +1430,17 @@ int RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop) return (flag & PROP_EDITABLE) && (!id || !id->lib || (prop->flag & PROP_LIB_EXCEPTION)); } -int RNA_property_editable_flag(PointerRNA *ptr, PropertyRNA *prop) +bool RNA_property_editable_flag(PointerRNA *ptr, PropertyRNA *prop) { int flag; prop = rna_ensure_property(prop); flag = prop->editable ? prop->editable(ptr) : prop->flag; - return (flag & PROP_EDITABLE); + return (flag & PROP_EDITABLE) != 0; } /* same as RNA_property_editable(), except this checks individual items in an array */ -int RNA_property_editable_index(PointerRNA *ptr, PropertyRNA *prop, int index) +bool RNA_property_editable_index(PointerRNA *ptr, PropertyRNA *prop, int index) { ID *id; int flag; @@ -1459,34 +1462,34 @@ int RNA_property_editable_index(PointerRNA *ptr, PropertyRNA *prop, int index) return (flag & PROP_EDITABLE) && (!id || !id->lib || (prop->flag & PROP_LIB_EXCEPTION)); } -int RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop) +bool RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop) { /* check that base ID-block can support animation data */ if (!id_type_can_have_animdata(ptr->id.data)) - return 0; + return false; prop = rna_ensure_property(prop); if (!(prop->flag & PROP_ANIMATABLE)) - return 0; + return false; - return (prop->flag & PROP_EDITABLE); + return (prop->flag & PROP_EDITABLE) != 0; } -int RNA_property_animated(PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop)) +bool RNA_property_animated(PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop)) { /* would need to ask animation system */ - return 0; + return false; } /* this function is to check if its possible to create a valid path from the ID * its slow so don't call in a loop */ -int RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop) +bool RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop) { char *path = RNA_path_from_ID_to_property(ptr, prop); - int ret = 0; + bool ret = false; if (path) { PointerRNA id_ptr; @@ -1497,9 +1500,6 @@ int RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop) if (RNA_path_resolve(&id_ptr, path, &r_ptr, &r_prop) == TRUE) { ret = (prop == r_prop); } - else { - ret = FALSE; - } MEM_freeN(path); } @@ -1544,7 +1544,7 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR /* must keep in sync with 'rna_property_update' * note, its possible this returns a false positive in the case of PROP_CONTEXT_UPDATE * but this isn't likely to be a performance problem. */ -int RNA_property_update_check(PropertyRNA *prop) +bool RNA_property_update_check(PropertyRNA *prop) { return (prop->magic != RNA_MAGIC || prop->update || prop->noteflag); } @@ -1674,7 +1674,7 @@ int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); - BLI_assert(RNA_property_array_check(prop) == 0); + BLI_assert(RNA_property_array_check(prop) == false); if ((idprop = rna_idproperty_check(&prop, ptr))) return IDP_Int(idprop); @@ -1692,7 +1692,7 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); - BLI_assert(RNA_property_array_check(prop) == 0); + BLI_assert(RNA_property_array_check(prop) == false); /* just in case other values are passed */ if (value) value = 1; @@ -1725,7 +1725,7 @@ void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int *val IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); if ((idprop = rna_idproperty_check(&prop, ptr))) { if (prop->arraydimension == 0) @@ -1751,7 +1751,7 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index int len = rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); if (len <= RNA_MAX_ARRAY_LENGTH) { @@ -1776,7 +1776,7 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); if ((idprop = rna_idproperty_check(&prop, ptr))) { if (prop->arraydimension == 0) @@ -1814,7 +1814,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde int len = rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); if (len <= RNA_MAX_ARRAY_LENGTH) { @@ -1838,7 +1838,7 @@ int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); - BLI_assert(RNA_property_array_check(prop) == 0); + BLI_assert(RNA_property_array_check(prop) == false); return bprop->defaultvalue; } @@ -1848,7 +1848,7 @@ void RNA_property_boolean_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); if (prop->arraydimension == 0) values[0] = bprop->defaultvalue; @@ -1864,7 +1864,7 @@ int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i int len = rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); if (len <= RNA_MAX_ARRAY_LENGTH) { @@ -1889,7 +1889,7 @@ int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); - BLI_assert(RNA_property_array_check(prop) == 0); + BLI_assert(RNA_property_array_check(prop) == false); if ((idprop = rna_idproperty_check(&prop, ptr))) return IDP_Int(idprop); @@ -1907,7 +1907,7 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); - BLI_assert(RNA_property_array_check(prop) == 0); + BLI_assert(RNA_property_array_check(prop) == false); /* useful to check on bad values but set function should clamp */ /* BLI_assert(RNA_property_int_clamp(ptr, prop, &value) == 0); */ @@ -1939,7 +1939,7 @@ void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); if ((idprop = rna_idproperty_check(&prop, ptr))) { if (prop->arraydimension == 0) @@ -2002,7 +2002,7 @@ int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index) int len = rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_INT); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); if (len <= RNA_MAX_ARRAY_LENGTH) { @@ -2027,7 +2027,7 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); if ((idprop = rna_idproperty_check(&prop, ptr))) { if (prop->arraydimension == 0) @@ -2067,7 +2067,7 @@ void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, i int len = rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_INT); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); if (len <= RNA_MAX_ARRAY_LENGTH) { @@ -2097,7 +2097,7 @@ void RNA_property_int_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *pr IntPropertyRNA *iprop = (IntPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_INT); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); if (prop->arraydimension == 0) values[0] = iprop->defaultvalue; @@ -2113,7 +2113,7 @@ int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int i int len = rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_INT); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); if (len <= RNA_MAX_ARRAY_LENGTH) { @@ -2138,7 +2138,7 @@ float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); - BLI_assert(RNA_property_array_check(prop) == 0); + BLI_assert(RNA_property_array_check(prop) == false); if ((idprop = rna_idproperty_check(&prop, ptr))) { if (idprop->type == IDP_FLOAT) @@ -2160,7 +2160,7 @@ void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); - BLI_assert(RNA_property_array_check(prop) == 0); + BLI_assert(RNA_property_array_check(prop) == false); /* useful to check on bad values but set function should clamp */ /* BLI_assert(RNA_property_float_clamp(ptr, prop, &value) == 0); */ @@ -2199,7 +2199,7 @@ void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *val int i; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); if ((idprop = rna_idproperty_check(&prop, ptr))) { if (prop->arraydimension == 0) @@ -2267,7 +2267,7 @@ float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index int len = rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_FLOAT); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); if (len <= RNA_MAX_ARRAY_LENGTH) { @@ -2293,7 +2293,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa int i; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); if ((idprop = rna_idproperty_check(&prop, ptr))) { if (prop->arraydimension == 0) { @@ -2344,7 +2344,7 @@ void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int len = rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_FLOAT); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); if (len <= RNA_MAX_ARRAY_LENGTH) { @@ -2368,7 +2368,7 @@ float RNA_property_float_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); - BLI_assert(RNA_property_array_check(prop) == 0); + BLI_assert(RNA_property_array_check(prop) == false); return fprop->defaultvalue; } @@ -2378,7 +2378,7 @@ void RNA_property_float_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA * FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); if (prop->arraydimension == 0) values[0] = fprop->defaultvalue; @@ -2394,7 +2394,7 @@ float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i int len = rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_FLOAT); - BLI_assert(RNA_property_array_check(prop) != 0); + BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); if (len <= RNA_MAX_ARRAY_LENGTH) { @@ -2879,7 +2879,7 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA } } -int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key) +bool RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key) { IDProperty *idprop; /* CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; */ @@ -2904,10 +2904,11 @@ int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key) IDP_ResizeIDPArray(idprop, len - 1); } - return 1; + return true; + } + else if (prop->flag & PROP_IDPROPERTY) { + return true; } - else if (prop->flag & PROP_IDPROPERTY) - return 1; /* py api calls directly */ #if 0 @@ -2919,15 +2920,15 @@ int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key) RNA_parameter_list_free(¶ms); } - return 0; + return false; } /*else printf("%s %s.%s: only supported for id properties.\n", __func__, ptr->type->identifier, prop->identifier);*/ #endif - return 0; + return false; } -int RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int key, int pos) +bool RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int key, int pos) { IDProperty *idprop; @@ -2949,12 +2950,13 @@ int RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int key, in memcpy(&array[pos], &tmp, sizeof(IDProperty)); } - return 1; + return true; + } + else if (prop->flag & PROP_IDPROPERTY) { + return true; } - else if (prop->flag & PROP_IDPROPERTY) - return 1; - return 0; + return false; } void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop) @@ -3081,7 +3083,7 @@ int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const return 0; } -int RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr) +bool RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr) { BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); @@ -4572,7 +4574,7 @@ void RNA_enum_set_identifier(PointerRNA *ptr, const char *name, const char *id) } } -int RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char *enumname) +bool RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char *enumname) { PropertyRNA *prop = RNA_struct_find_property(ptr, name); EnumPropertyItem *item; @@ -4589,60 +4591,60 @@ int RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char MEM_freeN(item); printf("%s: %s.%s item %s not found.\n", __func__, ptr->type->identifier, name, enumname); - return 0; + return false; } else { printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name); - return 0; + return false; } } -int RNA_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int *value) +bool RNA_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int *r_value) { for (; item->identifier; item++) { if (strcmp(item->identifier, identifier) == 0) { - *value = item->value; - return 1; + *r_value = item->value; + return true; } } - return 0; + return false; } -int RNA_enum_id_from_value(EnumPropertyItem *item, int value, const char **identifier) +bool RNA_enum_id_from_value(EnumPropertyItem *item, int value, const char **r_identifier) { for (; item->identifier; item++) { if (item->value == value) { - *identifier = item->identifier; - return 1; + *r_identifier = item->identifier; + return true; } } - return 0; + return false; } -int RNA_enum_icon_from_value(EnumPropertyItem *item, int value, int *icon) +bool RNA_enum_icon_from_value(EnumPropertyItem *item, int value, int *r_icon) { for (; item->identifier; item++) { if (item->value == value) { - *icon = item->icon; - return 1; + *r_icon = item->icon; + return true; } } - return 0; + return false; } -int RNA_enum_name_from_value(EnumPropertyItem *item, int value, const char **name) +bool RNA_enum_name_from_value(EnumPropertyItem *item, int value, const char **r_name) { for (; item->identifier; item++) { if (item->value == value) { - *name = item->name; - return 1; + *r_name = item->name; + return true; } } - return 0; + return false; } void RNA_string_get(PointerRNA *ptr, const char *name, char *value) @@ -4773,29 +4775,29 @@ int RNA_collection_length(PointerRNA *ptr, const char *name) } } -int RNA_property_is_set_ex(PointerRNA *ptr, PropertyRNA *prop, int use_ghost) +bool RNA_property_is_set_ex(PointerRNA *ptr, PropertyRNA *prop, bool use_ghost) { if (prop->flag & PROP_IDPROPERTY) { IDProperty *idprop = rna_idproperty_find(ptr, prop->identifier); - return ((idprop != NULL) && (use_ghost == FALSE || !(idprop->flag & IDP_FLAG_GHOST))); + return ((idprop != NULL) && (use_ghost == false || !(idprop->flag & IDP_FLAG_GHOST))); } else { - return 1; + return true; } } -int RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop) +bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop) { if (prop->flag & PROP_IDPROPERTY) { IDProperty *idprop = rna_idproperty_find(ptr, prop->identifier); return ((idprop != NULL) && !(idprop->flag & IDP_FLAG_GHOST)); } else { - return 1; + return true; } } -int RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, int use_ghost) +bool RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, bool use_ghost) { PropertyRNA *prop = RNA_struct_find_property(ptr, identifier); @@ -4809,7 +4811,7 @@ int RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, int u } } -int RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier) +bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier) { PropertyRNA *prop = RNA_struct_find_property(ptr, identifier); @@ -4823,7 +4825,7 @@ int RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier) } } -int RNA_property_is_idprop(PropertyRNA *prop) +bool RNA_property_is_idprop(PropertyRNA *prop) { return (prop->magic != RNA_MAGIC); } @@ -5902,7 +5904,7 @@ int RNA_function_call_direct_va_lookup(bContext *C, ReportList *reports, Pointer return 0; } -int RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index) +bool RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index) { int len; @@ -5930,7 +5932,7 @@ int RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index) int value = RNA_property_boolean_get_default(ptr, prop); RNA_property_boolean_set(ptr, prop, value); } - return 1; + return true; case PROP_INT: if (len) { if (index == -1) { @@ -5950,7 +5952,7 @@ int RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index) int value = RNA_property_int_get_default(ptr, prop); RNA_property_int_set(ptr, prop, value); } - return 1; + return true; case PROP_FLOAT: if (len) { if (index == -1) { @@ -5970,12 +5972,12 @@ int RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index) float value = RNA_property_float_get_default(ptr, prop); RNA_property_float_set(ptr, prop, value); } - return 1; + return true; case PROP_ENUM: { int value = RNA_property_enum_get_default(ptr, prop); RNA_property_enum_set(ptr, prop, value); - return 1; + return true; } case PROP_STRING: @@ -5983,23 +5985,23 @@ int RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index) char *value = RNA_property_string_get_default_alloc(ptr, prop, NULL, 0); RNA_property_string_set(ptr, prop, value); MEM_freeN(value); - return 1; + return true; } case PROP_POINTER: { PointerRNA value = RNA_property_pointer_get_default(ptr, prop); RNA_property_pointer_set(ptr, prop, value); - return 1; + return true; } default: /* FIXME: are there still any cases that haven't been handled? comment out "default" block to check :) */ - return 0; + return false; } } -int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, int index) +bool RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, int index) { int len, fromlen; @@ -6008,7 +6010,7 @@ int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, i fromlen = RNA_property_array_length(fromptr, prop); if (len != fromlen) - return 0; + return false; /* get and set the default values as appropriate for the various types */ switch (RNA_property_type(prop)) { @@ -6031,7 +6033,7 @@ int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, i int value = RNA_property_boolean_get(fromptr, prop); RNA_property_boolean_set(ptr, prop, value); } - return 1; + return true; case PROP_INT: if (len) { if (index == -1) { @@ -6051,7 +6053,7 @@ int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, i int value = RNA_property_int_get(fromptr, prop); RNA_property_int_set(ptr, prop, value); } - return 1; + return true; case PROP_FLOAT: if (len) { if (index == -1) { @@ -6071,31 +6073,31 @@ int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, i float value = RNA_property_float_get(fromptr, prop); RNA_property_float_set(ptr, prop, value); } - return 1; + return true; case PROP_ENUM: { int value = RNA_property_enum_get(fromptr, prop); RNA_property_enum_set(ptr, prop, value); - return 1; + return true; } case PROP_POINTER: { PointerRNA value = RNA_property_pointer_get(fromptr, prop); RNA_property_pointer_set(ptr, prop, value); - return 1; + return true; } case PROP_STRING: { char *value = RNA_property_string_get_alloc(fromptr, prop, NULL, 0, NULL); RNA_property_string_set(ptr, prop, value); MEM_freeN(value); - return 1; + return true; } default: - return 0; + return false; } - return 0; + return false; } /* use RNA_warning macro which includes __func__ suffix */ diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 7de1f84acdd..ebd659ee92f 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -24,15 +24,8 @@ * \ingroup RNA */ - #include -#include "RNA_access.h" -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - #include "DNA_anim_types.h" #include "DNA_action_types.h" #include "DNA_scene_types.h" @@ -43,6 +36,12 @@ #include "BKE_action.h" +#include "RNA_access.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + #include "WM_types.h" diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index fe4a23cb393..2c022e80ddd 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -27,22 +27,23 @@ #include -#include "RNA_define.h" -#include "RNA_access.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" #include "DNA_constraint_types.h" #include "DNA_object_types.h" #include "DNA_actuator_types.h" #include "DNA_scene_types.h" /* for MAXFRAME */ -#include "WM_types.h" - #include "BLI_utildefines.h" #include "BLF_translation.h" +#include "RNA_define.h" +#include "RNA_access.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + +#include "WM_types.h" + /* Always keep in alphabetical order */ EnumPropertyItem actuator_type_items[] = { {ACT_ACTION, "ACTION", 0, "Action", ""}, diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index d6ea53f6ab3..0d44845076c 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -26,12 +26,6 @@ #include -#include "RNA_access.h" -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - #include "DNA_anim_types.h" #include "DNA_action_types.h" #include "DNA_scene_types.h" @@ -40,10 +34,16 @@ #include "MEM_guardedalloc.h" -#include "ED_keyframing.h" +#include "RNA_access.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" #include "WM_types.h" +#include "ED_keyframing.h" + /* exported for use in API */ EnumPropertyItem keyingset_path_grouping_items[] = { {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""}, diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c index 68075823a86..9f8f30b00a7 100644 --- a/source/blender/makesrna/intern/rna_animviz.c +++ b/source/blender/makesrna/intern/rna_animviz.c @@ -24,19 +24,20 @@ * \ingroup RNA */ - #include #include "RNA_define.h" -#include "rna_internal.h" - #include "DNA_anim_types.h" #include "DNA_action_types.h" #include "DNA_scene_types.h" +#include "BLI_utildefines.h" + #include "MEM_guardedalloc.h" +#include "rna_internal.h" + #include "WM_types.h" /* Which part of bone(s) get baked */ diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 6c48ed25b60..1bc6c7e4f6f 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -207,7 +207,7 @@ static char *rna_Bone_path(PointerRNA *ptr) return BLI_sprintfN("bones[\"%s\"]", bone->name); } -static IDProperty *rna_Bone_idprops(PointerRNA *ptr, int create) +static IDProperty *rna_Bone_idprops(PointerRNA *ptr, bool create) { Bone *bone = ptr->data; @@ -219,7 +219,7 @@ static IDProperty *rna_Bone_idprops(PointerRNA *ptr, int create) return bone->prop; } -static IDProperty *rna_EditBone_idprops(PointerRNA *ptr, int create) +static IDProperty *rna_EditBone_idprops(PointerRNA *ptr, bool create) { EditBone *ebone = ptr->data; diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c index 63f4e480468..9d44ae87b57 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -29,20 +29,21 @@ * \ingroup RNA */ - #include #include #include -#include "RNA_define.h" - -#include "rna_internal.h" - #include "DNA_scene_types.h" #include "DNA_boid_types.h" #include "DNA_object_types.h" #include "DNA_particle_types.h" +#include "BLI_utildefines.h" + +#include "RNA_define.h" + +#include "rna_internal.h" + #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index c995d3b52c7..03e8091258d 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -24,14 +24,11 @@ * \ingroup RNA */ - #include #include #include "RNA_define.h" -#include "rna_internal.h" - #include "DNA_brush_types.h" #include "DNA_texture_types.h" #include "DNA_scene_types.h" @@ -39,6 +36,8 @@ #include "BLI_math.h" +#include "rna_internal.h" + #include "IMB_imbuf.h" #include "WM_types.h" diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 5f11663c057..0413eeaf54b 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -24,17 +24,16 @@ * \ingroup RNA */ - #include -#include "RNA_define.h" - -#include "rna_internal.h" - #include "DNA_camera_types.h" #include "BLI_math.h" +#include "RNA_define.h" + +#include "rna_internal.h" + #include "WM_types.h" #ifdef RNA_RUNTIME diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index 69de86da007..1bf15fd0838 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -24,14 +24,9 @@ * \ingroup RNA */ - #include #include -#include "RNA_define.h" - -#include "rna_internal.h" - #include "BKE_cloth.h" #include "BKE_modifier.h" @@ -39,6 +34,10 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "RNA_define.h" + +#include "rna_internal.h" + #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index c70dc285b20..480a603ec0b 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -24,16 +24,17 @@ * \ingroup RNA */ - #include #include -#include "RNA_define.h" -#include "rna_internal.h" - #include "DNA_color_types.h" #include "DNA_texture_types.h" +#include "BLI_utildefines.h" + +#include "RNA_define.h" +#include "rna_internal.h" + #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 956483890f5..0bb3a8bbcff 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -24,13 +24,8 @@ * \ingroup RNA */ - #include -#include "RNA_define.h" - -#include "rna_internal.h" - #include "BLI_math.h" #include "BLF_translation.h" @@ -41,9 +36,14 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" -#include "ED_object.h" +#include "RNA_define.h" + +#include "rna_internal.h" + #include "WM_types.h" +#include "ED_object.h" + /* please keep the names in sync with constraint.c */ EnumPropertyItem constraint_type_items[] = { {0, "", 0, N_("Motion Tracking"), ""}, diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index 4204506e67b..d7a679e9702 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -24,17 +24,17 @@ * \ingroup RNA */ - #include #include "DNA_ID.h" #include "DNA_userdef_types.h" +#include "BLI_utildefines.h" +#include "BKE_context.h" + #include "RNA_access.h" #include "RNA_define.h" -#include "BKE_context.h" - #include "rna_internal.h" /* own include */ #ifdef RNA_RUNTIME diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c index c59e376da82..472cc6e89e6 100644 --- a/source/blender/makesrna/intern/rna_controller.c +++ b/source/blender/makesrna/intern/rna_controller.c @@ -24,15 +24,18 @@ * \ingroup RNA */ - #include -#include "WM_types.h" +#include "DNA_object_types.h" +#include "DNA_controller_types.h" + +#include "BLI_utildefines.h" + #include "RNA_define.h" #include "rna_internal.h" -#include "DNA_object_types.h" -#include "DNA_controller_types.h" + +#include "WM_types.h" EnumPropertyItem controller_type_items[] = { {CONT_LOGIC_AND, "LOGIC_AND", 0, "And", "Logic And"}, diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index b7ef76eeaf3..dba33bb9ab5 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -26,11 +26,6 @@ #include -#include "RNA_access.h" -#include "RNA_define.h" - -#include "rna_internal.h" - #include "DNA_curve_types.h" #include "DNA_key_types.h" #include "DNA_material_types.h" @@ -40,6 +35,11 @@ #include "BKE_font.h" +#include "RNA_access.h" +#include "RNA_define.h" + +#include "rna_internal.h" + #include "WM_types.h" #include "BKE_curve.h" diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c index a505ae0dec2..8d30a0be0f1 100644 --- a/source/blender/makesrna/intern/rna_dynamicpaint.c +++ b/source/blender/makesrna/intern/rna_dynamicpaint.c @@ -24,14 +24,9 @@ * \ingroup RNA */ - #include #include -#include "RNA_define.h" - -#include "rna_internal.h" - #include "BLI_math_base.h" #include "BKE_modifier.h" @@ -43,6 +38,10 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "RNA_define.h" + +#include "rna_internal.h" + #include "WM_types.h" EnumPropertyItem prop_dynamicpaint_type_items[] = { diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index a91832268e2..f6f8b14d0e2 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -24,15 +24,8 @@ * \ingroup RNA */ - #include -#include "RNA_access.h" -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - #include "DNA_anim_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" @@ -43,6 +36,12 @@ #include "BKE_action.h" +#include "RNA_access.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + #include "WM_types.h" #include "ED_keyframing.h" diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 9461a816652..af539372720 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -24,19 +24,20 @@ * \ingroup RNA */ - #include -#include "RNA_access.h" -#include "RNA_define.h" - -#include "rna_internal.h" - #include "DNA_gpencil_types.h" #include "DNA_scene_types.h" #include "MEM_guardedalloc.h" +#include "BLI_utildefines.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "rna_internal.h" + #include "WM_types.h" #ifdef RNA_RUNTIME diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c index 4baf46fd0b5..1ac59f9caed 100644 --- a/source/blender/makesrna/intern/rna_group.c +++ b/source/blender/makesrna/intern/rna_group.c @@ -24,15 +24,16 @@ * \ingroup RNA */ - #include +#include "DNA_group_types.h" + +#include "BLI_utildefines.h" + #include "RNA_define.h" #include "rna_internal.h" -#include "DNA_group_types.h" - #ifdef RNA_RUNTIME #include "DNA_scene_types.h" diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index ee4ea369425..81136193883 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -24,21 +24,22 @@ * \ingroup RNA */ - #include -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - #include "DNA_image_types.h" #include "DNA_scene_types.h" +#include "BLI_utildefines.h" + #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_image.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + #include "WM_types.h" #include "WM_api.h" diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 5d45e0d23b6..c1769f02974 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -34,13 +34,15 @@ #include #include -#include "RNA_define.h" -#include "RNA_enum_types.h" - #include "DNA_packedFile_types.h" +#include "BLI_utildefines.h" + #include "BIF_gl.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + #include "rna_internal.h" /* own include */ #ifdef RNA_RUNTIME diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 9161f7932e6..a38797d4831 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -24,12 +24,13 @@ * \ingroup RNA */ - #ifndef __RNA_INTERNAL_H__ #define __RNA_INTERNAL_H__ #include "UI_resources.h" +#include "BLI_utildefines.h" + #include "rna_internal_types.h" #define RNA_MAGIC ((int)~0) @@ -208,9 +209,9 @@ void rna_ID_name_get(struct PointerRNA *ptr, char *value); int rna_ID_name_length(struct PointerRNA *ptr); void rna_ID_name_set(struct PointerRNA *ptr, const char *value); struct StructRNA *rna_ID_refine(struct PointerRNA *ptr); -struct IDProperty *rna_ID_idprops(struct PointerRNA *ptr, int create); +struct IDProperty *rna_ID_idprops(struct PointerRNA *ptr, bool create); void rna_ID_fake_user_set(struct PointerRNA *ptr, int value); -struct IDProperty *rna_PropertyGroup_idprops(struct PointerRNA *ptr, int create); +struct IDProperty *rna_PropertyGroup_idprops(struct PointerRNA *ptr, bool create); void rna_PropertyGroup_unregister(struct Main *bmain, struct StructRNA *type); struct StructRNA *rna_PropertyGroup_register(struct Main *bmain, struct ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, @@ -416,6 +417,4 @@ int rna_IDMaterials_assign_int(struct PointerRNA *ptr, int key, const struct Poi void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values); void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values); -#endif /* __RNA_INTERNAL_H__ */ - - +#endif /* __RNA_INTERNAL_H__ */ diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 43ec09de010..1dce89c343d 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -66,7 +66,7 @@ typedef void (*ContextPropUpdateFunc)(struct bContext *C, struct PointerRNA *ptr typedef void (*ContextUpdateFunc)(struct bContext *C, struct PointerRNA *ptr); typedef int (*EditableFunc)(struct PointerRNA *ptr); typedef int (*ItemEditableFunc)(struct PointerRNA *ptr, int index); -typedef struct IDProperty *(*IDPropertiesFunc)(struct PointerRNA *ptr, int create); +typedef struct IDProperty *(*IDPropertiesFunc)(struct PointerRNA *ptr, bool create); typedef struct StructRNA *(*StructRefineFunc)(struct PointerRNA *ptr); typedef char *(*StructPathFunc)(struct PointerRNA *ptr); diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 33bbaeec282..1577019f22a 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -24,14 +24,8 @@ * \ingroup RNA */ - #include -#include "RNA_access.h" -#include "RNA_define.h" - -#include "rna_internal.h" - #include "DNA_ID.h" #include "DNA_scene_types.h" #include "DNA_curve_types.h" @@ -39,6 +33,13 @@ #include "DNA_lattice_types.h" #include "DNA_mesh_types.h" +#include "BLI_utildefines.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "rna_internal.h" + #ifdef RNA_RUNTIME #include diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 660f6fc6ab7..7b55671e4ed 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -24,20 +24,18 @@ * \ingroup RNA */ - #include +#include "BLI_math_base.h" + #include "RNA_define.h" #include "RNA_enum_types.h" - #include "rna_internal.h" #include "DNA_lamp_types.h" #include "DNA_material_types.h" #include "DNA_texture_types.h" -#include "BLI_math_base.h" - #ifdef RNA_RUNTIME #include "MEM_guardedalloc.h" diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index e4a29d9c674..b2790a25e47 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -24,19 +24,19 @@ * \ingroup RNA */ - #include -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - #include "DNA_curve_types.h" #include "DNA_key_types.h" #include "DNA_lattice_types.h" #include "DNA_meshdata_types.h" +#include "BLI_utildefines.h" + +#include "RNA_define.h" +#include "RNA_enum_types.h" +#include "rna_internal.h" + #ifdef RNA_RUNTIME #include "DNA_object_types.h" diff --git a/source/blender/makesrna/intern/rna_mask.c b/source/blender/makesrna/intern/rna_mask.c index 3f23a376ea3..72b0030ee23 100644 --- a/source/blender/makesrna/intern/rna_mask.c +++ b/source/blender/makesrna/intern/rna_mask.c @@ -31,6 +31,10 @@ #include "MEM_guardedalloc.h" +#include "DNA_mask_types.h" +#include "DNA_object_types.h" /* SELECT */ +#include "DNA_scene_types.h" + #include "BKE_movieclip.h" #include "BKE_tracking.h" @@ -39,10 +43,6 @@ #include "rna_internal.h" -#include "DNA_mask_types.h" -#include "DNA_object_types.h" /* SELECT */ -#include "DNA_scene_types.h" - #include "WM_types.h" #include "IMB_imbuf_types.h" diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 35173c290de..d1c81200e6a 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -24,17 +24,16 @@ * \ingroup RNA */ - #include #include +#include "DNA_material_types.h" +#include "DNA_texture_types.h" + #include "RNA_define.h" #include "rna_internal.h" -#include "DNA_material_types.h" -#include "DNA_texture_types.h" - #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 4b4006f0012..22794096812 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -28,28 +28,27 @@ * \ingroup RNA */ - #include #include "MEM_guardedalloc.h" -#include "RNA_access.h" -#include "RNA_define.h" -#include "RNA_types.h" - -#include "rna_internal.h" - #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" -#include "WM_types.h" - #include "BLI_array.h" #include "BLI_math_base.h" #include "BLI_math_rotation.h" +#include "RNA_access.h" +#include "RNA_define.h" +#include "RNA_types.h" + +#include "rna_internal.h" + +#include "WM_types.h" + #ifdef RNA_RUNTIME #include "DNA_scene_types.h" diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index 4813f25dea7..f38151fd721 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -24,18 +24,19 @@ * \ingroup RNA */ - #include +#include "DNA_mesh_types.h" +#include "DNA_meta_types.h" + +#include "BLI_utildefines.h" + #include "RNA_access.h" #include "RNA_define.h" #include "RNA_enum_types.h" #include "rna_internal.h" -#include "DNA_mesh_types.h" -#include "DNA_meta_types.h" - #ifdef RNA_RUNTIME #include "BLI_math.h" diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 81faa82aa4a..19333b3dbc8 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -29,11 +29,6 @@ #include #include -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - #include "DNA_armature_types.h" #include "DNA_mesh_types.h" #include "DNA_modifier_types.h" @@ -53,6 +48,11 @@ #include "BKE_multires.h" #include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */ +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c index 3b018591455..cc3d5e5ca5e 100644 --- a/source/blender/makesrna/intern/rna_movieclip.c +++ b/source/blender/makesrna/intern/rna_movieclip.c @@ -25,7 +25,6 @@ * \ingroup RNA */ - #include #include @@ -34,13 +33,13 @@ #include "BKE_movieclip.h" #include "BKE_tracking.h" +#include "DNA_movieclip_types.h" +#include "DNA_scene_types.h" + #include "RNA_define.h" #include "rna_internal.h" -#include "DNA_movieclip_types.h" -#include "DNA_scene_types.h" - #include "WM_types.h" #include "IMB_imbuf_types.h" diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 2b7f6a182a0..9afaad96019 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -24,20 +24,21 @@ * \ingroup RNA */ - #include -#include "RNA_access.h" -#include "RNA_define.h" - -#include "rna_internal.h" - #include "DNA_anim_types.h" #include "DNA_action_types.h" #include "DNA_scene_types.h" +#include "BLI_utildefines.h" + #include "MEM_guardedalloc.h" +#include "RNA_access.h" +#include "RNA_define.h" + +#include "rna_internal.h" + #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 73fe5f3a48d..c13481bcb9a 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -27,13 +27,6 @@ #include #include -#include "RNA_access.h" -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" -#include "rna_internal_types.h" - #include "BLI_listbase.h" #include "BLI_math.h" #include "BLI_string.h" @@ -54,6 +47,13 @@ #include "BKE_texture.h" #include "BKE_idprop.h" +#include "RNA_access.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" +#include "rna_internal_types.h" + #include "IMB_imbuf.h" #include "WM_types.h" @@ -1193,7 +1193,7 @@ static void rna_ShaderNodeScript_bytecode_set(PointerRNA *ptr, const char *value nss->bytecode = NULL; } -static IDProperty *rna_ShaderNodeScript_idprops(PointerRNA *ptr, int create) +static IDProperty *rna_ShaderNodeScript_idprops(PointerRNA *ptr, bool create) { bNode *node = (bNode *)ptr->data; NodeShaderScript *nss = node->storage; diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 2c736df1ed2..531794f7ab4 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -24,16 +24,9 @@ * \ingroup RNA */ - #include #include -#include "RNA_access.h" -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - #include "DNA_action_types.h" #include "DNA_customdata_types.h" #include "DNA_controller_types.h" @@ -52,6 +45,12 @@ #include "BKE_tessmesh.h" #include "BKE_group.h" /* needed for object_in_group() */ +#include "RNA_access.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + #include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */ #include "ED_mesh.h" diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index ec974df54d5..5ebc3f25c22 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -24,13 +24,8 @@ * \ingroup RNA */ - #include -#include "RNA_define.h" - -#include "rna_internal.h" - #include "DNA_cloth_types.h" #include "DNA_object_types.h" #include "DNA_object_force.h" @@ -38,6 +33,10 @@ #include "DNA_scene_types.h" #include "DNA_smoke_types.h" +#include "RNA_define.h" + +#include "rna_internal.h" + #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/makesrna/intern/rna_packedfile.c b/source/blender/makesrna/intern/rna_packedfile.c index e691ca46c69..a72188591a1 100644 --- a/source/blender/makesrna/intern/rna_packedfile.c +++ b/source/blender/makesrna/intern/rna_packedfile.c @@ -24,15 +24,16 @@ * \ingroup RNA */ - #include +#include "BLI_utildefines.h" + +#include "DNA_packedFile_types.h" + #include "RNA_define.h" #include "rna_internal.h" -#include "DNA_packedFile_types.h" - EnumPropertyItem unpack_method_items[] = { {PF_USE_LOCAL, "USE_LOCAL", 0, "Use Local File", ""}, {PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write Local File (overwrite existing)", ""}, diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 4bf5de03b05..c675aa6ebc3 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -27,16 +27,10 @@ * \ingroup RNA */ - #include #include #include -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - #include "DNA_material_types.h" #include "DNA_meshdata_types.h" #include "DNA_modifier_types.h" @@ -48,6 +42,11 @@ #include "DNA_boid_types.h" #include "DNA_texture_types.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + #include "WM_types.h" #include "WM_api.h" diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 1ed675962f3..8c38b0458b7 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -159,7 +159,7 @@ static void rna_BoneGroup_name_set(PointerRNA *ptr, const char *value) BLI_uniquename(&ob->pose->agroups, agrp, "Group", '.', offsetof(bActionGroup, name), sizeof(agrp->name)); } -static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, int create) +static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, bool create) { bPoseChannel *pchan = ptr->data; diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 9bd20d854e7..2e96d405077 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -24,11 +24,12 @@ * \ingroup RNA */ - #include #include "DNA_ID.h" +#include "BLI_utildefines.h" + #include "RNA_access.h" #include "RNA_define.h" #include "RNA_enum_types.h" diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index e635280b07a..4ce57e560e5 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -26,11 +26,6 @@ #include -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - #include "DNA_brush_types.h" #include "DNA_group_types.h" #include "DNA_modifier_types.h" @@ -46,6 +41,11 @@ #include "BKE_tessmesh.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + /* Include for Bake Options */ #include "RE_engine.h" #include "RE_pipeline.h" diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index 6097fa2ae96..547d0ff78c9 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -24,19 +24,20 @@ * \ingroup RNA */ - #include +#include "DNA_constraint_types.h" +#include "DNA_object_types.h" +#include "DNA_sensor_types.h" + +#include "BLI_utildefines.h" + #include "RNA_define.h" #include "RNA_enum_types.h" #include "RNA_access.h" #include "rna_internal.h" -#include "DNA_constraint_types.h" -#include "DNA_object_types.h" -#include "DNA_sensor_types.h" - #include "WM_types.h" /* Always keep in alphabetical order */ diff --git a/source/blender/makesrna/intern/rna_sensor_api.c b/source/blender/makesrna/intern/rna_sensor_api.c index d920cbef4a2..476f0589bc9 100644 --- a/source/blender/makesrna/intern/rna_sensor_api.c +++ b/source/blender/makesrna/intern/rna_sensor_api.c @@ -28,15 +28,17 @@ * \ingroup RNA */ - #include #include -#include "WM_types.h" +#include "BLI_utildefines.h" + #include "RNA_define.h" #include "rna_internal.h" /* own include */ +#include "WM_types.h" + #ifdef RNA_RUNTIME #include "BKE_sca.h" diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index a2704619ee6..9b81f042358 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -24,16 +24,9 @@ * \ingroup RNA */ - #include #include -#include "RNA_access.h" -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - #include "DNA_anim_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" @@ -49,6 +42,12 @@ #include "MEM_guardedalloc.h" +#include "RNA_access.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + #include "WM_types.h" #include "BLF_translation.h" diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index 386263c784e..0c58d5cab6b 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -28,17 +28,17 @@ #include #include +#include "DNA_scene_types.h" +#include "DNA_sequence_types.h" + +#include "BLI_utildefines.h" + #include "RNA_define.h" #include "RNA_access.h" #include "RNA_define.h" #include "rna_internal.h" -#include "DNA_scene_types.h" -#include "DNA_sequence_types.h" - -#include "BLI_utildefines.h" - #ifdef RNA_RUNTIME //#include "DNA_anim_types.h" diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 1f2cf469c5e..10470e2e97b 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -24,16 +24,10 @@ * \ingroup RNA */ - #include #include "MEM_guardedalloc.h" -#include "RNA_access.h" -#include "RNA_define.h" - -#include "rna_internal.h" - #include "BLF_translation.h" #include "BKE_key.h" @@ -49,6 +43,11 @@ #include "DNA_mask_types.h" #include "DNA_view3d_types.h" +#include "RNA_access.h" +#include "RNA_define.h" + +#include "rna_internal.h" + #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/makesrna/intern/rna_text_api.c b/source/blender/makesrna/intern/rna_text_api.c index 5f67f367195..de398bc10a6 100644 --- a/source/blender/makesrna/intern/rna_text_api.c +++ b/source/blender/makesrna/intern/rna_text_api.c @@ -24,10 +24,11 @@ * \ingroup RNA */ - #include #include +#include "BLI_utildefines.h" + #include "RNA_define.h" #include "rna_internal.h" /* own include */ diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 2d1b75afe5b..d86e5fd0d9c 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -24,16 +24,10 @@ * \ingroup RNA */ - #include #include #include -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - #include "DNA_brush_types.h" #include "DNA_lamp_types.h" #include "DNA_material_types.h" @@ -48,6 +42,11 @@ #include "BKE_node.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/makesrna/intern/rna_timeline.c b/source/blender/makesrna/intern/rna_timeline.c index 3842fe95894..a732b550261 100644 --- a/source/blender/makesrna/intern/rna_timeline.c +++ b/source/blender/makesrna/intern/rna_timeline.c @@ -24,15 +24,14 @@ * \ingroup RNA */ - #include +#include "DNA_scene_types.h" + #include "RNA_define.h" #include "rna_internal.h" -#include "DNA_scene_types.h" - #include "WM_types.h" #ifdef RNA_RUNTIME diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 123a47eab60..f113d1a2b61 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -26,12 +26,6 @@ #include -#include "RNA_access.h" -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "rna_internal.h" - #include "DNA_curve_types.h" #include "DNA_space_types.h" #include "DNA_userdef_types.h" @@ -39,16 +33,22 @@ #include "DNA_view3d_types.h" #include "DNA_scene_types.h" -#include "WM_api.h" -#include "WM_types.h" - #include "BLI_utildefines.h" -#include "BLF_translation.h" - #include "BKE_sound.h" #include "BKE_addon.h" +#include "RNA_access.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "BLF_translation.h" + #ifdef WITH_CYCLES static EnumPropertyItem compute_device_type_items[] = { {USER_COMPUTE_DEVICE_NONE, "NONE", 0, "None", "Don't use compute device"}, @@ -443,7 +443,7 @@ static EnumPropertyItem *rna_lang_enum_properties_itemf(bContext *UNUSED(C), Poi } #endif -static IDProperty *rna_AddonPref_idprops(PointerRNA *ptr, int create) +static IDProperty *rna_AddonPref_idprops(PointerRNA *ptr, bool create) { if (create && !ptr->data) { IDPropertyTemplate val = {0}; diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 0c1c5d8f64a..85059755b1b 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -24,20 +24,21 @@ * \ingroup RNA */ - #include +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_userdef_types.h" +#include "DNA_windowmanager_types.h" + +#include "BLI_utildefines.h" + #include "RNA_access.h" #include "RNA_define.h" #include "RNA_enum_types.h" #include "rna_internal.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_windowmanager_types.h" - #include "WM_types.h" EnumPropertyItem event_keymouse_value_items[] = { @@ -466,7 +467,7 @@ static StructRNA *rna_OperatorProperties_refine(PointerRNA *ptr) return ptr->type; } -static IDProperty *rna_OperatorProperties_idprops(PointerRNA *ptr, int create) +static IDProperty *rna_OperatorProperties_idprops(PointerRNA *ptr, bool create) { if (create && !ptr->data) { IDPropertyTemplate val = {0}; -- cgit v1.2.3