Skip to content

Commit

Permalink
fix/detail (#56)
Browse files Browse the repository at this point in the history
* fix #54

* update libft

* fix #55

* fix test

* fix test include
  • Loading branch information
rask24 committed Apr 21, 2024
1 parent 81c8c43 commit 946d239
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "libft"]
path = libft
url = git@github.com:rask24/libft
url= https://github.com/rask24/libft
3 changes: 2 additions & 1 deletion include/initialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 <errno.h>
# include "push_swap.h"

int check_args(int argc, char **argv);
Expand Down
4 changes: 2 additions & 2 deletions include/push_swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 <limits.h>
Expand Down
10 changes: 5 additions & 5 deletions include/stack_operations.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libft
Submodule libft updated 119 files
4 changes: 2 additions & 2 deletions src/stack_operations/repeat_dual_stack_operations.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);
Expand Down
4 changes: 2 additions & 2 deletions src/stack_operations/repeat_stack_operations.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);
Expand Down
2 changes: 2 additions & 0 deletions test/unit/test_greedy_operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "gtest/gtest.h"

extern "C" {
#include <fcntl.h>

#include "large_sort.h"
#include "push_swap.h"
}
Expand Down
2 changes: 2 additions & 0 deletions test/unit/test_push_b_segmented.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "gtest/gtest.h"

extern "C" {
#include <fcntl.h>

#include "large_sort.h"
#include "push_swap.h"
}
Expand Down
2 changes: 2 additions & 0 deletions test/unit/test_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "gtest/gtest.h"

extern "C" {
#include <fcntl.h>

#include "push_swap.h"
#include "sort.h"
}
Expand Down

0 comments on commit 946d239

Please sign in to comment.