summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-01-31 17:15:10 -0500
committerJakob Kaivo <jkk@ung.org>2024-01-31 17:15:10 -0500
commitc3e4cda23b025d80a001a20758a907964a220361 (patch)
tree0587ca957483c6f3c6a1addf7e8aab321bfd572e
parent240d3bdd77d36b8295e2ba8a34c80bb1baafaf6e (diff)
clean up headers
-rw-r--r--src/ctype/_ctype.h3
-rw-r--r--src/ctype/isalnum.c2
-rw-r--r--src/ctype/isalpha.c2
-rw-r--r--src/ctype/isblank.c4
-rw-r--r--src/ctype/iscntrl.c2
-rw-r--r--src/ctype/isdigit.c2
-rw-r--r--src/ctype/isgraph.c2
-rw-r--r--src/ctype/islower.c2
-rw-r--r--src/ctype/isprint.c2
-rw-r--r--src/ctype/ispunct.c2
-rw-r--r--src/ctype/isspace.c2
-rw-r--r--src/ctype/isupper.c2
-rw-r--r--src/ctype/isxdigit.c2
-rw-r--r--src/ctype/tolower.c9
-rw-r--r--src/ctype/toupper.c9
15 files changed, 5 insertions, 42 deletions
diff --git a/src/ctype/_ctype.h b/src/ctype/_ctype.h
index d0771acc..dbb13ab1 100644
--- a/src/ctype/_ctype.h
+++ b/src/ctype/_ctype.h
@@ -1,6 +1,9 @@
#ifndef ___CTYPE_H__
#define ___CTYPE_H__
+#include <limits.h>
+#include <stdio.h>
+
#include "locale/_locale.h"
#include "_safety.h"
diff --git a/src/ctype/isalnum.c b/src/ctype/isalnum.c
index 81a1a0fa..2cd247be 100644
--- a/src/ctype/isalnum.c
+++ b/src/ctype/isalnum.c
@@ -1,6 +1,4 @@
#include <ctype.h>
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** test whether a character is alphanumeric **/
diff --git a/src/ctype/isalpha.c b/src/ctype/isalpha.c
index 658e5af9..670d7c51 100644
--- a/src/ctype/isalpha.c
+++ b/src/ctype/isalpha.c
@@ -1,6 +1,4 @@
#include <ctype.h>
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** test whether a character is alphabetic **/
diff --git a/src/ctype/isblank.c b/src/ctype/isblank.c
index b9f81f59..2f418760 100644
--- a/src/ctype/isblank.c
+++ b/src/ctype/isblank.c
@@ -1,7 +1,3 @@
-#include <ctype.h>
-#include <limits.h>
-#include <locale.h>
-#include <stdio.h>
#include "_ctype.h"
/** test whether a character is blank **/
diff --git a/src/ctype/iscntrl.c b/src/ctype/iscntrl.c
index a345686e..be619f83 100644
--- a/src/ctype/iscntrl.c
+++ b/src/ctype/iscntrl.c
@@ -1,5 +1,3 @@
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** test whether a character is a control character */
diff --git a/src/ctype/isdigit.c b/src/ctype/isdigit.c
index b1e7871f..23413d35 100644
--- a/src/ctype/isdigit.c
+++ b/src/ctype/isdigit.c
@@ -1,6 +1,4 @@
#include <ctype.h>
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** test whether a character is a digit **/
diff --git a/src/ctype/isgraph.c b/src/ctype/isgraph.c
index 30343a45..365b795f 100644
--- a/src/ctype/isgraph.c
+++ b/src/ctype/isgraph.c
@@ -1,5 +1,3 @@
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** test whether a character is graphic **/
diff --git a/src/ctype/islower.c b/src/ctype/islower.c
index cbc698de..5481acee 100644
--- a/src/ctype/islower.c
+++ b/src/ctype/islower.c
@@ -1,5 +1,3 @@
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** test whether a character is a lowercase letter **/
diff --git a/src/ctype/isprint.c b/src/ctype/isprint.c
index e1452365..8909a722 100644
--- a/src/ctype/isprint.c
+++ b/src/ctype/isprint.c
@@ -1,5 +1,3 @@
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** test whether a character is printable **/
diff --git a/src/ctype/ispunct.c b/src/ctype/ispunct.c
index 09e24372..50ab7fef 100644
--- a/src/ctype/ispunct.c
+++ b/src/ctype/ispunct.c
@@ -1,5 +1,3 @@
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** test whether a character is punctuation **/
diff --git a/src/ctype/isspace.c b/src/ctype/isspace.c
index b3c30b8e..2cff50c9 100644
--- a/src/ctype/isspace.c
+++ b/src/ctype/isspace.c
@@ -1,5 +1,3 @@
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** test whether a character is white-space **/
diff --git a/src/ctype/isupper.c b/src/ctype/isupper.c
index c8b7ac19..039e5f72 100644
--- a/src/ctype/isupper.c
+++ b/src/ctype/isupper.c
@@ -1,5 +1,3 @@
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** test whether a character is an uppercase letter **/
diff --git a/src/ctype/isxdigit.c b/src/ctype/isxdigit.c
index 3147d2d3..5207bda7 100644
--- a/src/ctype/isxdigit.c
+++ b/src/ctype/isxdigit.c
@@ -1,5 +1,3 @@
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** test whether a character is a hexadecimal digit **/
diff --git a/src/ctype/tolower.c b/src/ctype/tolower.c
index cec51f62..0cbdb9d4 100644
--- a/src/ctype/tolower.c
+++ b/src/ctype/tolower.c
@@ -1,6 +1,3 @@
-#include <stdio.h>
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** convert an uppercase letter to lowercase **/
@@ -12,11 +9,7 @@ int tolower(int c)
SIGNAL_SAFE(0);
ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF);
- if (c == EOF) {
- return EOF;
- }
-
- return map[c];
+ return c == EOF ? EOF : map[c];
}
__check_1(int, 0, tolower, int)
diff --git a/src/ctype/toupper.c b/src/ctype/toupper.c
index 009fe23a..43cd52fd 100644
--- a/src/ctype/toupper.c
+++ b/src/ctype/toupper.c
@@ -1,6 +1,3 @@
-#include <stdio.h>
-#include <limits.h>
-#include <stdio.h>
#include "_ctype.h"
/** convert a lowercase letter to uppercase **/
@@ -12,11 +9,7 @@ int toupper(int c)
SIGNAL_SAFE(0);
ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF);
- if (c == EOF) {
- return EOF;
- }
-
- return map[c];
+ return c == EOF ? EOF : map[c];
}
__check_1(int, 0, toupper, int)