From eb6e1048122b3bcedbd157839ca782a45b14b0a4 Mon Sep 17 00:00:00 2001 From: william Date: Sun, 5 Mar 2017 15:44:12 +0100 Subject: [PATCH] compilation sous linux possible, mise en commentaire des variables set but not used --- 42sh/Makefile | 16 ++++++++-------- 42sh/libft | 2 +- 42sh/src/builtin/bt_read_parse.c | 4 +--- 42sh/src/exec/exec_case.c | 7 ++++--- 42sh/src/exec/exec_case_branch.c | 7 ++++--- 42sh/src/exec/launch_process.c | 6 +++--- 42sh/src/job-control/sigchld_handler.c | 6 +++--- 42sh/src/job-control/sigtstp_handler.c | 6 +++--- 42sh/src/lexer/lexer_comment.c | 6 +++--- .../lib_line_editing/toolz_parseur.c | 6 +++--- 42sh/src/line-editing/move_up_and_down.c | 6 +++--- 42sh/src/main/main.c | 3 +-- 42sh/src/parser/add_case.c | 7 ++++--- 42sh/src/parser/add_condition.c | 6 +++--- 42sh/src/parser/add_loop.c | 6 +++--- 42sh/src/parser/add_subshell.c | 7 ++++--- 16 files changed, 51 insertions(+), 50 deletions(-) diff --git a/42sh/Makefile b/42sh/Makefile index 6fb08372..28d213b4 100644 --- a/42sh/Makefile +++ b/42sh/Makefile @@ -6,7 +6,7 @@ # By: wescande +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2016/08/29 21:32:58 by wescande #+# #+# # -# Updated: 2017/03/03 20:06:37 by ariard ### ########.fr # +#* Updated: 2017/03/05 15:36:45 by wescande ### ########.fr *# # # # **************************************************************************** # @@ -260,13 +260,13 @@ all : @make -j $(NAME) $(NAME): $(LIBFT_LIB) $(OBJ_DIR) $(OBJS) - @$(CC) $(FLAGS) $(D_FLAGS) \ + @$(CC) $(OBJS) -o $(NAME) \ -I $(INC_DIR) \ -I $(LIBFT_INC) \ $(LIBS) \ - $(LIBFT_LIB) $(OBJS) \ - -o $(NAME) - @printf "\r\e[48;5;15;38;5;25m✅ MAKE $(NAME)\e[0m\e[K\n" + $(LIBFT_LIB) \ + $(FLAGS) $(D_FLAGS) + @printf "\r\033[48;5;15;38;5;25m✅ MAKE $(NAME)\033[0m\033[K\n" $(LIBFT_LIB): @make -C $(LIBFT_DIR) @@ -280,7 +280,7 @@ $(OBJ_DIR)%.o : $(SRC_DIR)%.c | $(OBJ_DIR) @$(eval PERCENT=$(shell echo $$(($(INDEX)*100/$(NB))))) @$(eval COLOR=$(shell echo $$(($(PERCENT)%35+196)))) @$(eval TO_DO=$(shell echo $$((20-$(INDEX)*20/$(NB))))) - @printf "\r\e[38;5;11m⌛ MAKE %10.10s : %2d%% \e[48;5;%dm%*s\e[0m%*s\e[48;5;255m \e[0m \e[38;5;11m %*s\e[0m\e[K" $(NAME) $(PERCENT) $(COLOR) $(DONE) "" $(TO_DO) "" $(DELTA) "$@" + @printf "\r\033[38;5;11m⌛ MAKE %10.10s : %2d%% \033[48;5;%dm%*s\033[0m%*s\033[48;5;255m \033[0m \033[38;5;11m %*s\033[0m\033[K" $(NAME) $(PERCENT) $(COLOR) $(DONE) "" $(TO_DO) "" $(DELTA) "$@" @$(CC) $(FLAGS) $(D_FLAGS) -MMD -c $< -o $@\ -I $(INC_DIR)\ -I $(LIBFT_INC) @@ -288,14 +288,14 @@ $(OBJ_DIR)%.o : $(SRC_DIR)%.c | $(OBJ_DIR) clean: cleanlib @rm -rf $(OBJ_DIR) - @printf "\r\e[38;5;202m✖ clean $(NAME).\e[0m\e[K\n" + @printf "\r\033[38;5;202m✖ clean $(NAME).\033[0m\033[K\n" cleanlib: @make -C $(LIBFT_DIR) clean fclean: clean fcleanlib @rm -f $(NAME) - @printf "\r\e[38;5;196m❌ fclean $(NAME).\e[0m\e[K\n" + @printf "\r\033[38;5;196m❌ fclean $(NAME).\033[0m\033[K\n" fcleanlib: cleanlib @make -C $(LIBFT_DIR) fclean diff --git a/42sh/libft b/42sh/libft index 318efc7c..282df927 160000 --- a/42sh/libft +++ b/42sh/libft @@ -1 +1 @@ -Subproject commit 318efc7cfb7b7cc9d3714fa19fd2be7382b6adec +Subproject commit 282df927230b2c6da253f8fc9d7ca0eedc0fe30c diff --git a/42sh/src/builtin/bt_read_parse.c b/42sh/src/builtin/bt_read_parse.c index b23672f1..15aaff94 100644 --- a/42sh/src/builtin/bt_read_parse.c +++ b/42sh/src/builtin/bt_read_parse.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/27 18:25:22 by jhalford #+# #+# */ -/* Updated: 2017/01/27 19:40:14 by jhalford ### ########.fr */ +/* Updated: 2017/03/05 15:28:10 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -30,11 +30,9 @@ int bt_read_parse(t_read *data, char **av) { int i; int j; - int k; t_readopt *opt; i = 1; - k = 0; while (av[i]) { j = 0; diff --git a/42sh/src/exec/exec_case.c b/42sh/src/exec/exec_case.c index 0a0cebaa..b200ab15 100644 --- a/42sh/src/exec/exec_case.c +++ b/42sh/src/exec/exec_case.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/06 18:07:31 by ariard #+# #+# */ -/* Updated: 2017/03/04 18:18:29 by ariard ### ########.fr */ +/* Updated: 2017/03/05 15:29:22 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,16 +14,17 @@ int exec_case(t_btree **ast) { - t_astnode *node; +// t_astnode *node; /* char **av; */ t_exec *exec; + (void)ast; return (0); exec = &data_singleton()->exec; /* data_singleton()->exec.process.case_branch = 0; */ exec->attrs |= EXEC_CASE_BRANCH; - node = (*ast)->item; +// node = (*ast)->item; /* av = token_to_argv(node); */ /* data_singleton()->exec.process.case_pattern = av[0]; */ /* exec->case_pattern = av[0]; */ diff --git a/42sh/src/exec/exec_case_branch.c b/42sh/src/exec/exec_case_branch.c index 0cef16d4..32652b44 100644 --- a/42sh/src/exec/exec_case_branch.c +++ b/42sh/src/exec/exec_case_branch.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/06 18:07:31 by ariard #+# #+# */ -/* Updated: 2017/03/04 18:23:29 by ariard ### ########.fr */ +/* Updated: 2017/03/05 15:29:46 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,16 +14,17 @@ int exec_case_branch(t_btree **ast) { - t_astnode *node; +// t_astnode *node; /* char **av; */ t_exec *exec; + (void)ast; return (0); exec = &data_singleton()->exec; /* if (data_singleton()->exec.process.case_branch == 1) */ if (EXEC_IS_CASE_BRANCH(exec->attrs)) return (0); - node = (*ast)->item; +// node = (*ast)->item; /* av = token_to_argv(node); */ /* if (ft_strcmp(av[0], data_singleton()->exec.process.case_pattern) == 1) */ /* { */ diff --git a/42sh/src/exec/launch_process.c b/42sh/src/exec/launch_process.c index ab304058..ce715746 100644 --- a/42sh/src/exec/launch_process.c +++ b/42sh/src/exec/launch_process.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/13 14:20:45 by jhalford #+# #+# */ -/* Updated: 2017/03/05 14:41:08 by jhalford ### ########.fr */ +/* Updated: 2017/03/05 15:30:04 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,10 +14,10 @@ int launch_process(t_process *p) { - t_exec *exec; +// t_exec *exec; int pid; - exec = &data_singleton()->exec; +// exec = &data_singleton()->exec; DG("gonna launch [%s]", p->av[0]); DG("fdin=[%i]", p->fdin); DG("fdout=[%i]", p->fdout); diff --git a/42sh/src/job-control/sigchld_handler.c b/42sh/src/job-control/sigchld_handler.c index 87f795c7..4fe9724a 100644 --- a/42sh/src/job-control/sigchld_handler.c +++ b/42sh/src/job-control/sigchld_handler.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/10 17:37:56 by jhalford #+# #+# */ -/* Updated: 2017/01/31 15:09:29 by jhalford ### ########.fr */ +/* Updated: 2017/03/05 15:30:35 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,8 +14,8 @@ void sigchld_handler(int signo) { - t_data *data; +// t_data *data; (void)signo; - data = data_singleton(); +// data = data_singleton(); } diff --git a/42sh/src/job-control/sigtstp_handler.c b/42sh/src/job-control/sigtstp_handler.c index e6c9b923..5244b9c0 100644 --- a/42sh/src/job-control/sigtstp_handler.c +++ b/42sh/src/job-control/sigtstp_handler.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/10 15:14:53 by jhalford #+# #+# */ -/* Updated: 2017/01/22 19:03:32 by ariard ### ########.fr */ +/* Updated: 2017/03/05 15:30:58 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,10 +14,10 @@ void sigtstp_handler(int signo) { - t_jobc *jobc; +// t_jobc *jobc; (void)signo; - jobc = &data_singleton()->jobc; +// jobc = &data_singleton()->jobc; DG("got SIGTSTP pid=%i, pgrp=%i, shell_pgid=%i", getpid(), getpgrp(), data_singleton()->jobc.shell_pgid); ft_putchar('\x1A'); } diff --git a/42sh/src/lexer/lexer_comment.c b/42sh/src/lexer/lexer_comment.c index 1ae43e79..8a302869 100644 --- a/42sh/src/lexer/lexer_comment.c +++ b/42sh/src/lexer/lexer_comment.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/07 12:15:59 by jhalford #+# #+# */ -/* Updated: 2017/02/20 21:03:53 by ariard ### ########.fr */ +/* Updated: 2017/03/05 15:31:17 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,9 +14,9 @@ int lexer_comment(t_list **alst, t_lexer *lexer) { - t_token *token; +// t_token *token; - token = (*alst)->content; +// token = (*alst)->content; if (lexer->str[lexer->pos] == '\n') return (lexer_lex(&(*alst)->next, lexer)); return (lexer_comment(alst, lexer)); diff --git a/42sh/src/line-editing/lib_line_editing/toolz_parseur.c b/42sh/src/line-editing/lib_line_editing/toolz_parseur.c index a0781e12..7c14dc9b 100644 --- a/42sh/src/line-editing/lib_line_editing/toolz_parseur.c +++ b/42sh/src/line-editing/lib_line_editing/toolz_parseur.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/16 16:14:46 by gwojda #+# #+# */ -/* Updated: 2017/02/02 14:29:34 by gwojda ### ########.fr */ +/* Updated: 2017/03/05 15:31:42 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,12 +14,12 @@ char *ft_realloc_imput(char *str, int a, size_t pos) { - int i; +// int i; char tmp[2]; char *str_tmp; char *new_str; - i = 0; +// i = 0; tmp[0] = (char)a; tmp[1] = '\0'; if (!str) diff --git a/42sh/src/line-editing/move_up_and_down.c b/42sh/src/line-editing/move_up_and_down.c index 26eaa8d8..742f232a 100644 --- a/42sh/src/line-editing/move_up_and_down.c +++ b/42sh/src/line-editing/move_up_and_down.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/09 13:21:40 by gwojda #+# #+# */ -/* Updated: 2017/02/14 11:18:54 by gwojda ### ########.fr */ +/* Updated: 2017/03/05 15:32:18 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -40,9 +40,9 @@ static void ft_up_2(size_t *pos, char *str) void ft_up(void) { - int i; +// int i; - i = 0; +// i = 0; if (!STR || !POS) return ; if (STR[POS - 1] == '\n') diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index 7ebb7a70..30c69115 100644 --- a/42sh/src/main/main.c +++ b/42sh/src/main/main.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */ -/* Updated: 2017/03/05 15:16:12 by jhalford ### ########.fr */ +/* Updated: 2017/03/05 15:42:31 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -83,7 +83,6 @@ int get_input_fd() return (fd); else if (data->opts & SH_OPTS_LC) { - DG(); pipe(fds); fd = fds[PIPE_READ]; file = shell_get_avdata(); diff --git a/42sh/src/parser/add_case.c b/42sh/src/parser/add_case.c index a6fb19a5..0eb38a40 100644 --- a/42sh/src/parser/add_case.c +++ b/42sh/src/parser/add_case.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/04 20:42:13 by ariard #+# #+# */ -/* Updated: 2017/03/04 21:54:21 by ariard ### ########.fr */ +/* Updated: 2017/03/05 15:33:58 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,10 +15,11 @@ int iscase(t_btree **ast, t_list **lst) { t_astnode *node; - t_token *token; +// t_token *token; + (void)lst; node = NULL; - token = (*lst)->content; +// token = (*lst)->content; if (*ast) { node = (*ast)->item; diff --git a/42sh/src/parser/add_condition.c b/42sh/src/parser/add_condition.c index d73dc8d1..6dd90ac6 100644 --- a/42sh/src/parser/add_condition.c +++ b/42sh/src/parser/add_condition.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/19 18:12:52 by ariard #+# #+# */ -/* Updated: 2017/03/04 21:51:34 by ariard ### ########.fr */ +/* Updated: 2017/03/05 15:32:49 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,10 +15,10 @@ int iscondition(t_btree **ast, t_list **lst) { t_astnode *node; - t_token *token; +// t_token *token; node = NULL; - token = (*lst)->content; +// token = (*lst)->content; DG("iscondition"); if (*ast) { diff --git a/42sh/src/parser/add_loop.c b/42sh/src/parser/add_loop.c index 5c39e299..3096eb61 100644 --- a/42sh/src/parser/add_loop.c +++ b/42sh/src/parser/add_loop.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/17 22:17:14 by ariard #+# #+# */ -/* Updated: 2017/03/04 22:05:26 by ariard ### ########.fr */ +/* Updated: 2017/03/05 15:33:35 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,10 +15,10 @@ int isloop(t_btree **ast, t_list **lst) { t_astnode *node; - t_token *token; +// t_token *token; node = NULL; - token = (*lst)->content; +// token = (*lst)->content; DG("isloop"); if (*ast) { diff --git a/42sh/src/parser/add_subshell.c b/42sh/src/parser/add_subshell.c index 03fc263a..02618324 100644 --- a/42sh/src/parser/add_subshell.c +++ b/42sh/src/parser/add_subshell.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/24 18:41:50 by ariard #+# #+# */ -/* Updated: 2017/03/03 14:27:44 by ariard ### ########.fr */ +/* Updated: 2017/03/05 15:34:12 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,10 +15,11 @@ int issubshell(t_btree **ast, t_list **lst) { t_astnode *node; - t_token *token; +// t_token *token; + (void)lst; node = NULL; - token = (*lst)->content; +// token = (*lst)->content; if (*ast) { node = (*ast)->item;