Fix nasty typo in CPP RNA that would break on int or bool dynarrays...
authorBastien Montagne <montagne29@wanadoo.fr>
Tue, 16 Dec 2014 15:57:41 +0000 (16:57 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 16 Dec 2014 15:57:41 +0000 (16:57 +0100)
source/blender/makesrna/intern/makesrna.c

index d45771c77d844c8e123c5d7ebaba0451f88f8863..f0a0f470ccf7dc07cea5090994155a20d56823b8 100644 (file)
@@ -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"