diff --git a/.gitmodules b/.gitmodules index 14ebffc..5b5c3f4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "libft"] path = libft - url = git@github.com:rask24/libft + url= https://github.com/rask24/libft diff --git a/include/initialization.h b/include/initialization.h index 376fb6c..d0868f6 100644 --- a/include/initialization.h +++ b/include/initialization.h @@ -6,13 +6,14 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/11 12:30:37 by reasuke #+# #+# */ -/* Updated: 2024/02/11 12:33:50 by reasuke ### ########.fr */ +/* Updated: 2024/04/21 16:25:21 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef INITIALIZATION_H # define INITIALIZATION_H +# include # include "push_swap.h" int check_args(int argc, char **argv); diff --git a/include/push_swap.h b/include/push_swap.h index 0efbf41..3459a5d 100644 --- a/include/push_swap.h +++ b/include/push_swap.h @@ -6,14 +6,14 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/10 12:37:54 by reasuke #+# #+# */ -/* Updated: 2024/02/20 14:19:53 by reasuke ### ########.fr */ +/* Updated: 2024/04/21 16:25:05 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef PUSH_SWAP_H # define PUSH_SWAP_H -# include "../libft/libft.h" +# include "../libft/include/libft.h" # include "types.h" # include "utils.h" # include diff --git a/include/stack_operations.h b/include/stack_operations.h index 835868d..b34a49f 100644 --- a/include/stack_operations.h +++ b/include/stack_operations.h @@ -6,7 +6,7 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/11 12:41:01 by reasuke #+# #+# */ -/* Updated: 2024/04/20 15:40:33 by reasuke ### ########.fr */ +/* Updated: 2024/04/21 16:30:51 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,17 +15,17 @@ # include "push_swap.h" -typedef void t_operation(t_stack **); -typedef void t_dual_operation(t_stack **, t_stack **); +typedef void (*t_operation)(t_stack **); +typedef void (*t_dual_operation)(t_stack **, t_stack **); void push_stack(t_stack **p_s1, t_stack **p_s2); void swap_stack(t_stack **p_stack); void rotate_stack(t_stack **p_stack); void reverse_rotate_stack(t_stack **p_stack); -void repeat_stack_operations(t_stack **p_st, int n, t_operation *op); +void repeat_stack_operations(t_stack **p_st, int n, t_operation op); void repeat_dual_stack_operations(t_stack **p_a, t_stack **p_b, int n, - t_dual_operation *op); + t_dual_operation op); void operate_sa(t_stack **p_a); void operate_sb(t_stack **p_b); diff --git a/libft b/libft index 084b31b..cc2f508 160000 --- a/libft +++ b/libft @@ -1 +1 @@ -Subproject commit 084b31be13aa9ad8da2437e328307ee043c0ee65 +Subproject commit cc2f508132f345fe22652c36cb2dbc7a912eb997 diff --git a/src/stack_operations/repeat_dual_stack_operations.c b/src/stack_operations/repeat_dual_stack_operations.c index 3d959bf..35086e6 100644 --- a/src/stack_operations/repeat_dual_stack_operations.c +++ b/src/stack_operations/repeat_dual_stack_operations.c @@ -6,14 +6,14 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/10 19:22:50 by reasuke #+# #+# */ -/* Updated: 2024/04/20 15:40:46 by reasuke ### ########.fr */ +/* Updated: 2024/04/21 16:27:29 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ #include "stack_operations.h" void repeat_dual_stack_operations(t_stack **p_a, t_stack **p_b, int n, - t_dual_operation *op) + t_dual_operation op) { while (n--) op(p_a, p_b); diff --git a/src/stack_operations/repeat_stack_operations.c b/src/stack_operations/repeat_stack_operations.c index ec782f7..d3110fa 100644 --- a/src/stack_operations/repeat_stack_operations.c +++ b/src/stack_operations/repeat_stack_operations.c @@ -6,13 +6,13 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/10 19:22:26 by reasuke #+# #+# */ -/* Updated: 2024/04/20 15:39:53 by reasuke ### ########.fr */ +/* Updated: 2024/04/21 16:27:24 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ #include "stack_operations.h" -void repeat_stack_operations(t_stack **p_st, int n, t_operation *op) +void repeat_stack_operations(t_stack **p_st, int n, t_operation op) { while (n--) op(p_st); diff --git a/test/unit/test_greedy_operation.cpp b/test/unit/test_greedy_operation.cpp index e088c4f..73f7608 100644 --- a/test/unit/test_greedy_operation.cpp +++ b/test/unit/test_greedy_operation.cpp @@ -6,6 +6,8 @@ #include "gtest/gtest.h" extern "C" { +#include + #include "large_sort.h" #include "push_swap.h" } diff --git a/test/unit/test_push_b_segmented.cpp b/test/unit/test_push_b_segmented.cpp index 3f9d6d9..d31abc4 100644 --- a/test/unit/test_push_b_segmented.cpp +++ b/test/unit/test_push_b_segmented.cpp @@ -8,6 +8,8 @@ #include "gtest/gtest.h" extern "C" { +#include + #include "large_sort.h" #include "push_swap.h" } diff --git a/test/unit/test_sort.cpp b/test/unit/test_sort.cpp index 31198be..33687b7 100644 --- a/test/unit/test_sort.cpp +++ b/test/unit/test_sort.cpp @@ -7,6 +7,8 @@ #include "gtest/gtest.h" extern "C" { +#include + #include "push_swap.h" #include "sort.h" }