From 896e28812c51b9ffdf3efc00c7d7ef699e380a58 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sun, 16 Aug 2020 14:00:51 -0400 Subject: formatting --- src/stdlib/EXIT_FAILURE.c | 4 +--- src/stdlib/EXIT_SUCCESS.c | 4 +--- src/stdlib/MB_CUR_MAX.c | 4 +--- src/stdlib/NULL.ref | 1 - src/stdlib/RAND_MAX.c | 4 +--- src/stdlib/abort.c | 12 +----------- src/stdlib/abs.c | 2 +- src/stdlib/atexit.c | 2 +- src/stdlib/calloc.c | 2 +- src/stdlib/div_t.c | 6 ++---- src/stdlib/getenv.c | 2 +- src/stdlib/labs.c | 2 +- src/stdlib/ldiv_t.c | 6 ++---- src/stdlib/mblen.c | 1 + src/stdlib/rand.c | 1 - src/stdlib/size_t.ref | 1 - src/stdlib/srand.c | 1 - src/stdlib/strtod.c | 8 ++++---- src/stdlib/strtol.c | 6 +++--- src/stdlib/strtoul.c | 6 +++--- src/stdlib/wchar_t.ref | 1 - 21 files changed, 25 insertions(+), 51 deletions(-) (limited to 'src/stdlib') diff --git a/src/stdlib/EXIT_FAILURE.c b/src/stdlib/EXIT_FAILURE.c index 4558c660..14d28dc0 100644 --- a/src/stdlib/EXIT_FAILURE.c +++ b/src/stdlib/EXIT_FAILURE.c @@ -1,9 +1,7 @@ -#include +#define EXIT_FAILURE (1) /** unsuccessful program termination **/ -#define EXIT_FAILURE (1) - /*** is used as the ARGUMENT(status) argument to FUNCTION(exit) or FUNCTION(_Exit), or the return value from FUNCTION(main), to indicate that the program is diff --git a/src/stdlib/EXIT_SUCCESS.c b/src/stdlib/EXIT_SUCCESS.c index ce2ed9df..3b0bc2fa 100644 --- a/src/stdlib/EXIT_SUCCESS.c +++ b/src/stdlib/EXIT_SUCCESS.c @@ -1,9 +1,7 @@ -#include +#define EXIT_SUCCESS (0) /** successful program termination **/ -#define EXIT_SUCCESS (0) - /*** is used as the ARGUMENT(status) argument to FUNCTION(exit) or FUNCTION(_Exit), or the return value from FUNCTION(main), to indicate that the program is diff --git a/src/stdlib/MB_CUR_MAX.c b/src/stdlib/MB_CUR_MAX.c index 4961e343..1b833ba4 100644 --- a/src/stdlib/MB_CUR_MAX.c +++ b/src/stdlib/MB_CUR_MAX.c @@ -1,9 +1,7 @@ -#include +#define MB_CUR_MAX (4) /** current longest multibyte character **/ -#define MB_CUR_MAX (4) - /*** is the maximum number of bytes required to store any character in the current multibyte character set as specified by CONSTANT(LC_CTYPE). diff --git a/src/stdlib/NULL.ref b/src/stdlib/NULL.ref index 87e994d4..b247705b 100644 --- a/src/stdlib/NULL.ref +++ b/src/stdlib/NULL.ref @@ -1,3 +1,2 @@ -#include REFERENCE(stddef/NULL.c) STDC(1) diff --git a/src/stdlib/RAND_MAX.c b/src/stdlib/RAND_MAX.c index dbbdbde0..08b432e5 100644 --- a/src/stdlib/RAND_MAX.c +++ b/src/stdlib/RAND_MAX.c @@ -1,9 +1,7 @@ -#include +#define RAND_MAX (32767) /** random number range **/ -#define RAND_MAX (32767) - /*** is the maximum value returned by FUNCTION(rand). ***/ diff --git a/src/stdlib/abort.c b/src/stdlib/abort.c index bfd47317..f12f8276 100644 --- a/src/stdlib/abort.c +++ b/src/stdlib/abort.c @@ -1,15 +1,5 @@ #include -#ifdef _POSIX_SOURCE -#include "sys/types.h" -#endif -/* -#include "signal.h" -*/ - -#define __SIGNAL_H__ -#define SIGABRT -#include "ungol/signal.h" -extern void raise(int); +#include /** cause abnormal program termination **/ diff --git a/src/stdlib/abs.c b/src/stdlib/abs.c index 9bc6ca28..5cf59b4e 100644 --- a/src/stdlib/abs.c +++ b/src/stdlib/abs.c @@ -1,5 +1,5 @@ #include -#include "limits.h" +#include /** absolute value **/ diff --git a/src/stdlib/atexit.c b/src/stdlib/atexit.c index 37f0ef72..79b486d0 100644 --- a/src/stdlib/atexit.c +++ b/src/stdlib/atexit.c @@ -1,5 +1,5 @@ +#include #include -#include "errno.h" #include "_stdlib.h" /** register a function to run at program exit **/ diff --git a/src/stdlib/calloc.c b/src/stdlib/calloc.c index ec5fbfdb..76317054 100644 --- a/src/stdlib/calloc.c +++ b/src/stdlib/calloc.c @@ -1,5 +1,5 @@ #include -#include "string.h" +#include /** allocate and initialize memory **/ diff --git a/src/stdlib/div_t.c b/src/stdlib/div_t.c index 60acd660..7d17ddf2 100644 --- a/src/stdlib/div_t.c +++ b/src/stdlib/div_t.c @@ -1,12 +1,10 @@ -#include - -/** quotient and remainder **/ - typedef struct { int quot; int rem; } div_t; +/** quotient and remainder **/ + /*** is the type returned by FUNCTION(div) to hold both the quotient and remainder of an integer division. diff --git a/src/stdlib/getenv.c b/src/stdlib/getenv.c index 8cb99463..23b48d54 100644 --- a/src/stdlib/getenv.c +++ b/src/stdlib/getenv.c @@ -1,5 +1,5 @@ #include -#include "string.h" +#include #include "_stdlib.h" /** get an environment variable **/ diff --git a/src/stdlib/labs.c b/src/stdlib/labs.c index 298c2e64..5a53524a 100644 --- a/src/stdlib/labs.c +++ b/src/stdlib/labs.c @@ -1,5 +1,5 @@ #include -#include "limits.h" +#include /** absolute value **/ diff --git a/src/stdlib/ldiv_t.c b/src/stdlib/ldiv_t.c index 00161cf6..0dac2bb0 100644 --- a/src/stdlib/ldiv_t.c +++ b/src/stdlib/ldiv_t.c @@ -1,12 +1,10 @@ -#include - -/** long quotient and remainder **/ - typedef struct { long int quot; long int rem; } ldiv_t; +/** long quotient and remainder **/ + /*** is the type returned by FUNCTION(ldiv) to hold both the quotient and remainder of an integer division. diff --git a/src/stdlib/mblen.c b/src/stdlib/mblen.c index db7c4f1c..9a575e9c 100644 --- a/src/stdlib/mblen.c +++ b/src/stdlib/mblen.c @@ -1,6 +1,7 @@ #include /** count bytes in multibyte character **/ + int mblen(const char * s, size_t n) { /* FIXME: forward dependency on AMD1 */ diff --git a/src/stdlib/rand.c b/src/stdlib/rand.c index d8f3fcff..c00515da 100644 --- a/src/stdlib/rand.c +++ b/src/stdlib/rand.c @@ -1,4 +1,3 @@ -#include #include "_stdlib.h" /** get a pseudo-random number **/ diff --git a/src/stdlib/size_t.ref b/src/stdlib/size_t.ref index e525842a..fc611c25 100644 --- a/src/stdlib/size_t.ref +++ b/src/stdlib/size_t.ref @@ -1,3 +1,2 @@ -#include REFERENCE(stddef/size_t.c) STDC(1) diff --git a/src/stdlib/srand.c b/src/stdlib/srand.c index af61570b..42d5be95 100644 --- a/src/stdlib/srand.c +++ b/src/stdlib/srand.c @@ -1,4 +1,3 @@ -#include #include "_stdlib.h" /** seed the pseudo-random number generator **/ diff --git a/src/stdlib/strtod.c b/src/stdlib/strtod.c index 9a1af627..20907ef8 100644 --- a/src/stdlib/strtod.c +++ b/src/stdlib/strtod.c @@ -1,8 +1,8 @@ +#include +#include +#include +#include #include -#include "ctype.h" -#include "errno.h" -#include "float.h" -#include "math.h" #ifndef INFINITY #include "math/INFINITY.c" diff --git a/src/stdlib/strtol.c b/src/stdlib/strtol.c index 28d8f823..08ed591c 100644 --- a/src/stdlib/strtol.c +++ b/src/stdlib/strtol.c @@ -1,7 +1,7 @@ +#include +#include +#include #include -#include "ctype.h" -#include "limits.h" -#include "errno.h" /** convert string to long integer **/ diff --git a/src/stdlib/strtoul.c b/src/stdlib/strtoul.c index 8ef4eb34..7a91823f 100644 --- a/src/stdlib/strtoul.c +++ b/src/stdlib/strtoul.c @@ -1,7 +1,7 @@ +#include +#include +#include #include -#include "ctype.h" -#include "errno.h" -#include "limits.h" /** convert string to unsigned long integer **/ diff --git a/src/stdlib/wchar_t.ref b/src/stdlib/wchar_t.ref index d551680b..1e359832 100644 --- a/src/stdlib/wchar_t.ref +++ b/src/stdlib/wchar_t.ref @@ -1,3 +1,2 @@ -#include REFERENCE(stddef/wchar_t.c) STDC(1) -- cgit v1.2.1