diff options
Diffstat (limited to 'src/ft_get_colors.c')
-rw-r--r-- | src/ft_get_colors.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/ft_get_colors.c b/src/ft_get_colors.c index 2e09fc6..750ebed 100644 --- a/src/ft_get_colors.c +++ b/src/ft_get_colors.c @@ -16,7 +16,7 @@ ft_check_digits(const char *word) } static int -ft_get_f_color(char *line, char **words, t_win *wlist) +ft_get_f_color(char *line, char **words, t_cub *clist) { char **num; @@ -32,18 +32,18 @@ ft_get_f_color(char *line, char **words, t_win *wlist) ft_free_words(num, NULL); return (-1); } - wlist->clist->f_color = ft_atoi(num[0]); - wlist->clist->f_color *= 1000; - wlist->clist->f_color += ft_atoi(num[1]); - wlist->clist->f_color *= 1000; - wlist->clist->f_color += ft_atoi(num[2]); + clist->f_color = ft_atoi(num[0]); + clist->f_color *= 1000; + clist->f_color += ft_atoi(num[1]); + clist->f_color *= 1000; + clist->f_color += ft_atoi(num[2]); ft_free_words(num, NULL); ft_free_words(words, line); return (0); } static int -ft_get_c_color(char *line, char **words, t_win *wlist) +ft_get_c_color(char *line, char **words, t_cub *clist) { char **num; @@ -59,18 +59,18 @@ ft_get_c_color(char *line, char **words, t_win *wlist) ft_free_words(num, NULL); return (-1); } - wlist->clist->c_color = ft_atoi(num[0]); - wlist->clist->c_color *= 1000; - wlist->clist->c_color += ft_atoi(num[1]); - wlist->clist->c_color *= 1000; - wlist->clist->c_color += ft_atoi(num[2]); + clist->c_color = ft_atoi(num[0]); + clist->c_color *= 1000; + clist->c_color += ft_atoi(num[1]); + clist->c_color *= 1000; + clist->c_color += ft_atoi(num[2]); ft_free_words(num, NULL); ft_free_words(words, line); return (0); } int -ft_get_colors(int fd, t_win *wlist) +ft_get_colors(int fd, t_cub *clist) { char *line; char **words; @@ -78,22 +78,22 @@ ft_get_colors(int fd, t_win *wlist) if (get_next_line(fd, &line) <= 0 || !(words = ft_split(line, ' '))) { ft_memdel(line); - return (ft_map_error(8, wlist)); + return (ft_map_error(8, clist)); } - if (ft_get_f_color(line, words, wlist) < 0) + if (ft_get_f_color(line, words, clist) < 0) { ft_free_words(words, line); - return (ft_map_error(8, wlist)); + return (ft_map_error(8, clist)); } if (get_next_line(fd, &line) <= 0 || !(words = ft_split(line, ' '))) { ft_memdel(line); - return (ft_map_error(9, wlist)); + return (ft_map_error(9, clist)); } - if (ft_get_c_color(line, words, wlist) < 0) + if (ft_get_c_color(line, words, clist) < 0) { ft_free_words(words, line); - return (ft_map_error(9, wlist)); + return (ft_map_error(9, clist)); } return (0); } |