[Bf-blender-cvs] [bca7d15] master: Code cleanup: use const for rna

Campbell Barton noreply at git.blender.org
Tue Apr 22 15:08:32 CEST 2014


Commit: bca7d15ce039e5a9c3620f7bbce00246f537fd5a
Author: Campbell Barton
Date:   Tue Apr 22 22:55:10 2014 +1000
https://developer.blender.org/rBbca7d15ce039e5a9c3620f7bbce00246f537fd5a

Code cleanup: use const for rna

===================================================================

M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/intern/rna_access.c

===================================================================

diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index f385d61..b231d05 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -692,22 +692,22 @@ extern const PointerRNA PointerRNA_NULL;
 
 StructRNA *RNA_struct_find(const char *identifier);
 
-const char *RNA_struct_identifier(StructRNA *type);
-const char *RNA_struct_ui_name(StructRNA *type);
-const char *RNA_struct_ui_name_raw(StructRNA *type);
-const char *RNA_struct_ui_description(StructRNA *type);
-const char *RNA_struct_ui_description_raw(StructRNA *type);
-const char *RNA_struct_translation_context(StructRNA *type);
-int RNA_struct_ui_icon(StructRNA *type);
+const char *RNA_struct_identifier(const StructRNA *type);
+const char *RNA_struct_ui_name(const StructRNA *type);
+const char *RNA_struct_ui_name_raw(const StructRNA *type);
+const char *RNA_struct_ui_description(const StructRNA *type);
+const char *RNA_struct_ui_description_raw(const StructRNA *type);
+const char *RNA_struct_translation_context(const StructRNA *type);
+int RNA_struct_ui_icon(const StructRNA *type);
 
 PropertyRNA *RNA_struct_name_property(StructRNA *type);
 PropertyRNA *RNA_struct_iterator_property(StructRNA *type);
 StructRNA *RNA_struct_base(StructRNA *type);
 
-bool RNA_struct_is_ID(StructRNA *type);
-bool RNA_struct_is_a(StructRNA *type, StructRNA *srna);
+bool RNA_struct_is_ID(const StructRNA *type);
+bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna);
 
-bool RNA_struct_undo_check(StructRNA *type);
+bool RNA_struct_undo_check(const StructRNA *type);
 
 StructRegisterFunc RNA_struct_register(StructRNA *type);
 StructUnregisterFunc RNA_struct_unregister(StructRNA *type);
@@ -721,7 +721,7 @@ void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type);
 
 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_register_check(const StructRNA *type);
 bool RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier);
 
 PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier);
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 07d873e..d4f42ab 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -460,7 +460,7 @@ static PropertyRNA *rna_ensure_property(PropertyRNA *prop)
 	}
 }
 
-static const char *rna_ensure_property_identifier(PropertyRNA *prop)
+static const char *rna_ensure_property_identifier(const PropertyRNA *prop)
 {
 	if (prop->magic == RNA_MAGIC)
 		return prop->identifier;
@@ -491,7 +491,7 @@ static const char *rna_ensure_property_description(PropertyRNA *prop)
 	return description;
 }
 
-static const char *rna_ensure_property_name(PropertyRNA *prop)
+static const char *rna_ensure_property_name(const PropertyRNA *prop)
 {
 	const char *name;
 
@@ -516,22 +516,22 @@ StructRNA *RNA_struct_find(const char *identifier)
 	return NULL;
 }
 
-const char *RNA_struct_identifier(StructRNA *type)
+const char *RNA_struct_identifier(const StructRNA *type)
 {
 	return type->identifier;
 }
 
-const char *RNA_struct_ui_name(StructRNA *type)
+const char *RNA_struct_ui_name(const StructRNA *type)
 {
 	return CTX_IFACE_(type->translation_context, type->name);
 }
 
-const char *RNA_struct_ui_name_raw(StructRNA *type)
+const char *RNA_struct_ui_name_raw(const StructRNA *type)
 {
 	return type->name;
 }
 
-int RNA_struct_ui_icon(StructRNA *type)
+int RNA_struct_ui_icon(const StructRNA *type)
 {
 	if (type)
 		return type->icon;
@@ -539,17 +539,17 @@ int RNA_struct_ui_icon(StructRNA *type)
 		return ICON_DOT;
 }
 
-const char *RNA_struct_ui_description(StructRNA *type)
+const char *RNA_struct_ui_description(const StructRNA *type)
 {
 	return TIP_(type->description);
 }
 
-const char *RNA_struct_ui_description_raw(StructRNA *type)
+const char *RNA_struct_ui_description_raw(const StructRNA *type)
 {
 	return type->description;
 }
 
-const char *RNA_struct_translation_context(StructRNA *type)
+const char *RNA_struct_translation_context(const StructRNA *type)
 {
 	return type->translation_context;
 }
@@ -569,17 +569,17 @@ StructRNA *RNA_struct_base(StructRNA *type)
 	return type->base;
 }
 
-bool RNA_struct_is_ID(StructRNA *type)
+bool RNA_struct_is_ID(const StructRNA *type)
 {
 	return (type->flag & STRUCT_ID) != 0;
 }
 
-bool RNA_struct_undo_check(StructRNA *type)
+bool RNA_struct_undo_check(const StructRNA *type)
 {
 	return (type->flag & STRUCT_UNDO) != 0;
 }
 
-bool RNA_struct_idprops_register_check(StructRNA *type)
+bool RNA_struct_idprops_register_check(const StructRNA *type)
 {
 	return (type->flag & STRUCT_NO_IDPROPERTIES) == 0;
 }
@@ -600,9 +600,9 @@ bool RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier)
 	return false;
 }
 
-bool RNA_struct_is_a(StructRNA *type, StructRNA *srna)
+bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
 {
-	StructRNA *base;
+	const StructRNA *base;
 
 	if (srna == &RNA_AnyType)
 		return true;




More information about the Bf-blender-cvs mailing list