From 0114d78c33edfaef5bc412eefcb5d52a0a6823b0 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 5 Mar 2012 23:30:41 +0000 Subject: Code cleanup in rna files (huge, higly automated with py script). Addresses: * C++ comments. * Spaces after if/for/while/switch statements. * Spaces around assignment operators. --- source/blender/makesrna/intern/rna_property.c | 52 +++++++++++++-------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'source/blender/makesrna/intern/rna_property.c') diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c index dfdc175d18b..fd6c45c2828 100644 --- a/source/blender/makesrna/intern/rna_property.c +++ b/source/blender/makesrna/intern/rna_property.c @@ -35,7 +35,7 @@ #include "WM_types.h" -EnumPropertyItem gameproperty_type_items[] ={ +EnumPropertyItem gameproperty_type_items[] = { {GPROP_BOOL, "BOOL", 0, "Boolean", "Boolean Property"}, {GPROP_INT, "INT", 0, "Integer", "Integer Property"}, {GPROP_FLOAT, "FLOAT", 0, "Float", "Floating-Point Property"}, @@ -50,9 +50,9 @@ EnumPropertyItem gameproperty_type_items[] ={ static StructRNA* rna_GameProperty_refine(struct PointerRNA *ptr) { - bProperty *property= (bProperty*)ptr->data; + bProperty *property = (bProperty*)ptr->data; - switch(property->type){ + switch (property->type){ case GPROP_BOOL: return &RNA_GameBooleanProperty; case GPROP_INT: @@ -71,30 +71,30 @@ static StructRNA* rna_GameProperty_refine(struct PointerRNA *ptr) /* for both float and timer */ static float rna_GameFloatProperty_value_get(PointerRNA *ptr) { - bProperty *prop= (bProperty*)(ptr->data); + bProperty *prop = (bProperty*)(ptr->data); return *(float*)(&prop->data); } static void rna_GameFloatProperty_value_set(PointerRNA *ptr, float value) { - bProperty *prop= (bProperty*)(ptr->data); + bProperty *prop = (bProperty*)(ptr->data); CLAMP(value, -10000.0f, 10000.0f); - *(float*)(&prop->data)= value; + *(float*)(&prop->data) = value; } static void rna_GameProperty_type_set(PointerRNA *ptr, int value) { - bProperty *prop= (bProperty*)(ptr->data); + bProperty *prop = (bProperty*)(ptr->data); - if(prop->type != value) { - prop->type= value; + if (prop->type != value) { + prop->type = value; init_property(prop); } } static void rna_GameProperty_name_set(PointerRNA *ptr, const char *value) { - bProperty *prop= (bProperty*)(ptr->data); + bProperty *prop = (bProperty*)(ptr->data); BLI_strncpy_utf8(prop->name, value, sizeof(prop->name)); unique_property(NULL, prop, 1); } @@ -108,80 +108,80 @@ void RNA_def_gameproperty(BlenderRNA *brna) PropertyRNA *prop; /* Base Struct for GameProperty */ - srna= RNA_def_struct(brna, "GameProperty", NULL); + srna = RNA_def_struct(brna, "GameProperty", NULL); RNA_def_struct_ui_text(srna , "Game Property", "Game engine user defined object property"); RNA_def_struct_sdna(srna, "bProperty"); RNA_def_struct_refine_func(srna, "rna_GameProperty_refine"); - prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Available as GameObject attributes in the game engine's python API"); RNA_def_struct_name_property(srna, prop); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GameProperty_name_set"); RNA_def_property_update(prop, NC_LOGIC, NULL); - prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, gameproperty_type_items); RNA_def_property_ui_text(prop, "Type", ""); RNA_def_property_enum_funcs(prop, NULL, "rna_GameProperty_type_set", NULL); RNA_def_property_update(prop, NC_LOGIC, NULL); - prop= RNA_def_property(srna, "show_debug", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "show_debug", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PROP_DEBUG); RNA_def_property_ui_text(prop, "Debug", "Print debug information for this property"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* GameBooleanProperty */ - srna= RNA_def_struct(brna, "GameBooleanProperty", "GameProperty"); + srna = RNA_def_struct(brna, "GameBooleanProperty", "GameProperty"); RNA_def_struct_ui_text(srna , "Game Boolean Property", "Game engine user defined Boolean property"); RNA_def_struct_sdna(srna, "bProperty"); RNA_def_property_update(prop, NC_LOGIC, NULL); - prop= RNA_def_property(srna, "value", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "value", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "data", 1); RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* GameIntProperty */ - srna= RNA_def_struct(brna, "GameIntProperty", "GameProperty"); + srna = RNA_def_struct(brna, "GameIntProperty", "GameProperty"); RNA_def_struct_ui_text(srna , "Game Integer Property", "Game engine user defined integer number property"); RNA_def_struct_sdna(srna, "bProperty"); - prop= RNA_def_property(srna, "value", PROP_INT, PROP_NONE); + prop = RNA_def_property(srna, "value", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "data"); RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_range(prop, -10000, 10000); RNA_def_property_update(prop, NC_LOGIC, NULL); /* GameFloatProperty */ - srna= RNA_def_struct(brna, "GameFloatProperty", "GameProperty"); + srna = RNA_def_struct(brna, "GameFloatProperty", "GameProperty"); RNA_def_struct_ui_text(srna, "Game Float Property", "Game engine user defined floating point number property"); RNA_def_struct_sdna(srna, "bProperty"); - prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); - // RNA_def_property_float_sdna(prop, NULL, "data"); + prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); + /* RNA_def_property_float_sdna(prop, NULL, "data"); */ RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_range(prop, -10000, 10000); RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL); RNA_def_property_update(prop, NC_LOGIC, NULL); /* GameTimerProperty */ - srna= RNA_def_struct(brna, "GameTimerProperty", "GameProperty"); + srna = RNA_def_struct(brna, "GameTimerProperty", "GameProperty"); RNA_def_struct_ui_text(srna, "Game Timer Property", "Game engine user defined timer property"); RNA_def_struct_sdna(srna, "bProperty"); - prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); - // RNA_def_property_float_sdna(prop, NULL, "data"); + prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); + /* RNA_def_property_float_sdna(prop, NULL, "data"); */ RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_range(prop, -10000, 10000); RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL); RNA_def_property_update(prop, NC_LOGIC, NULL); /* GameStringProperty */ - srna= RNA_def_struct(brna, "GameStringProperty", "GameProperty"); + srna = RNA_def_struct(brna, "GameStringProperty", "GameProperty"); RNA_def_struct_ui_text(srna, "Game String Property", "Game engine user defined text string property"); RNA_def_struct_sdna(srna, "bProperty"); - prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); + prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "poin"); RNA_def_property_string_maxlength(prop, MAX_PROPSTRING); RNA_def_property_ui_text(prop, "Value", "Property value"); -- cgit v1.2.3