From 2cfddcc1f58e3653142e25a4d9a80177044a8c53 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Sun, 1 Mar 2020 20:45:50 +0100 Subject: in progress --- Makefile | 2 +- src/ft_click_close.c | 1 + src/ft_exit.c | 8 ++++++-- src/ft_init_lists.c | 4 +--- src/ft_init_winlx.c | 1 - 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index d36c557..4e155d4 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ FSANITIZE = -fsanitize=address CC = clang #--------------------------------------------------------------------------------------------------# CFLAGS = -std=c89 -CFLAGS = -Wall +CFLAGS += -Wall CFLAGS += -Wextra CFLAGS += -Werror CFLAGS += -pedantic diff --git a/src/ft_click_close.c b/src/ft_click_close.c index 113c241..02efbe3 100644 --- a/src/ft_click_close.c +++ b/src/ft_click_close.c @@ -20,6 +20,7 @@ int { (void)keycode; (void)clist; + /* ft_exit(0, clist); */ exit(0); return (0); } diff --git a/src/ft_exit.c b/src/ft_exit.c index dec46b1..1c4a1a8 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include static void ft_free_lists(t_cub *clist) @@ -33,7 +33,7 @@ static void ft_memdel((void**)&clist->plist); if (!clist->wlist->inited) ft_memdel((void**)&clist->wlist->winptr); - ft_memdel((void**)&clist->wlist->wlx); + /* ft_memdel((void**)&clist->wlist->wlx); */ ft_memdel((void**)&clist->wlist); ft_memdel((void**)&clist); } @@ -41,6 +41,9 @@ static void int ft_exit(uint8_t exit_code, t_cub *clist) { + /* uint8_t i; */ + + /* i = 0; */ if (clist->walltexgood) { if (clist->tlist[0].img) @@ -77,6 +80,7 @@ int } ft_free_lists(clist); ft_printf("Exiting program\n"); + while (1); exit(exit_code); return (0); } diff --git a/src/ft_init_lists.c b/src/ft_init_lists.c index 1c1089c..65c28d8 100644 --- a/src/ft_init_lists.c +++ b/src/ft_init_lists.c @@ -44,7 +44,6 @@ static t_player plist->dir_x = -1; plist->dir_y = 0; plist->plane_x = 0; - /* plist->plane_y = 0.66666666; */ plist->plane_y = 0.75; return (plist); } @@ -56,8 +55,7 @@ static t_win if (!(wlist = (t_win*)malloc(sizeof(t_win)))) return (NULL); - if (!(wlist->wlx = malloc(1)) || - !(wlist->winptr = malloc(1))) + if (!(wlist->winptr = malloc(1))) return (NULL); wlist->inited = 0; wlist->x_size = 0; diff --git a/src/ft_init_winlx.c b/src/ft_init_winlx.c index db1d88d..87398e4 100644 --- a/src/ft_init_winlx.c +++ b/src/ft_init_winlx.c @@ -18,7 +18,6 @@ int ft_init_winlx(t_cub *clist) { - ft_memdel((void**)&clist->wlist->wlx); if (!(clist->wlist->wlx = mlx_init())) return (-1); return (0); -- cgit v1.2.3