Remove array structs (#10)
Reviewed-on: #10
This commit was merged in pull request #10.
This commit is contained in:
@@ -275,15 +275,15 @@ void wapp_str8_to_upper(Str8 *dst, Str8RO *src) {
|
||||
}
|
||||
}
|
||||
|
||||
void wapp_str8_from_bytes(Str8 *dst, const U8Array *src) {
|
||||
void wapp_str8_from_bytes(Str8 *dst, const U8Array src) {
|
||||
wapp_debug_assert(src != NULL && dst != NULL, "`dst` and `src` should not be NULL");
|
||||
|
||||
u64 size = src->count * src->item_size;
|
||||
u64 size = wapp_array_count(src) * wapp_array_item_size(src);
|
||||
|
||||
wapp_debug_assert(dst->capacity >= size, "`dst` does not have enough capacity");
|
||||
|
||||
dst->size = size;
|
||||
memcpy(dst->buf, src->items, size);
|
||||
memcpy(dst->buf, src, size);
|
||||
}
|
||||
|
||||
i64 wapp_str8_find(Str8RO *str, Str8RO substr) {
|
||||
|
||||
@@ -101,7 +101,7 @@ void wapp_str8_copy_to_cstr(char *dst, Str8RO *src, u64 dst_capacity);
|
||||
void wapp_str8_format(Str8 *dst, const char *format, ...);
|
||||
void wapp_str8_to_lower(Str8 *dst, Str8RO *src);
|
||||
void wapp_str8_to_upper(Str8 *dst, Str8RO *src);
|
||||
void wapp_str8_from_bytes(Str8 *dst, const U8Array *src);
|
||||
void wapp_str8_from_bytes(Str8 *dst, const U8Array src);
|
||||
|
||||
/**
|
||||
* Str8 find functions
|
||||
|
||||
Reference in New Issue
Block a user