Fix nasty typo in CPP RNA that would break on int or bool dynarrays...
This commit is contained in:
parent
1549fea999
commit
72330b97a2
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue