diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-02-20 11:54:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-02-20 11:54:51 +0300 |
commit | 185e301229691e1105a0147a8c5a697bb2461ed0 (patch) | |
tree | 2b147df463669d1a8a85faa12ba2581160eb2d2f /source/blender | |
parent | d0978103aefab710c9d433a5a0a32b40b5e287eb (diff) |
RNA: correct bool callbacks
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_particle.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_lamp.c | 10 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_main_api.c | 54 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_pose.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 36 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 9 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 18 |
13 files changed, 76 insertions, 76 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 30ce656f46d..44ac3b7bb38 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -468,7 +468,7 @@ struct bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node); struct bNodeLink *nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock); void nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link); void nodeRemSocketLinks(struct bNodeTree *ntree, struct bNodeSocket *sock); -int nodeLinkIsHidden(struct bNodeLink *link); +bool nodeLinkIsHidden(struct bNodeLink *link); void nodeInternalRelink(struct bNodeTree *ntree, struct bNode *node); void nodeToView(struct bNode *node, float x, float y, float *rx, float *ry); diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index a5f12bb9a3c..0f1389bfeec 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -293,9 +293,9 @@ void psys_set_current_num(Object *ob, int index); struct LatticeDeformData *psys_create_lattice_deform_data(struct ParticleSimulationData *sim); -int psys_in_edit_mode(struct Scene *scene, struct ParticleSystem *psys); -int psys_check_enabled(struct Object *ob, struct ParticleSystem *psys); -int psys_check_edited(struct ParticleSystem *psys); +bool psys_in_edit_mode(struct Scene *scene, struct ParticleSystem *psys); +bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys); +bool psys_check_edited(struct ParticleSystem *psys); void psys_check_group_weights(struct ParticleSettings *part); int psys_uses_gravity(struct ParticleSimulationData *sim); diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index f30e3b699dd..c7010e42aac 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -955,7 +955,7 @@ void nodeRemSocketLinks(bNodeTree *ntree, bNodeSocket *sock) ntree->update |= NTREE_UPDATE_LINKS; } -int nodeLinkIsHidden(bNodeLink *link) +bool nodeLinkIsHidden(bNodeLink *link) { return nodeSocketIsHidden(link->fromsock) || nodeSocketIsHidden(link->tosock); } diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 2de5f460da2..291efd03a66 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -272,11 +272,11 @@ void psys_enable_all(Object *ob) for (; psys; psys = psys->next) psys->flag &= ~PSYS_DISABLED; } -int psys_in_edit_mode(Scene *scene, ParticleSystem *psys) +bool psys_in_edit_mode(Scene *scene, ParticleSystem *psys) { return (scene->basact && (scene->basact->object->mode & OB_MODE_PARTICLE_EDIT) && psys == psys_get_current((scene->basact)->object) && (psys->edit || psys->pointcache->edit) && !psys->renderdata); } -int psys_check_enabled(Object *ob, ParticleSystem *psys) +bool psys_check_enabled(Object *ob, ParticleSystem *psys) { ParticleSystemModifierData *psmd; @@ -294,7 +294,7 @@ int psys_check_enabled(Object *ob, ParticleSystem *psys) return 1; } -int psys_check_edited(ParticleSystem *psys) +bool psys_check_edited(ParticleSystem *psys) { if (psys->part && psys->part->type == PART_HAIR) return (psys->flag & PSYS_EDITED || (psys->edit && psys->edit->edited)); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 6db1b46ff21..6a0ae0a60f8 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1550,6 +1550,7 @@ void RNA_def_property_boolean_default(PropertyRNA *prop, int value) case PROP_BOOLEAN: { BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; + BLI_assert(ELEM(value, false, true)); bprop->defaultvalue = value; break; } diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index e9861b90956..81c26af189d 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -93,10 +93,12 @@ static int rna_use_shadow_get(PointerRNA *ptr) { Lamp *la = (Lamp *)ptr->data; - if (la->type == LA_SPOT) - return la->mode & LA_SHAD_BUF; - else - return la->mode & LA_SHAD_RAY; + if (la->type == LA_SPOT) { + return (la->mode & LA_SHAD_BUF) != 0; + } + else { + return (la->mode & LA_SHAD_RAY) != 0; + } } static void rna_use_shadow_set(PointerRNA *ptr, int value) diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index b4c332be373..8aa447f523e 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -734,33 +734,33 @@ static void rna_Main_movieclips_tag(Main *bmain, int value) { BKE_main_id_tag_li static void rna_Main_masks_tag(Main *bmain, int value) { BKE_main_id_tag_listbase(&bmain->mask, value); } static void rna_Main_linestyle_tag(Main *bmain, int value) { BKE_main_id_tag_listbase(&bmain->linestyle, value); } -static int rna_Main_cameras_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_CA); } -static int rna_Main_scenes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SCE); } -static int rna_Main_objects_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_OB); } -static int rna_Main_materials_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_MA); } -static int rna_Main_node_groups_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_NT); } -static int rna_Main_meshes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_ME); } -static int rna_Main_lamps_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LA); } -static int rna_Main_libraries_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LI); } -static int rna_Main_screens_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SCR); } -static int rna_Main_window_managers_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_WM); } -static int rna_Main_images_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_IM); } -static int rna_Main_lattices_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LT); } -static int rna_Main_curves_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_CU); } -static int rna_Main_metaballs_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_MB); } -static int rna_Main_fonts_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_VF); } -static int rna_Main_textures_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_TE); } -static int rna_Main_brushes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_BR); } -static int rna_Main_worlds_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_WO); } -static int rna_Main_groups_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_GR); } -static int rna_Main_texts_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_TXT); } -static int rna_Main_speakers_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SPK); } -static int rna_Main_sounds_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SO); } -static int rna_Main_armatures_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_AR); } -static int rna_Main_actions_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_AC); } -static int rna_Main_particles_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_PA); } -static int rna_Main_gpencil_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_GD); } -static int rna_Main_linestyle_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LS); } +static int rna_Main_cameras_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_CA) != 0; } +static int rna_Main_scenes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SCE) != 0; } +static int rna_Main_objects_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_OB) != 0; } +static int rna_Main_materials_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_MA) != 0; } +static int rna_Main_node_groups_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_NT) != 0; } +static int rna_Main_meshes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_ME) != 0; } +static int rna_Main_lamps_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LA) != 0; } +static int rna_Main_libraries_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LI) != 0; } +static int rna_Main_screens_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SCR) != 0; } +static int rna_Main_window_managers_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_WM) != 0; } +static int rna_Main_images_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_IM) != 0; } +static int rna_Main_lattices_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LT) != 0; } +static int rna_Main_curves_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_CU) != 0; } +static int rna_Main_metaballs_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_MB) != 0; } +static int rna_Main_fonts_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_VF) != 0; } +static int rna_Main_textures_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_TE) != 0; } +static int rna_Main_brushes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_BR) != 0; } +static int rna_Main_worlds_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_WO) != 0; } +static int rna_Main_groups_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_GR) != 0; } +static int rna_Main_texts_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_TXT) != 0; } +static int rna_Main_speakers_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SPK) != 0; } +static int rna_Main_sounds_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SO) != 0; } +static int rna_Main_armatures_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_AR) != 0; } +static int rna_Main_actions_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_AC) != 0; } +static int rna_Main_particles_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_PA) != 0; } +static int rna_Main_gpencil_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_GD) != 0; } +static int rna_Main_linestyle_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_LS) != 0; } #else diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 5fd764b755d..d2abbb340f4 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -712,7 +712,7 @@ static void rna_MeshVertex_undeformed_co_get(PointerRNA *ptr, float values[3]) copy_v3_v3(values, mvert->co); } -static int rna_CustomDataLayer_active_get(PointerRNA *ptr, CustomData *data, int type, int render) +static int rna_CustomDataLayer_active_get(PointerRNA *ptr, CustomData *data, int type, bool render) { int n = ((CustomDataLayer *)ptr->data) - data->layers; diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index db3b39116b4..51c011e474e 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1185,7 +1185,7 @@ static void rna_GameObjectSettings_col_group_get(PointerRNA *ptr, int *values) int i; for (i = 0; i < OB_MAX_COL_MASKS; i++) { - values[i] = (ob->col_group & (1 << i)); + values[i] = (ob->col_group & (1 << i)) != 0; } } @@ -1214,7 +1214,7 @@ static void rna_GameObjectSettings_col_mask_get(PointerRNA *ptr, int *values) int i; for (i = 0; i < OB_MAX_COL_MASKS; i++) { - values[i] = (ob->col_mask & (1 << i)); + values[i] = (ob->col_mask & (1 << i)) != 0; } } diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 07dac63f3fe..0428f5d8a9f 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -183,7 +183,7 @@ int rna_ActionGroup_is_custom_colorset_get(PointerRNA *ptr) { bActionGroup *grp = ptr->data; - return (bool)(grp->customCol < 0); + return (grp->customCol < 0); } static void rna_BoneGroup_name_set(PointerRNA *ptr, const char *value) diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index b2c135cd1f9..3a5c2fe2847 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -545,7 +545,7 @@ static int rna_Property_readonly_get(PointerRNA *ptr) * data for introspection we only need to know if it can be edited so the * flag is better for this */ /* return RNA_property_editable(ptr, prop); */ - return prop->flag & PROP_EDITABLE ? 0 : 1; + return (prop->flag & PROP_EDITABLE) == 0; } static int rna_Property_animatable_get(PointerRNA *ptr) @@ -558,50 +558,50 @@ static int rna_Property_animatable_get(PointerRNA *ptr) static int rna_Property_use_output_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return prop->flag & PROP_OUTPUT ? 1 : 0; + return (prop->flag & PROP_OUTPUT) != 0; } static int rna_Property_is_required_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return prop->flag & PROP_REQUIRED ? 1 : 0; + return (prop->flag & PROP_REQUIRED) != 0; } static int rna_Property_is_argument_optional_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return prop->flag & PROP_PYFUNC_OPTIONAL ? 1 : 0; + return (prop->flag & PROP_PYFUNC_OPTIONAL) != 0; } static int rna_Property_is_never_none_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return prop->flag & PROP_NEVER_NULL ? 1 : 0; + return (prop->flag & PROP_NEVER_NULL) != 0; } static int rna_Property_is_hidden_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return prop->flag & PROP_HIDDEN ? 1 : 0; + return (prop->flag & PROP_HIDDEN) != 0; } static int rna_Property_is_skip_save_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return prop->flag & PROP_SKIP_SAVE ? 1 : 0; + return (prop->flag & PROP_SKIP_SAVE) != 0; } static int rna_Property_is_enum_flag_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return prop->flag & PROP_ENUM_FLAG ? 1 : 0; + return (prop->flag & PROP_ENUM_FLAG) != 0; } static int rna_Property_is_library_editable_flag_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return prop->flag & PROP_LIB_EXCEPTION ? 1 : 0; + return (prop->flag & PROP_LIB_EXCEPTION) != 0; } static int rna_Property_array_length_get(PointerRNA *ptr) @@ -611,22 +611,22 @@ static int rna_Property_array_length_get(PointerRNA *ptr) return prop->totarraylength; } -static int rna_Property_registered_get(PointerRNA *ptr) +static int rna_Property_is_registered_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return prop->flag & PROP_REGISTER; + return (prop->flag & PROP_REGISTER) != 0; } -static int rna_Property_registered_optional_get(PointerRNA *ptr) +static int rna_Property_is_registered_optional_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return prop->flag & PROP_REGISTER_OPTIONAL; + return (prop->flag & PROP_REGISTER_OPTIONAL) != 0; } -static int rna_Property_runtime_get(PointerRNA *ptr) +static int rna_Property_is_runtime_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return prop->flag & PROP_RUNTIME; + return (prop->flag & PROP_RUNTIME) != 0; } @@ -1210,18 +1210,18 @@ static void rna_def_property(BlenderRNA *brna) prop = RNA_def_property(srna, "is_registered", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_boolean_funcs(prop, "rna_Property_registered_get", NULL); + RNA_def_property_boolean_funcs(prop, "rna_Property_is_registered_get", NULL); RNA_def_property_ui_text(prop, "Registered", "Property is registered as part of type registration"); prop = RNA_def_property(srna, "is_registered_optional", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_boolean_funcs(prop, "rna_Property_registered_optional_get", NULL); + RNA_def_property_boolean_funcs(prop, "rna_Property_is_registered_optional_get", NULL); RNA_def_property_ui_text(prop, "Registered Optionally", "Property is optionally registered as part of type registration"); prop = RNA_def_property(srna, "is_runtime", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_boolean_funcs(prop, "rna_Property_runtime_get", NULL); + RNA_def_property_boolean_funcs(prop, "rna_Property_is_runtime_get", NULL); RNA_def_property_ui_text(prop, "Runtime", "Property has been dynamically created at runtime"); prop = RNA_def_property(srna, "is_enum_flag", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 205cd0c1ed6..600fa755303 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1245,7 +1245,7 @@ static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr) for (type = R_engines.first; type; type = type->next) if (STREQ(type->idname, rd->engine)) - return (type->flag & RE_GAME); + return (type->flag & RE_GAME) != 0; return 0; } @@ -1376,7 +1376,7 @@ static void rna_Scene_use_persistent_data_update(Main *UNUSED(bmain), Scene *UNU static int rna_Scene_use_audio_get(PointerRNA *ptr) { Scene *scene = (Scene *)ptr->data; - return scene->audio.flag & AUDIO_MUTE; + return (scene->audio.flag & AUDIO_MUTE) != 0; } static void rna_Scene_use_audio_set(PointerRNA *ptr, int value) @@ -1418,10 +1418,7 @@ static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value) static int rna_GameSettings_auto_start_get(PointerRNA *UNUSED(ptr)) { - if (G.fileflags & G_FILE_AUTOPLAY) - return 1; - - return 0; + return (G.fileflags & G_FILE_AUTOPLAY) != 0; } static void rna_GameSettings_auto_start_set(PointerRNA *UNUSED(ptr), int value) diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 347b669812e..6119bc968e6 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -526,21 +526,21 @@ static PointerRNA rna_OperatorMacro_properties_get(PointerRNA *ptr) static void rna_Event_ascii_get(PointerRNA *ptr, char *value) { - wmEvent *event = (wmEvent *)ptr->data; + const wmEvent *event = ptr->data; value[0] = event->ascii; value[1] = '\0'; } static int rna_Event_ascii_length(PointerRNA *ptr) { - wmEvent *event = (wmEvent *)ptr->data; + const wmEvent *event = ptr->data; return (event->ascii) ? 1 : 0; } static void rna_Event_unicode_get(PointerRNA *ptr, char *value) { /* utf8 buf isn't \0 terminated */ - wmEvent *event = (wmEvent *)ptr->data; + const wmEvent *event = ptr->data; size_t len = 0; if (event->utf8_buf[0]) { @@ -556,7 +556,7 @@ static void rna_Event_unicode_get(PointerRNA *ptr, char *value) static int rna_Event_unicode_length(PointerRNA *ptr) { - wmEvent *event = (wmEvent *)ptr->data; + const wmEvent *event = ptr->data; if (event->utf8_buf[0]) { /* invalid value is checked on assignment so we don't need to account for this */ return BLI_str_utf8_size(event->utf8_buf); @@ -568,13 +568,13 @@ static int rna_Event_unicode_length(PointerRNA *ptr) static float rna_Event_pressure_get(PointerRNA *ptr) { - wmEvent *event = ptr->data; + const wmEvent *event = ptr->data; return WM_event_tablet_data(event, NULL, NULL); } static int rna_Event_is_tablet_get(PointerRNA *ptr) { - wmEvent *event = ptr->data; + const wmEvent *event = ptr->data; return WM_event_is_tablet(event); } @@ -762,7 +762,7 @@ static EnumPropertyItem *rna_KeyMapItem_propvalue_itemf(bContext *C, PointerRNA return keymap_propvalue_items; /* ERROR */ } -static int rna_KeyMapItem_any_getf(PointerRNA *ptr) +static int rna_KeyMapItem_any_get(PointerRNA *ptr) { wmKeyMapItem *kmi = (wmKeyMapItem *)ptr->data; @@ -778,7 +778,7 @@ static int rna_KeyMapItem_any_getf(PointerRNA *ptr) } } -static void rna_KeyMapItem_any_setf(PointerRNA *ptr, int value) +static void rna_KeyMapItem_any_set(PointerRNA *ptr, int value) { wmKeyMapItem *kmi = (wmKeyMapItem *)ptr->data; @@ -2028,7 +2028,7 @@ static void rna_def_keyconfig(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_KeyMapItem_update"); prop = RNA_def_property(srna, "any", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_KeyMapItem_any_getf", "rna_KeyMapItem_any_setf"); + RNA_def_property_boolean_funcs(prop, "rna_KeyMapItem_any_get", "rna_KeyMapItem_any_set"); RNA_def_property_ui_text(prop, "Any", "Any modifier keys pressed"); RNA_def_property_update(prop, 0, "rna_KeyMapItem_update"); |