void vector_pop_first(Vector* vector)
{
safe_free(vector->datas[0]);
- vector->datas++;
+
+
+ //HACK: next 3 lines move vector head
+ void** nextDatas = vector->datas + 1;
+ safe_free(vector->datas);
+ vector->datas = nextDatas;
+//but memory can then be reallocated : TODO
+
+
vector->size--;
- if (vector_size(vector) <= (vector->capacity >> 1))
+ if (vector->size <= (vector->capacity >> 1))
_vector_realloc(vector, vector->capacity >> 1);
}
int main(int argc, char** argv)
{
//file ./t.Vector.c :
- void t_vector_clear();
- void t_vector_size();
- void t_vector_push_pop_basic();
- void t_vector_push_pop_evolved();
- void t_vector_copy();
+ t_vector_clear();
+ t_vector_size();
+ t_vector_push_pop_basic();
+ t_vector_push_pop_evolved();
+ t_vector_copy();
//file ./t.BufferTop.c :
- void t_buffertop_clear();
- void t_buffertop_size();
- void t_buffertop_push_pop_basic();
- void t_buffertop_push_pop_evolved();
- void t_buffertop_copy();
+ t_buffertop_clear();
+ t_buffertop_size();
+ t_buffertop_push_pop_basic();
+ t_buffertop_push_pop_evolved();
+ t_buffertop_copy();
//file ./t.Tree.c :
- void t_tree_clear();
- void t_tree_size();
- void t_tree_add_remove();
- void t_tree_iterate();
- void t_tree_copy();
+ t_tree_clear();
+ t_tree_size();
+ t_tree_add_remove();
+ t_tree_iterate();
+ t_tree_copy();
//file ./t.Heap.c :
- void t_heap_clear();
- void t_heap_size();
- void t_heap_push_pop_basic();
- void t_heap_push_pop_evolved();
- void t_heap_copy();
+ t_heap_clear();
+ t_heap_size();
+ t_heap_push_pop_basic();
+ t_heap_push_pop_evolved();
+ t_heap_copy();
//file ./t.List.c :
- void t_list_clear();
- void t_list_size();
- void t_list_push_pop_basic();
- void t_list_push_pop_evolved();
- void t_list_copy();
+ t_list_clear();
+ t_list_size();
+ t_list_push_pop_basic();
+ t_list_push_pop_evolved();
+ t_list_copy();
//file ./t.Queue.c :
- void t_queue_clear();
- void t_queue_size();
- void t_queue_push_pop_basic();
- void t_queue_push_pop_evolved();
- void t_queue_copy();
+ t_queue_clear();
+ t_queue_size();
+ t_queue_push_pop_basic();
+ t_queue_push_pop_evolved();
+ t_queue_copy();
//file ./t.Stack.c :
- void t_stack_clear();
- void t_stack_size();
- void t_stack_push_pop_basic();
- void t_stack_push_pop_evolved();
- void t_stack_copy();
+ t_stack_clear();
+ t_stack_size();
+ t_stack_push_pop_basic();
+ t_stack_push_pop_evolved();
+ t_stack_copy();
//file ./t.PriorityQueue.c :
- void t_priorityqueue_clear();
- void t_priorityqueue_size();
- void t_priorityqueue_push_pop_basic();
- void t_priorityqueue_push_pop_evolved();
- void t_priorityqueue_copy();
+ t_priorityqueue_clear();
+ t_priorityqueue_size();
+ t_priorityqueue_push_pop_basic();
+ t_priorityqueue_push_pop_evolved();
+ t_priorityqueue_copy();
return 0;
}