summaryrefslogtreecommitdiff
path: root/userland/libc/ctype
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-12-12 16:03:08 +0100
committerAnton Kling <anton@kling.gg>2024-12-12 16:03:08 +0100
commitb033314bf1901d436dc71d41d5e1f37dda47e511 (patch)
tree120bd137888a7f96904a47af7d20422608ffe225 /userland/libc/ctype
parentdcbcdbdc5bcfb86eca05fb655e3bf009d89e39e0 (diff)
formatting: Use clang-format on all projects
This commit also add braces to all `if` statements.
Diffstat (limited to 'userland/libc/ctype')
-rw-r--r--userland/libc/ctype/isalnum.c2
-rw-r--r--userland/libc/ctype/isalpha.c4
-rw-r--r--userland/libc/ctype/isascii.c4
-rw-r--r--userland/libc/ctype/isblank.c2
-rw-r--r--userland/libc/ctype/iscntrl.c5
-rw-r--r--userland/libc/ctype/isprint.c4
-rw-r--r--userland/libc/ctype/ispunct.c2
-rw-r--r--userland/libc/ctype/tolower.c3
-rw-r--r--userland/libc/ctype/toupper.c3
9 files changed, 18 insertions, 11 deletions
diff --git a/userland/libc/ctype/isalnum.c b/userland/libc/ctype/isalnum.c
index 870728d..073b8bb 100644
--- a/userland/libc/ctype/isalnum.c
+++ b/userland/libc/ctype/isalnum.c
@@ -2,5 +2,5 @@
// This is probably the most useless libc function I have seen so far.
int isalnum(int c) {
- return isalpha(c) || isdigit(c);
+ return isalpha(c) || isdigit(c);
}
diff --git a/userland/libc/ctype/isalpha.c b/userland/libc/ctype/isalpha.c
index 130f493..38c3cb4 100644
--- a/userland/libc/ctype/isalpha.c
+++ b/userland/libc/ctype/isalpha.c
@@ -1,4 +1,6 @@
#include <ctype.h>
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/isalpha.html
-int isalpha(int c) { return (('A' <= toupper(c)) && ('Z' >= toupper(c))); }
+int isalpha(int c) {
+ return (('A' <= toupper(c)) && ('Z' >= toupper(c)));
+}
diff --git a/userland/libc/ctype/isascii.c b/userland/libc/ctype/isascii.c
index 660c8bb..b598dde 100644
--- a/userland/libc/ctype/isascii.c
+++ b/userland/libc/ctype/isascii.c
@@ -1,4 +1,6 @@
#include <ctype.h>
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/isascii.html
-int isascii(int c) { return (c < 128); }
+int isascii(int c) {
+ return (c < 128);
+}
diff --git a/userland/libc/ctype/isblank.c b/userland/libc/ctype/isblank.c
index 488fa88..88ffa0b 100644
--- a/userland/libc/ctype/isblank.c
+++ b/userland/libc/ctype/isblank.c
@@ -1,5 +1,5 @@
#include <ctype.h>
int isblank(int c) {
- return (c == ' ' || c == '\t');
+ return (c == ' ' || c == '\t');
}
diff --git a/userland/libc/ctype/iscntrl.c b/userland/libc/ctype/iscntrl.c
index 92ed7f0..4fead0d 100644
--- a/userland/libc/ctype/iscntrl.c
+++ b/userland/libc/ctype/iscntrl.c
@@ -1,6 +1,5 @@
#include <ctype.h>
-int iscntrl(int c)
-{
- return (unsigned)c < 0x20 || c == 0x7f;
+int iscntrl(int c) {
+ return (unsigned)c < 0x20 || c == 0x7f;
}
diff --git a/userland/libc/ctype/isprint.c b/userland/libc/ctype/isprint.c
index e6a3d0e..5504ebc 100644
--- a/userland/libc/ctype/isprint.c
+++ b/userland/libc/ctype/isprint.c
@@ -1,3 +1,5 @@
#include <ctype.h>
-int isprint(int c) { return c > 0x20 && 0x7F != c; }
+int isprint(int c) {
+ return c > 0x20 && 0x7F != c;
+}
diff --git a/userland/libc/ctype/ispunct.c b/userland/libc/ctype/ispunct.c
index 18dc7d8..abef66d 100644
--- a/userland/libc/ctype/ispunct.c
+++ b/userland/libc/ctype/ispunct.c
@@ -2,5 +2,5 @@
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/ispunct.html
int ispunct(int c) {
- return (c == '.');
+ return (c == '.');
}
diff --git a/userland/libc/ctype/tolower.c b/userland/libc/ctype/tolower.c
index f1bb163..c14ea54 100644
--- a/userland/libc/ctype/tolower.c
+++ b/userland/libc/ctype/tolower.c
@@ -1,7 +1,8 @@
#include <ctype.h>
int tolower(int c) {
- if (c >= 'A' && c <= 'Z')
+ if (c >= 'A' && c <= 'Z') {
return c - 'A' + 'a';
+ }
return c;
}
diff --git a/userland/libc/ctype/toupper.c b/userland/libc/ctype/toupper.c
index 0f33886..599a0ff 100644
--- a/userland/libc/ctype/toupper.c
+++ b/userland/libc/ctype/toupper.c
@@ -1,7 +1,8 @@
#include <ctype.h>
int toupper(int c) {
- if (c >= 'a' && c <= 'z')
+ if (c >= 'a' && c <= 'z') {
return c - 'a' + 'A';
+ }
return c;
}