This commit is contained in:
Camille Chauvet
2023-01-05 19:04:29 +01:00
parent 909bb442b6
commit 975e0c2ef5
89 changed files with 226 additions and 201 deletions

View File

@ -6,19 +6,19 @@
# By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/09/27 08:39:27 by cchauvet #+# #+# #
# Updated: 2023/01/04 20:00:03 by cchauvet ### ########.fr #
# Updated: 2023/01/05 19:00:54 by cchauvet ### ########.fr #
# #
# **************************************************************************** #
CC = clang
SRCS = ft_strcmp.c ft_strfjoin.c ft_strmerger.c
SRCS = draw.c main.c map.c shape.c xpm.c
OBJS = $(SRCS:.c=.o)
NAME = extra.a
CFLAGS = -Wall -Werror -Wextra
CFLAGS = -Wall -Werror -Wextra -g
%.o: %.c extra.h
$(CC) $(CFLAGS) -c -o $@ $<

Binary file not shown.

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/04 14:03:10 by cchauvet #+# #+# */
/* Updated: 2023/01/04 19:59:10 by cchauvet ### ########.fr */
/* Updated: 2023/01/05 18:59:25 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -18,5 +18,6 @@
char *ft_strfjoin(char *s1, char *s2);
char *ft_strmerger(size_t arg_len, ...);
char **ft_tabrealloc(char **tab, size_t current_size, size_t new_size);
int ft_strcmp(char *s1, char *s2);
#endif

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/04 19:20:47 by cchauvet #+# #+# */
/* Updated: 2023/01/04 19:22:20 by cchauvet ### ########.fr */
/* Updated: 2023/01/05 13:20:20 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -14,7 +14,10 @@
int ft_strcmp(char *s1, char *s2)
{
while (*s1 == *s2 && *s1 != '\0')
s1++;
return (*s1 - *s2);
int i;
i = 0;
while (s1[i] == s2[i] && s1[i] != '\0')
i++;
return (s1[i] - s2[i]);
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_tabrealloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/05 18:58:48 by cchauvet #+# #+# */
/* Updated: 2023/01/05 18:58:59 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "extra.h"
char **ft_tabrealloc(char **tab, size_t current_size, size_t new_size)
{
char **new;
size_t i;
new = malloc(new_size * sizeof(char *));
if (new == NULL)
return (NULL);
i = 0;
while (i < current_size)
{
new[i] = tab[i];
i++;
}
free(tab);
return (new);
}