the week-end party goes on \o\ /o/

finished transition to t_psdata format
corrected some pointer formating
started testing on parser function:
	- weird valgrind errors about uninitialised values
	- some read/write/free errors still hanging around

** END TRANSMISSION **
This commit is contained in:
Tanguy MAZE
2019-02-24 18:15:56 +01:00
parent beba6ce86f
commit 62764dc5e7
7 changed files with 78 additions and 49 deletions

View File

@@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/21 16:32:04 by tmaze #+# #+# */
/* Updated: 2019/02/23 16:08:12 by tmaze ### ########.fr */
/* Updated: 2019/02/24 13:58:12 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
@@ -27,24 +27,24 @@ void ps_rerot(t_psdata *data, char c)
s = data->b;
if (c == 'b')
size = data->size_b;
if (*s != NULL && size > 2)
if (s != NULL && size > 2)
{
prec = *s;
tmp = (*s)->next;
prec = s;
tmp = s->next;
while (tmp->next != NULL)
{
tmp = tmp->next;
prec = prec->next;
}
prec->next = NULL;
ps_stkpsh(s, tmp);
ps_stkpsh(data, c, tmp);
}
else if (*s != NULL && ps_stksize(*s) == 2)
ps_swap(s);
else if (s != NULL && size == 2)
ps_swap(data, c);
}
void ps_rrerot(t_stack **a, t_stack **b)
void ps_rrerot(t_psdata *data)
{
ps_rerot(a);
ps_rerot(b);
ps_rerot(data, 'a');
ps_rerot(data, 'b');
}