Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-09-15 17:02:37 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-09-15 17:02:37 +0400
commit30293dc2ca8052ad0c7113c77365feca590f4d05 (patch)
treec5f4a092be7204ef2107792c0a16c0d9f331dbba /source/blender/makesrna/intern/rna_access.c
parente715a7185ca176c8a73cd638d4acaa40f75a7d77 (diff)
parent9648c6016b35a72aa23395f5d200e342df16490b (diff)
svn merge -r39834:40222 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 27290929767..92bacfe2a60 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -585,6 +585,17 @@ static const char *rna_ensure_property_name(PropertyRNA *prop)
/* Structs */
+StructRNA *RNA_struct_find(const char *identifier)
+{
+ StructRNA *type;
+ if (identifier) {
+ for (type = BLENDER_RNA.structs.first; type; type = type->cont.next)
+ if (strcmp(type->identifier, identifier)==0)
+ return type;
+ }
+ return NULL;
+}
+
const char *RNA_struct_identifier(StructRNA *type)
{
return type->identifier;
@@ -2326,8 +2337,17 @@ char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fi
else
buf= MEM_mallocN(sizeof(char)*(length+1), "RNA_string_get_alloc");
+#ifndef NDEBUG
+ /* safety check to ensure the string is actually set */
+ buf[length]= 255;
+#endif
+
RNA_property_string_get(ptr, prop, buf);
+#ifndef NDEBUG
+ BLI_assert(buf[length] == '\0');
+#endif
+
return buf;
}
@@ -4497,7 +4517,7 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
buf= MEM_mallocN(sizeof(char)*(length+1), "RNA_property_as_string");
buf_esc= MEM_mallocN(sizeof(char)*(length*2+1), "RNA_property_as_string esc");
RNA_property_string_get(ptr, prop, buf);
- BLI_strescape(buf_esc, buf, length*2);
+ BLI_strescape(buf_esc, buf, length*2+1);
MEM_freeN(buf);
BLI_dynstr_appendf(dynstr, "\"%s\"", buf_esc);
MEM_freeN(buf_esc);
@@ -5464,7 +5484,8 @@ int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, i
return 0;
}
-void RNA_warning(const char *format, ...)
+/* use RNA_warning macro which includes __func__ suffix */
+void _RNA_warning(const char *format, ...)
{
va_list args;
@@ -5472,6 +5493,11 @@ void RNA_warning(const char *format, ...)
vprintf(format, args);
va_end(args);
+ /* gcc macro adds '\n', but cant use for other compilers */
+#ifndef __GNUC__
+ fputc('\n', stdout);
+#endif
+
#ifdef WITH_PYTHON
{
extern void PyC_LineSpit(void);