aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-21 11:09:20 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-21 11:09:20 +0100
commitfe7b8336097b2935ae340ce43034a93d6b096b13 (patch)
treee1c80dc9afbc6374ff36c37acbc2c5a26b294891 /src/common
parent6be6c78c8856b14c19a1958dfa3993cc0ced1b3f (diff)
downloadpush_swap-fe7b8336097b2935ae340ce43034a93d6b096b13.tar.gz
push_swap-fe7b8336097b2935ae340ce43034a93d6b096b13.tar.bz2
push_swap-fe7b8336097b2935ae340ce43034a93d6b096b13.zip
WIP: better algo with 'sorting frame'
Diffstat (limited to 'src/common')
-rw-r--r--src/common/stack_helper.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/stack_helper.c b/src/common/stack_helper.c
index 6ea7cef..31d0fea 100644
--- a/src/common/stack_helper.c
+++ b/src/common/stack_helper.c
@@ -6,36 +6,36 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/19 06:40:18 by cacharle #+# #+# */
-/* Updated: 2020/01/19 07:03:32 by cacharle ### ########.fr */
+/* Updated: 2020/01/21 11:08:06 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#include "common.h"
-void stack_swap_2(t_stack *stack_a, t_stack *stack_b)
+inline void stack_swap_2(t_stack *stack_a, t_stack *stack_b)
{
stack_swap(stack_a);
stack_swap(stack_b);
}
-void stack_rotate_2(t_stack *stack_a, t_stack *stack_b)
+inline void stack_rotate_2(t_stack *stack_a, t_stack *stack_b)
{
stack_rotate(stack_a);
stack_rotate(stack_b);
}
-void stack_reverse_rotate_2(t_stack *stack_a, t_stack *stack_b)
+inline void stack_reverse_rotate_2(t_stack *stack_a, t_stack *stack_b)
{
stack_reverse_rotate(stack_a);
stack_reverse_rotate(stack_b);
}
-t_bool stack_empty(t_stack *stack)
+inline t_bool stack_empty(t_stack *stack)
{
return (stack->top == -1);
}
-int stack_length(t_stack *stack)
+inline int stack_length(t_stack *stack)
{
return (stack->top + 1);
}