summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-10-27 20:27:21 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-10-27 20:27:21 +0100
commit2b741aba7ac9f3cd1488f86dd5e1fe11d579eb9a (patch)
tree55c5f819bcb1a6721cd597627d4acc1bcf7a8088
parentFew norm (diff)
download42-minishell-2b741aba7ac9f3cd1488f86dd5e1fe11d579eb9a.tar.gz
42-minishell-2b741aba7ac9f3cd1488f86dd5e1fe11d579eb9a.tar.bz2
42-minishell-2b741aba7ac9f3cd1488f86dd5e1fe11d579eb9a.tar.xz
42-minishell-2b741aba7ac9f3cd1488f86dd5e1fe11d579eb9a.tar.zst
42-minishell-2b741aba7ac9f3cd1488f86dd5e1fe11d579eb9a.zip
Norming libft
-rw-r--r--libft/src/ft_atoi.c8
-rw-r--r--libft/src/ft_intlen.c1
-rw-r--r--libft/src/ft_itoa.c4
-rw-r--r--libft/src/ft_itoa_base.c4
-rw-r--r--libft/src/ft_itoa_s.c2
-rw-r--r--libft/src/ft_printf_put_hex.c4
-rw-r--r--libft/src/ft_printf_put_int.c4
-rw-r--r--libft/src/ft_printf_treat_flags.c12
-rw-r--r--libft/src/ft_putnbr_base.c4
-rw-r--r--libft/src/ft_uintlen.c1
-rw-r--r--libft/src/ft_uitoa_base.c2
-rw-r--r--libft/src/ft_uitoa_s.c2
12 files changed, 25 insertions, 23 deletions
diff --git a/libft/src/ft_atoi.c b/libft/src/ft_atoi.c
index ea6189c..6154322 100644
--- a/libft/src/ft_atoi.c
+++ b/libft/src/ft_atoi.c
@@ -12,7 +12,7 @@
#include <libft.h>
-static char ft_setsign(const char c)
+static char ft_setsign(const char c)
{
char sign;
@@ -36,11 +36,11 @@ static unsigned char ft_seti(const char *str)
return (i);
}
-int ft_atoi(const char *str)
+int ft_atoi(const char *str)
{
+ long nb;
unsigned char i;
- char sign;
- long nb;
+ char sign;
i = ft_seti(str);
nb = 0;
diff --git a/libft/src/ft_intlen.c b/libft/src/ft_intlen.c
index a98f2a4..00943f6 100644
--- a/libft/src/ft_intlen.c
+++ b/libft/src/ft_intlen.c
@@ -10,7 +10,6 @@
/* */
/* ************************************************************************** */
-
unsigned char ft_intlen(long n)
{
unsigned char len;
diff --git a/libft/src/ft_itoa.c b/libft/src/ft_itoa.c
index a243719..e80792d 100644
--- a/libft/src/ft_itoa.c
+++ b/libft/src/ft_itoa.c
@@ -15,8 +15,8 @@
char *ft_itoa(long n)
{
- char *s;
- long nb;
+ char *s;
+ long nb;
unsigned char i;
i = ft_intlen(n) - 1;
diff --git a/libft/src/ft_itoa_base.c b/libft/src/ft_itoa_base.c
index 091b47c..5889240 100644
--- a/libft/src/ft_itoa_base.c
+++ b/libft/src/ft_itoa_base.c
@@ -15,8 +15,8 @@
char *ft_itoa_base(long n, char *base)
{
- char *s;
- long nb;
+ char *s;
+ long nb;
unsigned char i;
i = ft_intlen_base(n, base) - 1;
diff --git a/libft/src/ft_itoa_s.c b/libft/src/ft_itoa_s.c
index 98088e3..284a02f 100644
--- a/libft/src/ft_itoa_s.c
+++ b/libft/src/ft_itoa_s.c
@@ -14,7 +14,7 @@
void ft_itoa_s(char str[], long n)
{
- long nb;
+ long nb;
unsigned char i;
i = ft_intlen(n) - 1;
diff --git a/libft/src/ft_printf_put_hex.c b/libft/src/ft_printf_put_hex.c
index 6f7090c..a0a9b1f 100644
--- a/libft/src/ft_printf_put_hex.c
+++ b/libft/src/ft_printf_put_hex.c
@@ -15,7 +15,9 @@
#include <stdlib.h>
#include <stdarg.h>
-static unsigned long ft_printf_get_xlh(va_list arg, char lh, unsigned char zflag)
+static unsigned long ft_printf_get_xlh(va_list arg,
+ char lh,
+ unsigned char zflag)
{
if (zflag == 1)
return (va_arg(arg, size_t));
diff --git a/libft/src/ft_printf_put_int.c b/libft/src/ft_printf_put_int.c
index c40c669..5a3c550 100644
--- a/libft/src/ft_printf_put_int.c
+++ b/libft/src/ft_printf_put_int.c
@@ -30,7 +30,9 @@ static long ft_printf_get_dlh(va_list arg, char lh)
return (va_arg(arg, int));
}
-static unsigned long ft_printf_get_ulh(va_list arg, char lh, unsigned char zflag)
+static unsigned long ft_printf_get_ulh(va_list arg,
+ char lh,
+ unsigned char zflag)
{
if (zflag == 1)
return (va_arg(arg, size_t));
diff --git a/libft/src/ft_printf_treat_flags.c b/libft/src/ft_printf_treat_flags.c
index abebc0d..187f584 100644
--- a/libft/src/ft_printf_treat_flags.c
+++ b/libft/src/ft_printf_treat_flags.c
@@ -14,7 +14,7 @@
#include <stdlib.h>
#include <stdarg.h>
-static int ft_printf_get_width(va_list arg, t_printflist *pflist)
+static int ft_printf_get_width(va_list arg, t_printflist *pflist)
{
char *nstr;
char *nstr_ptr;
@@ -34,9 +34,9 @@ static int ft_printf_get_width(va_list arg, t_printflist *pflist)
return (ret);
}
-static int ft_printf_get_precision(va_list arg,
- int pos,
- t_printflist *pflist)
+static int ft_printf_get_precision(va_list arg,
+ int pos,
+ t_printflist *pflist)
{
int ret;
char *ptr;
@@ -70,7 +70,7 @@ static int ft_printf_get_precision(va_list arg,
** ll = 2
*/
-static void ft_printf_get_lh(t_printflist *pflist)
+static void ft_printf_get_lh(t_printflist *pflist)
{
int pos;
@@ -113,7 +113,7 @@ static unsigned char ft_printf_check_z(t_printflist *pflist)
** also l ll hh h
*/
-void ft_printf_treat_flags(va_list arg, t_printflist *pflist)
+void ft_printf_treat_flags(va_list arg, t_printflist *pflist)
{
int pos;
char c;
diff --git a/libft/src/ft_putnbr_base.c b/libft/src/ft_putnbr_base.c
index 86c0539..f8495f5 100644
--- a/libft/src/ft_putnbr_base.c
+++ b/libft/src/ft_putnbr_base.c
@@ -14,8 +14,8 @@
void ft_putnbr_base(long nb, char *base)
{
- long i;
- unsigned char size;
+ long i;
+ unsigned char size;
i = nb;
size = ft_strlen(base);
diff --git a/libft/src/ft_uintlen.c b/libft/src/ft_uintlen.c
index ef4651a..571c4d9 100644
--- a/libft/src/ft_uintlen.c
+++ b/libft/src/ft_uintlen.c
@@ -10,7 +10,6 @@
/* */
/* ************************************************************************** */
-
unsigned char ft_uintlen(unsigned long n)
{
unsigned char len;
diff --git a/libft/src/ft_uitoa_base.c b/libft/src/ft_uitoa_base.c
index 81f9f4c..f020717 100644
--- a/libft/src/ft_uitoa_base.c
+++ b/libft/src/ft_uitoa_base.c
@@ -17,7 +17,7 @@ char *ft_uitoa_base(unsigned long n, char *base)
{
char *s;
unsigned long nb;
- unsigned char i;
+ unsigned char i;
i = ft_uintlen_base(n, base) - 1;
if (!(s = (char*)malloc((i + 2) * sizeof(char))))
diff --git a/libft/src/ft_uitoa_s.c b/libft/src/ft_uitoa_s.c
index 3a840f5..c02a0dd 100644
--- a/libft/src/ft_uitoa_s.c
+++ b/libft/src/ft_uitoa_s.c
@@ -15,7 +15,7 @@
void ft_uitoa_s(char str[], unsigned long n)
{
unsigned long nb;
- unsigned char i;
+ unsigned char i;
i = ft_uintlen(n) - 1;
if (n == 0)