tentative d'enlever les leaks en cours

This commit is contained in:
Hugo LAMY
2019-06-01 12:36:34 +02:00
parent 04a4fef38b
commit 27afcbe7e9
7 changed files with 33 additions and 33 deletions

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/27 13:46:29 by hulamy #+# #+# */
/* Updated: 2019/05/29 16:25:52 by hulamy ### ########.fr */
/* Updated: 2019/05/29 18:31:22 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -16,33 +16,31 @@
** function that print the given tetris if flag p is present
*/
t_fillist *print_tetri(t_fillist *list)
int print_tetri(t_fillist *list, int size)
{
unsigned int print;
t_fillist *tmp;
tmp = list;
if (list->dope[2])
{
while (tmp)
while (list && ++size)
{
check_same_tetri(list, 1);
print = tmp->tetribit;
print = list->tetribit;
print <<= 16;
print_sized_map(&print, tmp->width, tmp->height, tmp->letter);
if (tmp->same && list->dope[1])
print_sized_map(&print, list->width, list->height, list->letter);
if (list->same && list->dope[1])
{
print = tmp->same->tetribit;
print = list->same->tetribit;
print <<= 16;
ft_putstr("same --> ");
ft_put_tetri_color(tmp->same->letter);
ft_put_tetri_color(list->same->letter);
ft_putchar('\n');
}
ft_putchar('\n');
tmp = tmp->next;
list = list->next;
}
}
return (list);
return (size);
}
/*
@@ -50,7 +48,7 @@ t_fillist *print_tetri(t_fillist *list)
** it returns anyway the size of the map for main to print it
*/
int print_binary_map(unsigned int *map, int size, int *dope)
int print_binary_map(unsigned int *map, int size, int *dope)
{
size--;
if (dope[2])
@@ -59,6 +57,7 @@ int print_binary_map(unsigned int *map, int size, int *dope)
print_sized_map(map, size, size, '#');
ft_putchar('\n');
}
free(map);
return (size);
}
@@ -66,7 +65,7 @@ int print_binary_map(unsigned int *map, int size, int *dope)
** function that print the flags usage
*/
int print_flags_usage(void)
int print_flags_usage(void)
{
ft_putendl("flags usage :");
ft_putendl("d : debug print (print the map during the backtracking)");