summaryrefslogtreecommitdiffstats
path: root/libft
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-29 19:00:27 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-29 19:00:27 +0200
commit4e16203d49405cc0eb81d82693e8606e80d004fd (patch)
treef93958b7aa1add68c2e754b8445263a42b9471e9 /libft
parentSome updates (diff)
download42-minishell-4e16203d49405cc0eb81d82693e8606e80d004fd.tar.gz
42-minishell-4e16203d49405cc0eb81d82693e8606e80d004fd.tar.bz2
42-minishell-4e16203d49405cc0eb81d82693e8606e80d004fd.tar.xz
42-minishell-4e16203d49405cc0eb81d82693e8606e80d004fd.tar.zst
42-minishell-4e16203d49405cc0eb81d82693e8606e80d004fd.zip
Some norm
Diffstat (limited to 'libft')
-rw-r--r--libft/src/ft_dprintf.c6
-rw-r--r--libft/src/ft_intlen.c5
-rw-r--r--libft/src/ft_intlen_base.c5
-rw-r--r--libft/src/ft_isalnum.c7
-rw-r--r--libft/src/ft_isalpha.c17
-rw-r--r--libft/src/ft_isascii.c3
-rw-r--r--libft/src/ft_ischarset.c7
-rw-r--r--libft/src/ft_isdigit.c5
-rw-r--r--libft/src/ft_isprint.c5
-rw-r--r--libft/src/ft_isspace.c17
-rw-r--r--libft/src/ft_iswhitespace.c15
11 files changed, 48 insertions, 44 deletions
diff --git a/libft/src/ft_dprintf.c b/libft/src/ft_dprintf.c
index caa28dc..57a1344 100644
--- a/libft/src/ft_dprintf.c
+++ b/libft/src/ft_dprintf.c
@@ -16,8 +16,7 @@
#include <stdarg.h>
#include <unistd.h>
-static int
- ft_printf_return(int fd, t_printflist *pflist)
+static int ft_printf_return(int fd, t_printflist *pflist)
{
int ret;
@@ -28,8 +27,7 @@ static int
return (ret);
}
-int
- ft_dprintf(int fd, const char *format, ...)
+int ft_dprintf(int fd, const char *format, ...)
{
t_printflist *pflist;
va_list arg;
diff --git a/libft/src/ft_intlen.c b/libft/src/ft_intlen.c
index c122657..76d2e4f 100644
--- a/libft/src/ft_intlen.c
+++ b/libft/src/ft_intlen.c
@@ -12,13 +12,12 @@
#include <inttypes.h>
-uint8_t
- ft_intlen(long n)
+uint8_t ft_intlen(long n)
{
uint8_t len;
len = 0;
- if (!n)
+ if (n == 0)
return (1);
if (n < 0)
len = 1;
diff --git a/libft/src/ft_intlen_base.c b/libft/src/ft_intlen_base.c
index 47da31d..99c0ff2 100644
--- a/libft/src/ft_intlen_base.c
+++ b/libft/src/ft_intlen_base.c
@@ -13,15 +13,14 @@
#include <libft.h>
#include <inttypes.h>
-uint8_t
- ft_intlen_base(long n, char *base)
+uint8_t ft_intlen_base(long n, char *base)
{
uint8_t len;
uint8_t size;
size = ft_strlen(base);
len = 0;
- if (!n)
+ if (n == 0)
return (1);
if (n < 0)
len = 1;
diff --git a/libft/src/ft_isalnum.c b/libft/src/ft_isalnum.c
index fca042d..0820822 100644
--- a/libft/src/ft_isalnum.c
+++ b/libft/src/ft_isalnum.c
@@ -12,10 +12,11 @@
#include <libft.h>
-t_bool
- ft_isalnum(int c)
+t_bool ft_isalnum(int c)
{
- if (ft_isalpha(c) || ft_isdigit(c))
+ if (ft_isalpha(c) == TRUE || ft_isdigit(c) == TRUE)
+ {
return (TRUE);
+ }
return (FALSE);
}
diff --git a/libft/src/ft_isalpha.c b/libft/src/ft_isalpha.c
index 3b7a88f..68afb69 100644
--- a/libft/src/ft_isalpha.c
+++ b/libft/src/ft_isalpha.c
@@ -12,26 +12,29 @@
#include <libft.h>
-t_bool
- ft_isupper(int c)
+t_bool ft_isupper(int c)
{
if (c >= 65 && c <= 90)
+ {
return (TRUE);
+ }
return (FALSE);
}
-t_bool
- ft_islower(int c)
+t_bool ft_islower(int c)
{
if (c >= 97 && c <= 122)
+ {
return (TRUE);
+ }
return (FALSE);
}
-t_bool
- ft_isalpha(int c)
+t_bool ft_isalpha(int c)
{
- if (ft_isupper(c) || ft_islower(c))
+ if (ft_isupper(c) == TRUE || ft_islower(c) == TRUE)
+ {
return (TRUE);
+ }
return (FALSE);
}
diff --git a/libft/src/ft_isascii.c b/libft/src/ft_isascii.c
index 04e63c3..d799d52 100644
--- a/libft/src/ft_isascii.c
+++ b/libft/src/ft_isascii.c
@@ -12,8 +12,7 @@
#include <libft.h>
-t_bool
- ft_isascii(int c)
+t_bool ft_isascii(int c)
{
if (c >= 0 && c <= 127)
return (TRUE);
diff --git a/libft/src/ft_ischarset.c b/libft/src/ft_ischarset.c
index eb57d87..82d3445 100644
--- a/libft/src/ft_ischarset.c
+++ b/libft/src/ft_ischarset.c
@@ -14,16 +14,17 @@
#include <stddef.h>
#include <inttypes.h>
-t_bool
- ft_ischarset(const char *charset, int c)
+t_bool ft_ischarset(const char *charset, int c)
{
size_t i;
i = 0;
- while (charset[i])
+ while (charset[i] != '\0')
{
if (charset[i] == c)
+ {
return (TRUE);
+ }
i++;
}
return (FALSE);
diff --git a/libft/src/ft_isdigit.c b/libft/src/ft_isdigit.c
index 3c73f92..92c93e4 100644
--- a/libft/src/ft_isdigit.c
+++ b/libft/src/ft_isdigit.c
@@ -12,10 +12,11 @@
#include <libft.h>
-t_bool
- ft_isdigit(int c)
+t_bool ft_isdigit(int c)
{
if (c >= 48 && c <= 57)
+ {
return (TRUE);
+ }
return (FALSE);
}
diff --git a/libft/src/ft_isprint.c b/libft/src/ft_isprint.c
index f4d1b73..27e397e 100644
--- a/libft/src/ft_isprint.c
+++ b/libft/src/ft_isprint.c
@@ -12,10 +12,11 @@
#include <libft.h>
-t_bool
- ft_isprint(int c)
+t_bool ft_isprint(int c)
{
if (c >= 32 && c <= 126)
+ {
return (TRUE);
+ }
return (FALSE);
}
diff --git a/libft/src/ft_isspace.c b/libft/src/ft_isspace.c
index 8454c7c..2f2ad0e 100644
--- a/libft/src/ft_isspace.c
+++ b/libft/src/ft_isspace.c
@@ -12,15 +12,16 @@
#include <libft.h>
-t_bool
- ft_isspace(int c)
+t_bool ft_isspace(int c)
{
- if (c == '\t' ||
- c == '\n' ||
- c == '\v' ||
- c == '\f' ||
- c == '\r' ||
- c == ' ')
+ if (c == '\t'
+ || c == '\n'
+ || c == '\v'
+ || c == '\f'
+ || c == '\r'
+ || c == ' ')
+ {
return (TRUE);
+ }
return (FALSE);
}
diff --git a/libft/src/ft_iswhitespace.c b/libft/src/ft_iswhitespace.c
index 3bb5868..49e214b 100644
--- a/libft/src/ft_iswhitespace.c
+++ b/libft/src/ft_iswhitespace.c
@@ -12,14 +12,15 @@
#include <libft.h>
-t_bool
- ft_iswhitespace(int c)
+t_bool ft_iswhitespace(int c)
{
- if (c == '\t' ||
- c == '\v' ||
- c == '\f' ||
- c == '\r' ||
- c == ' ')
+ if (c == '\t'
+ || c == '\v'
+ || c == '\f'
+ || c == '\r'
+ || c == ' ')
+ {
return (TRUE);
+ }
return (FALSE);
}