z
This commit is contained in:
parent
b891447a0d
commit
d73f6e1a03
13
Makefile
13
Makefile
|
@ -6,7 +6,7 @@
|
|||
# By: erey-bet <marvin@42.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2022/09/27 04:19:30 by erey-bet #+# #+# #
|
||||
# Updated: 2022/10/14 22:38:25 by erey-bet ### ########.fr #
|
||||
# Updated: 2022/10/15 15:06:59 by erey-bet ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
|
@ -18,13 +18,16 @@ ft_substr.c ft_strjoin.c ft_strtrim.c ft_split.c ft_itoa.c ft_strmapi.c \
|
|||
ft_striteri.c ft_putchar_fd.c ft_putstr_fd.c ft_putendl_fd.c ft_putnbr_fd.c \
|
||||
ft_get_size.c ft_power.c
|
||||
OBJS = ${SRCS:.c=.o}
|
||||
BONUS = ft_lstnew.c ft_lstadd_front.c ft_lstsize.c ft_lstlast.c \
|
||||
BONUS_SRCS = ft_lstnew.c ft_lstadd_front.c ft_lstsize.c ft_lstlast.c \
|
||||
ft_lstadd_back.c ft_lstdelone.c ft_lstclear.c ft_lstiter.c ft_lstmap.c
|
||||
BONUS_OBJS = ${BONUS:.c=.o}
|
||||
BONUS_OBJS = ${BONUS_SRCS:.c=.o}
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -Werror
|
||||
NAME = libft.a
|
||||
|
||||
ifdef BONUS
|
||||
SRCS += ${BONUS_SRCS}
|
||||
endif
|
||||
|
||||
all: ${NAME}
|
||||
|
||||
|
@ -42,8 +45,8 @@ fclean: clean
|
|||
|
||||
re: fclean all
|
||||
|
||||
bonus: ${BONUS_OBJS}
|
||||
ar -rc ${NAME} ${BONUS_OBJS}
|
||||
bonus:
|
||||
@make BONUS=1
|
||||
|
||||
coffee:
|
||||
@clear
|
||||
|
|
|
@ -14,8 +14,10 @@
|
|||
|
||||
static int ft_isspace(char c)
|
||||
{
|
||||
return (c == ' ' || c == '\f'
|
||||
||c == '\n' || c == '\r' || c == '\t' || c == '\v');
|
||||
if (c == ' ' || c == '\f'
|
||||
||c == '\n' || c == '\r' || c == '\t' || c == '\v')
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int ft_atoi(const char *nptr)
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/09/26 14:46:33 by erey-bet #+# #+# */
|
||||
/* Updated: 2022/09/26 16:23:39 by erey-bet ### ########.fr */
|
||||
/* Updated: 2022/10/15 23:31:18 by erey-bet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <stddef.h>
|
||||
#include "libft.h"
|
||||
|
||||
void *ft_memset(void *ptr, int v, size_t count)
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/05 10:22:16 by erey-bet #+# #+# */
|
||||
/* Updated: 2022/10/10 22:49:10 by erey-bet ### ########.fr */
|
||||
/* Updated: 2022/10/17 13:50:20 by erey-bet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -18,7 +18,7 @@ void ft_putnbr_fd(int n, int fd)
|
|||
long nl;
|
||||
|
||||
nl = n;
|
||||
nl *= (n > 0) - (n < 0);
|
||||
nl *= ABS(nl);
|
||||
len = ft_get_size(nl);
|
||||
if (n < 0)
|
||||
ft_putchar_fd('-', fd);
|
||||
|
|
Loading…
Reference in a new issue