collection structs name replaced with macro
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
#include "tlibc/collections/List.h"
|
||||
|
||||
List List_alloc_size(u32 initial_size){
|
||||
List_ List_alloc_size(u32 initial_size){
|
||||
if(initial_size == 0)
|
||||
return List_construct_size(NULL, 0, 0);
|
||||
u32 allocated_size = ALIGN_TO(initial_size, sizeof(void*));
|
||||
return List_construct_size(malloc(allocated_size), 0, allocated_size);
|
||||
}
|
||||
|
||||
void* List_expand(List* ptr, u32 expansion_size){
|
||||
void* List_expand(List_* ptr, u32 expansion_size){
|
||||
u32 occupied_size = ptr->size;
|
||||
u32 expanded_alloc_size = ptr->allocated_size;
|
||||
if(expanded_alloc_size == 0)
|
||||
@@ -22,12 +22,12 @@ void* List_expand(List* ptr, u32 expansion_size){
|
||||
return (u8*)(ptr->data) + occupied_size;
|
||||
}
|
||||
|
||||
void List_push_size(List* ptr, void* values, u32 size){
|
||||
void List_push_size(List_* ptr, void* values, u32 size){
|
||||
void* empty_cell_ptr = List_expand(ptr, size);
|
||||
memcpy(empty_cell_ptr, values, size);
|
||||
}
|
||||
|
||||
bool List_removeAt_size(List* ptr, u32 i, u32 remove_size){
|
||||
bool List_removeAt_size(List_* ptr, u32 i, u32 remove_size){
|
||||
if(i + remove_size >= ptr->size)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user