diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ft_sort_s_t.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/ft_sort_s_t.c b/src/ft_sort_s_t.c index 702d5e6..eaf866e 100644 --- a/src/ft_sort_s_t.c +++ b/src/ft_sort_s_t.c @@ -17,15 +17,15 @@ #include <stdlib.h> #include <math.h> -/*clearpilled*/ +/*divine*/ -void -ft_init_st(int32_t st_o[8]) +static void + ft_init_st(uint16_t sprite_var, int32_t st_o[8]) { int8_t i; i = -1; - while (++i < 3) + while (++i < sprite_var) st_o[i] = i; } @@ -37,10 +37,10 @@ void float *tmp_i; i = -1; - ft_init_st(cl->mlist.st_o); - tmp_i = ft_calloc(sizeof(int32_t), 4096); + if (!(tmp_i = ft_calloc(sizeof(int32_t), 4096))) + return ; + ft_init_st(cl->mlist.sprite_var, cl->mlist.st_o); while (++i < cl->mlist.sprite_var) - { if (dist_tab[i][0] < dist_tab[i + 1][0]) { tmp = cl->mlist.st_o[i]; @@ -51,9 +51,4 @@ void ft_memcpy(dist_tab[i + 1], tmp_i, 4096); i = -1; } - } - i = -1; - while (++i < 3) - printf("%d\n", cl->mlist.st_o[i]); - puts("-------------------------"); } |