Cleanup: Use int8 type rather than char for buffer

Indicates that this is just a buffer with an element size of 8 bit, not
a displayable/printable string buffer.
This commit is contained in:
Julian Eisel 2021-12-01 12:16:44 +01:00
parent 51791004ea
commit fd22404837
2 changed files with 7 additions and 3 deletions

View File

@ -36,7 +36,9 @@ extern "C" {
extern const void *DNA_default_table[SDNA_TYPE_MAX];
char *_DNA_struct_default_alloc_impl(const char *data_src, size_t size, const char *alloc_str);
uint8_t *_DNA_struct_default_alloc_impl(const uint8_t *data_src,
size_t size,
const char *alloc_str);
/**
* Wrap with macro that casts correctly.

View File

@ -559,9 +559,11 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = {
#undef SDNA_DEFAULT_DECL
#undef SDNA_DEFAULT_DECL_EX
char *_DNA_struct_default_alloc_impl(const char *data_src, size_t size, const char *alloc_str)
uint8_t *_DNA_struct_default_alloc_impl(const uint8_t *data_src,
size_t size,
const char *alloc_str)
{
char *data_dst = MEM_mallocN(size, alloc_str);
uint8_t *data_dst = MEM_mallocN(size, alloc_str);
memcpy(data_dst, data_src, size);
return data_dst;
}