Skip to content

Commit 3fdbd4b

Browse files
committed
update to the new norminette
1 parent 547b8a5 commit 3fdbd4b

31 files changed

+142
-132
lines changed

ft_atoi.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
/* ::: :::::::: */
44
/* ft_atoi.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/17 10:48:19 by abkssiba #+# #+# */
9-
/* Updated: 2019/10/29 16:19:26 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:03:43 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -23,10 +23,11 @@ int ft_atoi(const char *str)
2323
number = 0;
2424
sign = 1;
2525
while ((str[iss] == ' ' || (str[iss] >= '\t' && str[iss] <= '\r'))
26-
&& str[iss] != '\0')
26+
&& str[iss] != '\0')
2727
iss++;
2828
if (str[iss] == '-' || str[iss] == '+')
29-
(str[iss++] == '-') ? sign = -1 : 0;
29+
if (str[iss++] == '-')
30+
sign = -1;
3031
while (ft_isdigit(str[iss]))
3132
{
3233
value = number;

ft_bzero.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
/* ::: :::::::: */
44
/* ft_bzero.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/16 14:14:32 by abkssiba #+# #+# */
9-
/* Updated: 2019/10/22 20:15:42 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:15:23 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
void ft_bzero(void *s, size_t n)
1616
{
17-
unsigned char *str;
17+
unsigned char *str;
1818

19-
str = (unsigned char*)s;
19+
str = (unsigned char *)s;
2020
if (n == 0)
2121
return ;
2222
while (n > 0)

ft_calloc.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
/* ::: :::::::: */
44
/* ft_calloc.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/18 11:28:56 by abkssiba #+# #+# */
9-
/* Updated: 2019/10/22 20:16:05 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:15:33 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
void *ft_calloc(size_t count, size_t size)
1616
{
17-
void *s;
17+
void *s;
1818

1919
s = malloc(count * size);
2020
if (s)

ft_itoa.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
/* ::: :::::::: */
44
/* ft_itoa.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/21 18:28:08 by abkssiba #+# #+# */
9-
/* Updated: 2019/10/29 11:21:05 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:14:55 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

15-
static int ft_get_len(long int n)
15+
static int ft_get_len(long int n)
1616
{
17-
int len;
17+
int len;
1818

1919
len = 0;
2020
if (n < 0)
@@ -30,7 +30,7 @@ static int ft_get_len(long int n)
3030
return (len);
3131
}
3232

33-
static void ft_fill(char *str, long int n, int sign, int len)
33+
static void ft_fill(char *str, long int n, int sign, int len)
3434
{
3535
if (n < 0)
3636
{
@@ -46,7 +46,7 @@ static void ft_fill(char *str, long int n, int sign, int len)
4646
str[len] = '-';
4747
}
4848

49-
char *ft_itoa(int n)
49+
char *ft_itoa(int n)
5050
{
5151
int len;
5252
char *str;
@@ -58,7 +58,7 @@ char *ft_itoa(int n)
5858
last = len;
5959
if (n == 0)
6060
return (ft_strdup("0"));
61-
str = (char*)malloc(len + 1);
61+
str = (char *)malloc(len + 1);
6262
if (!str)
6363
return (NULL);
6464
ft_fill(str, n, sign, len);

ft_lstadd_back_bonus.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
/* ::: :::::::: */
44
/* ft_lstadd_back_bonus.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/22 13:01:36 by abkssiba #+# #+# */
9-
/* Updated: 2019/10/29 18:13:07 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:13:30 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
void ft_lstadd_back(t_list **alst, t_list *new)
1616
{
17-
t_list *lst;
17+
t_list *lst;
1818

1919
if (!alst || !new)
2020
return ;

ft_lstclear_bonus.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
/* ::: :::::::: */
44
/* ft_lstclear_bonus.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/22 13:01:50 by abkssiba #+# #+# */
9-
/* Updated: 2019/10/27 11:49:51 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:13:36 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
void ft_lstclear(t_list **lst, void (*del)(void*))
1616
{
17-
t_list *tmp;
17+
t_list *tmp;
1818

1919
if (!lst || !del)
2020
return ;

ft_lstiter_bonus.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
/* ::: :::::::: */
44
/* ft_lstiter_bonus.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/24 14:06:56 by abkssiba #+# #+# */
9-
/* Updated: 2019/10/29 18:15:35 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:13:42 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
void ft_lstiter(t_list *lst, void (*f)(void *))
1616
{
17-
t_list *tmp;
17+
t_list *tmp;
1818

1919
if (!lst || !f)
2020
return ;

ft_lstmap_bonus.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
/* ::: :::::::: */
44
/* ft_lstmap_bonus.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/24 14:06:38 by abkssiba #+# #+# */
9-
/* Updated: 2019/11/05 12:17:54 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:13:58 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

15-
t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *))
15+
t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *))
1616
{
17-
t_list *head;
18-
t_list *new;
17+
t_list *head;
18+
t_list *new;
1919

2020
if (!lst || !f || !del)
2121
return (NULL);

ft_lstnew_bonus.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
/* ::: :::::::: */
44
/* ft_lstnew_bonus.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/22 13:01:58 by abkssiba #+# #+# */
9-
/* Updated: 2019/10/29 17:57:08 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:13:15 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
t_list *ft_lstnew(void *content)
1616
{
17-
t_list *newlist;
17+
t_list *newlist;
1818

1919
newlist = ft_calloc(sizeof(newlist), 1);
2020
if (!newlist)

ft_lstsize_bonus.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
/* ::: :::::::: */
44
/* ft_lstsize_bonus.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/26 19:39:28 by abkssiba #+# #+# */
9-
/* Updated: 2019/10/27 11:32:14 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:13:04 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

15-
int ft_lstsize(t_list *lst)
15+
int ft_lstsize(t_list *lst)
1616
{
17-
int len;
17+
int len;
1818

1919
if (!lst)
2020
return (0);

ft_memccpy.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
/* ::: :::::::: */
44
/* ft_memccpy.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/18 12:48:23 by abkssiba #+# #+# */
9-
/* Updated: 2019/10/23 16:03:55 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:12:51 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -17,10 +17,10 @@ void *ft_memccpy(void *dst, const void *src, int c, size_t n)
1717
size_t i;
1818

1919
i = 0;
20-
while (i < n && *(unsigned char*)src)
20+
while (i < n && *(unsigned char *)src)
2121
{
22-
*(unsigned char*)(dst + i) = *(unsigned char*)(src + i);
23-
if (*(unsigned char*)(src + i) == (unsigned char)c)
22+
*(unsigned char *)(dst + i) = *(unsigned char *)(src + i);
23+
if (*(unsigned char *)(src + i) == (unsigned char)c)
2424
return (dst + i + 1);
2525
i++;
2626
}

ft_memchr.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
/* ::: :::::::: */
44
/* ft_memchr.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/18 20:22:29 by abkssiba #+# #+# */
9-
/* Updated: 2019/10/19 13:59:07 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:12:34 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
void *ft_memchr(const void *s, int c, size_t n)
1616
{
17-
unsigned char *str;
17+
unsigned char *str;
1818

19-
str = (unsigned char*)s;
19+
str = (unsigned char *)s;
2020
while (n--)
2121
{
2222
if (*str == (unsigned char)c)

ft_memcmp.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
/* ::: :::::::: */
44
/* ft_memcmp.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/19 11:21:54 by abkssiba #+# #+# */
9-
/* Updated: 2019/10/23 16:07:03 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:12:27 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

15-
int ft_memcmp(const void *s1, const void *s2, size_t n)
15+
int ft_memcmp(const void *s1, const void *s2, size_t n)
1616
{
17-
unsigned char *str1;
18-
unsigned char *str2;
17+
unsigned char *str1;
18+
unsigned char *str2;
1919

20-
str1 = (unsigned char*)s1;
21-
str2 = (unsigned char*)s2;
20+
str1 = (unsigned char *)s1;
21+
str2 = (unsigned char *)s2;
2222
while (n--)
2323
{
2424
if (*str1 != *str2)

ft_memcpy.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
/* ::: :::::::: */
44
/* ft_memcpy.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/16 15:16:42 by abkssiba #+# #+# */
9-
/* Updated: 2019/11/04 19:13:38 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:12:01 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
void *ft_memcpy(void *dst, const void *src, size_t n)
1616
{
17-
size_t i;
17+
size_t i;
1818

1919
i = 0;
2020
if (!dst && !src)
@@ -23,7 +23,7 @@ void *ft_memcpy(void *dst, const void *src, size_t n)
2323
return (dst);
2424
while (i < n)
2525
{
26-
*(unsigned char*)(dst + i) = *(unsigned char*)(src + i);
26+
*(unsigned char *)(dst + i) = *(unsigned char *)(src + i);
2727
i++;
2828
}
2929
return (dst);

ft_memmove.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
/* ::: :::::::: */
44
/* ft_memmove.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: abkssiba <marvin@42.fr> +#+ +:+ +#+ */
6+
/* By: abkssiba <abkssiba@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/10/19 16:17:43 by abkssiba #+# #+# */
9-
/* Updated: 2019/11/05 13:33:32 by abkssiba ### ########.fr */
9+
/* Updated: 2021/05/24 16:10:47 by abkssiba ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -18,7 +18,7 @@ void *ft_memmove(void *dst, const void *src, size_t len)
1818
{
1919
while (len--)
2020
{
21-
*(unsigned char*)(dst + len) = *(unsigned char*)(src + len);
21+
*(unsigned char *)(dst + len) = *(unsigned char *)(src + len);
2222
}
2323
return (dst);
2424
}

0 commit comments

Comments
 (0)