fixed Array functions

This commit is contained in:
timerix 2022-10-28 12:09:24 +06:00
parent 5e35cb6721
commit 5e907327d6

View File

@ -16,13 +16,13 @@ typedef struct Array_##type{\
\ \
static inline Array_##type Array_##type##_allocValues(uint32 length){\ static inline Array_##type Array_##type##_allocValues(uint32 length){\
return (Array_##type) {\ return (Array_##type) {\
.values=malloc(sizeof(type)*length),\ .values=(type##*)malloc(sizeof(type)*length),\
.length=length,\ .length=length,\
.allocatedOnHeap=true\ .allocatedOnHeap=true\
};\ };\
}\ }\
\ \
static inline Array_##type Array_##type##_fromBuffer(buffer, bufferLength, allocatedOnHeap){\ static inline Array_##type Array_##type##_fromBuffer(type##* buffer, uint32 bufferLength, bool allocatedOnHeap){\
return (Array_##type) {\ return (Array_##type) {\
.values=buffer,\ .values=buffer,\
.length=bufferLength,\ .length=bufferLength,\