[Bf-blender-cvs] [72330b9] master: Fix nasty typo in CPP RNA that would break on int or bool dynarrays...

Bastien Montagne noreply at git.blender.org
Tue Dec 16 16:58:38 CET 2014


Commit: 72330b97a2953959054593058438be80b5c53120
Author: Bastien Montagne
Date:   Tue Dec 16 16:57:41 2014 +0100
Branches: master
https://developer.blender.org/rB72330b97a2953959054593058438be80b5c53120

Fix nasty typo in CPP RNA that would break on int or bool dynarrays...

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

M	source/blender/makesrna/intern/makesrna.c

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

diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index d45771c..f0a0f47 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -3682,7 +3682,7 @@ static const char *cpp_classes = ""
 "	int length;\n"
 "\n"
 "	DynamicArray() : data(NULL), length(0) {}\n"
-"	DynamicArray(int new_length) : data(NULL), length(new_length) { data = (float *)malloc(sizeof(T) * new_length); }\n"
+"	DynamicArray(int new_length) : data(NULL), length(new_length) { data = (T *)malloc(sizeof(T) * new_length); }\n"
 "	DynamicArray(const DynamicArray<T>& other) { copy_from(other); }\n"
 "	const DynamicArray<T>& operator = (const DynamicArray<T>& other) { copy_from(other); return *this; }\n"
 "\n"
@@ -3693,7 +3693,7 @@ static const char *cpp_classes = ""
 "protected:\n"
 "	void copy_from(const DynamicArray<T>& other) {\n"
 "		if (data) free(data);\n"
-"		data = (float *)malloc(sizeof(T) * other.length);\n"
+"		data = (T *)malloc(sizeof(T) * other.length);\n"
 "		memcpy(data, other.data, sizeof(T) * other.length);\n"
 "		length = other.length;\n"
 "	}\n"




More information about the Bf-blender-cvs mailing list