diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-08-16 14:00:51 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-08-16 14:00:51 -0400 |
commit | 896e28812c51b9ffdf3efc00c7d7ef699e380a58 (patch) | |
tree | aaa25e093fb4a2ac4c57609e1f745e5ac0734ca8 /src/stdlib | |
parent | 0b0d1fe1d4fbf8560577d81e5af0549683eac8ba (diff) |
formatting
Diffstat (limited to 'src/stdlib')
-rw-r--r-- | src/stdlib/EXIT_FAILURE.c | 4 | ||||
-rw-r--r-- | src/stdlib/EXIT_SUCCESS.c | 4 | ||||
-rw-r--r-- | src/stdlib/MB_CUR_MAX.c | 4 | ||||
-rw-r--r-- | src/stdlib/NULL.ref | 1 | ||||
-rw-r--r-- | src/stdlib/RAND_MAX.c | 4 | ||||
-rw-r--r-- | src/stdlib/abort.c | 12 | ||||
-rw-r--r-- | src/stdlib/abs.c | 2 | ||||
-rw-r--r-- | src/stdlib/atexit.c | 2 | ||||
-rw-r--r-- | src/stdlib/calloc.c | 2 | ||||
-rw-r--r-- | src/stdlib/div_t.c | 6 | ||||
-rw-r--r-- | src/stdlib/getenv.c | 2 | ||||
-rw-r--r-- | src/stdlib/labs.c | 2 | ||||
-rw-r--r-- | src/stdlib/ldiv_t.c | 6 | ||||
-rw-r--r-- | src/stdlib/mblen.c | 1 | ||||
-rw-r--r-- | src/stdlib/rand.c | 1 | ||||
-rw-r--r-- | src/stdlib/size_t.ref | 1 | ||||
-rw-r--r-- | src/stdlib/srand.c | 1 | ||||
-rw-r--r-- | src/stdlib/strtod.c | 8 | ||||
-rw-r--r-- | src/stdlib/strtol.c | 6 | ||||
-rw-r--r-- | src/stdlib/strtoul.c | 6 | ||||
-rw-r--r-- | src/stdlib/wchar_t.ref | 1 |
21 files changed, 25 insertions, 51 deletions
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 <stdlib.h> +#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 <stdlib.h> +#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 <stdlib.h> +#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 <stdlib.h> 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 <stdlib.h> +#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 <stdlib.h> -#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 <signal.h> /** 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 <stdlib.h> -#include "limits.h" +#include <limits.h> /** 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 <errno.h> #include <stdlib.h> -#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 <stdlib.h> -#include "string.h" +#include <string.h> /** 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 <stdlib.h> - -/** 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 <stdlib.h> -#include "string.h" +#include <string.h> #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 <stdlib.h> -#include "limits.h" +#include <limits.h> /** 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 <stdlib.h> - -/** 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 <stdlib.h> /** 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 <stdlib.h> #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 <stdlib.h> 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 <stdlib.h> #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 <ctype.h> +#include <errno.h> +#include <float.h> +#include <math.h> #include <stdlib.h> -#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 <ctype.h> +#include <errno.h> +#include <limits.h> #include <stdlib.h> -#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 <errno.h> +#include <ctype.h> +#include <limits.h> #include <stdlib.h> -#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 <stdlib.h> REFERENCE(stddef/wchar_t.c) STDC(1) |