wip debug lstaddsort

This commit is contained in:
Tanguy MAZE
2018-10-01 13:10:35 +02:00
parent 492b26f7fe
commit 405c9b9717

View File

@@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */ /* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2018/10/01 11:57:25 by tmaze #+# #+# */ /* Created: 2018/10/01 11:57:25 by tmaze #+# #+# */
/* Updated: 2018/10/01 12:40:27 by tmaze ### ########.fr */ /* Updated: 2018/10/01 13:10:02 by tmaze ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -18,8 +18,10 @@ void ft_lstaddsort(t_list **lst, t_list *new, int (*f)(void *c1, void *c2),
t_list *sorted; t_list *sorted;
sorted = *lst; sorted = *lst;
while (sorted && ((*f)(sorted->content, new->content) <= 0 if (rev)
|| ((*f)(sorted->content, new->content) >= 0 && rev))) ft_putstr("rev\n");
while (sorted && (((*f)(sorted->content, new->content) >= 0 && rev))
|| (*f)(sorted->content, new->content) <= 0)
sorted = sorted->next; sorted = sorted->next;
ft_lstadd(lst, new); ft_lstadd(lst, new);
} }