update: normed the rest output

This commit is contained in:
maix0 2024-09-19 17:52:19 +02:00
parent 4a6ea68d08
commit bec1320c5f
26 changed files with 332 additions and 382 deletions

View file

@ -15,16 +15,15 @@
#include "me/vec/vec_pid.h"
#include <stdlib.h>
t_error vec_pid_push_front(t_vec_pid *vec,
t_pid element)
t_error vec_pid_push_front(t_vec_pid *vec, t_pid element)
{
t_usize i;
t_usize i;
if (vec->len == 0)
return (vec_pid_push(vec, element));
i = vec->len - 1;
if (vec->capacity < vec->len + 1 &&
vec_pid_reserve(vec, 3 * vec->len / 2 + 1))
if (vec->capacity < vec->len + 1 && vec_pid_reserve(vec, 3 * vec->len / 2
+ 1))
return (ERROR);
while (i > 0)
{
@ -37,9 +36,9 @@ t_error vec_pid_push_front(t_vec_pid *vec,
return (NO_ERROR);
}
t_error vec_pid_pop_front(t_vec_pid *vec, t_pid *value)
t_error vec_pid_pop_front(t_vec_pid *vec, t_pid *value)
{
t_usize i;
t_usize i;
if (vec->len <= 1)
return (vec_pid_pop(vec, value));
@ -55,10 +54,10 @@ t_error vec_pid_pop_front(t_vec_pid *vec, t_pid *value)
return (NO_ERROR);
}
void vec_pid_reverse(t_vec_pid *vec)
void vec_pid_reverse(t_vec_pid *vec)
{
t_pid temporary;
t_usize i;
t_pid temporary;
t_usize i;
i = 0;
while (i < vec->len / 2)
@ -70,9 +69,9 @@ void vec_pid_reverse(t_vec_pid *vec)
}
}
t_error vec_pid_back(t_vec_pid *vec, t_pid **out)
t_error vec_pid_back(t_vec_pid *vec, t_pid **out)
{
t_pid *temporary;
t_pid *temporary;
if (out == NULL)
out = &temporary;