From 9f87d9e27e74d9e06e0c93114ffd70a45ee152fa Mon Sep 17 00:00:00 2001 From: Martin Baute Date: Wed, 16 Mar 2016 06:21:15 +0100 Subject: [PATCH] Removed the header include guard 'optimization'. --- functions/_PDCLIB/assert.c | 3 --- functions/_PDCLIB/atomax.c | 1 - functions/_PDCLIB/digits.c | 3 --- functions/_PDCLIB/errno.c | 1 - functions/_PDCLIB/prepread.c | 1 - functions/_PDCLIB/strtox_main.c | 1 - functions/stdio/fgets.c | 1 - functions/stdio/gets.c | 1 - functions/stdlib/free.c | 3 --- functions/stdlib/malloc.c | 3 --- includes/assert.h | 7 ------- includes/ctype.h | 3 --- includes/errno.h | 3 --- includes/limits.h | 3 --- includes/locale.h | 3 --- includes/stdarg.h | 3 --- includes/stddef.h | 8 -------- includes/stdint.h | 3 --- includes/stdio.h | 3 --- includes/stdlib.h | 3 --- includes/string.h | 3 --- internals/_PDCLIB_aux.h | 4 ++++ internals/_PDCLIB_glue.h | 7 ++++--- internals/_PDCLIB_int.h | 11 ++++------- platform/example/functions/_PDCLIB/allocpages.c | 3 --- platform/example/functions/_PDCLIB/seek.c | 3 --- platform/example/includes/float.h | 3 --- platform/example/includes/signal.h | 3 --- platform/example/internals/_PDCLIB_config.h | 4 ++++ platform/example_64/internals/_PDCLIB_config.h | 5 +++++ .../example_cygwin/functions/_PDCLIB/allocpages.c | 3 --- platform/example_cygwin/functions/_PDCLIB/seek.c | 3 --- platform/example_cygwin/includes/float.h | 3 --- platform/example_cygwin/includes/signal.h | 3 --- platform/example_cygwin/internals/_PDCLIB_config.h | 5 +++++ 35 files changed, 26 insertions(+), 94 deletions(-) diff --git a/functions/_PDCLIB/assert.c b/functions/_PDCLIB/assert.c index fbee634..fb3d24b 100644 --- a/functions/_PDCLIB/assert.c +++ b/functions/_PDCLIB/assert.c @@ -12,10 +12,7 @@ #ifndef REGTEST -#ifndef _PDCLIB_AUX_H -#define _PDCLIB_AUX_H _PDCLIB_AUX_H #include <_PDCLIB_aux.h> -#endif #if _PDCLIB_C_VERSION == 99 void _PDCLIB_assert( char const * const message1, char const * const function, char const * const message2 ) diff --git a/functions/_PDCLIB/atomax.c b/functions/_PDCLIB/atomax.c index 9a70218..45095e7 100644 --- a/functions/_PDCLIB/atomax.c +++ b/functions/_PDCLIB/atomax.c @@ -6,7 +6,6 @@ Permission is granted to use, modify, and / or redistribute at will. */ -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> #include #include diff --git a/functions/_PDCLIB/digits.c b/functions/_PDCLIB/digits.c index 940e962..ad41e5d 100644 --- a/functions/_PDCLIB/digits.c +++ b/functions/_PDCLIB/digits.c @@ -6,10 +6,7 @@ Permission is granted to use, modify, and / or redistribute at will. */ -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif char _PDCLIB_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; diff --git a/functions/_PDCLIB/errno.c b/functions/_PDCLIB/errno.c index 5ae0ca4..7a69080 100644 --- a/functions/_PDCLIB/errno.c +++ b/functions/_PDCLIB/errno.c @@ -6,7 +6,6 @@ Permission is granted to use, modify, and / or redistribute at will. */ -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> #ifndef REGTEST diff --git a/functions/_PDCLIB/prepread.c b/functions/_PDCLIB/prepread.c index 9111ff4..d2288c7 100644 --- a/functions/_PDCLIB/prepread.c +++ b/functions/_PDCLIB/prepread.c @@ -8,7 +8,6 @@ #include -#define _PDCLIB_GLUE_H _PDCLIB_GLUE_H #include <_PDCLIB_glue.h> int _PDCLIB_prepread( struct _PDCLIB_file_t * stream ) diff --git a/functions/_PDCLIB/strtox_main.c b/functions/_PDCLIB/strtox_main.c index b19a1e7..1556ec4 100644 --- a/functions/_PDCLIB/strtox_main.c +++ b/functions/_PDCLIB/strtox_main.c @@ -6,7 +6,6 @@ Permission is granted to use, modify, and / or redistribute at will. */ -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> #include #include diff --git a/functions/stdio/fgets.c b/functions/stdio/fgets.c index 7d5801b..44518a3 100644 --- a/functions/stdio/fgets.c +++ b/functions/stdio/fgets.c @@ -10,7 +10,6 @@ #ifndef REGTEST -#define _PDCLIB_GLUE_H _PDCLIB_GLUE_H #include <_PDCLIB_glue.h> char * fgets( char * _PDCLIB_restrict s, int size, struct _PDCLIB_file_t * _PDCLIB_restrict stream ) diff --git a/functions/stdio/gets.c b/functions/stdio/gets.c index ac93e97..e59602e 100644 --- a/functions/stdio/gets.c +++ b/functions/stdio/gets.c @@ -10,7 +10,6 @@ #ifndef REGTEST -#define _PDCLIB_GLUE_H _PDCLIB_GLUE_H #include <_PDCLIB_glue.h> char * gets( char * s ) diff --git a/functions/stdlib/free.c b/functions/stdlib/free.c index 4370487..86044c0 100644 --- a/functions/stdlib/free.c +++ b/functions/stdlib/free.c @@ -10,10 +10,7 @@ #ifndef REGTEST -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif /* TODO: Primitive placeholder. Much room for improvement. */ diff --git a/functions/stdlib/malloc.c b/functions/stdlib/malloc.c index 05fd82e..0b0d6e3 100644 --- a/functions/stdlib/malloc.c +++ b/functions/stdlib/malloc.c @@ -12,10 +12,7 @@ #ifndef REGTEST -#ifndef _PDCLIB_GLUE_H -#define _PDCLIB_GLUE_H _PDLIB_GLUE_H #include <_PDCLIB_glue.h> -#endif /* TODO: Primitive placeholder. Much room for improvement. */ diff --git a/includes/assert.h b/includes/assert.h index fb6dbf1..2b4b20f 100644 --- a/includes/assert.h +++ b/includes/assert.h @@ -6,15 +6,8 @@ Permission is granted to use, modify, and / or redistribute at will. */ -#ifndef _PDCLIB_AUX_H -#define _PDCLIB_AUX_H _PDCLIB_AUX_H #include <_PDCLIB_aux.h> -#endif - -#ifndef _PDCLIB_CONFIG_H -#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H #include <_PDCLIB_config.h> -#endif #ifndef _PDCLIB_ASSERT_H #define _PDCLIB_ASSERT_H _PDCLIB_ASSERT_H diff --git a/includes/ctype.h b/includes/ctype.h index ae95146..c82c26d 100644 --- a/includes/ctype.h +++ b/includes/ctype.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_CTYPE_H #define _PDCLIB_CTYPE_H _PDCLIB_CTYPE_H -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif /* Character classification functions */ diff --git a/includes/errno.h b/includes/errno.h index 90c61db..fb813ee 100644 --- a/includes/errno.h +++ b/includes/errno.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_ERRNO_H #define _PDCLIB_ERRNO_H _PDCLIB_ERRNO_H -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif #define errno (*_PDCLIB_errno_func()) diff --git a/includes/limits.h b/includes/limits.h index 5eeaf10..7aa7c42 100644 --- a/includes/limits.h +++ b/includes/limits.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_LIMITS_H #define _PDCLIB_LIMITS_H _PDCLIB_LIMITS_H -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif /* TODO: Defined to 1 as multibyte characters are not supported yet. */ #define MB_LEN_MAX 1 diff --git a/includes/locale.h b/includes/locale.h index 82fc21b..474ee05 100644 --- a/includes/locale.h +++ b/includes/locale.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_LOCALE_H #define _PDCLIB_LOCALE_H _PDCLIB_LOCALE_H -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif #ifndef _PDCLIB_NULL_DEFINED #define _PDCLIB_NULL_DEFINED _PDCLIB_NULL_DEFINED diff --git a/includes/stdarg.h b/includes/stdarg.h index e75cd55..2ffc446 100644 --- a/includes/stdarg.h +++ b/includes/stdarg.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_STDARG_H #define _PDCLIB_STDARG_H _PDCLIB_STDARG_H -#ifndef _PDCLIB_CONFIG_H -#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H #include <_PDCLIB_config.h> -#endif typedef _PDCLIB_va_list va_list; diff --git a/includes/stddef.h b/includes/stddef.h index 8968577..44b9822 100644 --- a/includes/stddef.h +++ b/includes/stddef.h @@ -9,15 +9,7 @@ #ifndef _PDCLIB_STDDEF_H #define _PDCLIB_STDDEF_H _PDCLIB_STDDEF_H -#ifndef _PDCLIB_CONFIG_H -#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H -#include <_PDCLIB_config.h> -#endif - -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif typedef _PDCLIB_ptrdiff_t ptrdiff_t; diff --git a/includes/stdint.h b/includes/stdint.h index a5dfc5c..417791e 100644 --- a/includes/stdint.h +++ b/includes/stdint.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_STDINT_H #define _PDCLIB_STDINT_H _PDCLIB_STDINT_H -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif /* 7.18.1.1 Exact-width integer types. */ diff --git a/includes/stdio.h b/includes/stdio.h index a2428a5..560b4f2 100644 --- a/includes/stdio.h +++ b/includes/stdio.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_STDIO_H #define _PDCLIB_STDIO_H _PDCLIB_STDIO_H -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif #ifndef _PDCLIB_SIZE_T_DEFINED #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED diff --git a/includes/stdlib.h b/includes/stdlib.h index b035c9c..1c8a936 100644 --- a/includes/stdlib.h +++ b/includes/stdlib.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_STDLIB_H #define _PDCLIB_STDLIB_H _PDCLIB_STDLIB_H -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif #ifndef _PDCLIB_SIZE_T_DEFINED #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED diff --git a/includes/string.h b/includes/string.h index c5f74b5..495e605 100644 --- a/includes/string.h +++ b/includes/string.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_STRING_H #define _PDCLIB_STRING_H _PDCLIB_STRING_H -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif #ifndef _PDCLIB_SIZE_T_DEFINED #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED diff --git a/internals/_PDCLIB_aux.h b/internals/_PDCLIB_aux.h index 15c5db6..caa67cf 100644 --- a/internals/_PDCLIB_aux.h +++ b/internals/_PDCLIB_aux.h @@ -6,6 +6,9 @@ Permission is granted to use, modify, and / or redistribute at will. */ +#ifndef _PDCLIB_AUX_H +#define _PDCLIB_AUX_H _PDCLIB_AUX_H + /* -------------------------------------------------------------------------- */ /* You should not have to edit anything in this file; if you DO have to, it */ /* would be considered a bug / missing feature: notify the author(s). */ @@ -63,3 +66,4 @@ #define _PDCLIB_symbol2value( x ) #x #define _PDCLIB_symbol2string( x ) _PDCLIB_symbol2value( x ) +#endif diff --git a/internals/_PDCLIB_glue.h b/internals/_PDCLIB_glue.h index 3c5872b..30532c9 100644 --- a/internals/_PDCLIB_glue.h +++ b/internals/_PDCLIB_glue.h @@ -6,10 +6,10 @@ Permission is granted to use, modify, and / or redistribute at will. */ -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H +#ifndef _PDCLIB_GLUE_H +#define _PDCLIB_GLUE_H _PDCLIB_GLUE_H + #include <_PDCLIB_int.h> -#endif /* -------------------------------------------------------------------------- */ /* OS "glue", part 2 */ @@ -75,3 +75,4 @@ int _PDCLIB_remove( const char * filename ); */ int _PDCLIB_rename( const char * old, const char * new ); +#endif diff --git a/internals/_PDCLIB_int.h b/internals/_PDCLIB_int.h index a46c2dc..fc2b75b 100644 --- a/internals/_PDCLIB_int.h +++ b/internals/_PDCLIB_int.h @@ -6,20 +6,16 @@ Permission is granted to use, modify, and / or redistribute at will. */ +#ifndef _PDCLIB_INT_H +#define _PDCLIB_INT_H _PDCLIB_INT_H + /* -------------------------------------------------------------------------- */ /* You should not have to edit anything in this file; if you DO have to, it */ /* would be considered a bug / missing feature: notify the author(s). */ /* -------------------------------------------------------------------------- */ -#ifndef _PDCLIB_CONFIG_H -#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H #include <_PDCLIB_config.h> -#endif - -#ifndef _PDCLIB_AUX_H -#define _PDCLIB_AUX_H _PDCLIB_AUX_H #include <_PDCLIB_aux.h> -#endif /* null pointer constant */ #define _PDCLIB_NULL 0 @@ -442,3 +438,4 @@ struct _PDCLIB_ctype_t unsigned char collation; }; +#endif diff --git a/platform/example/functions/_PDCLIB/allocpages.c b/platform/example/functions/_PDCLIB/allocpages.c index 435e8c6..1463895 100644 --- a/platform/example/functions/_PDCLIB/allocpages.c +++ b/platform/example/functions/_PDCLIB/allocpages.c @@ -16,10 +16,7 @@ int brk( void * ); void * sbrk( intptr_t ); -#ifndef _PDCLIB_GLUE_H -#define _PDCLIB_GLUE_H _PDCLIB_GLUE_H #include <_PDCLIB_glue.h> -#endif static void * membreak = NULL; diff --git a/platform/example/functions/_PDCLIB/seek.c b/platform/example/functions/_PDCLIB/seek.c index 755abe2..6944f78 100644 --- a/platform/example/functions/_PDCLIB/seek.c +++ b/platform/example/functions/_PDCLIB/seek.c @@ -8,10 +8,7 @@ #include -#ifndef _PDCLIB_GLUE_H -#define _PDCLIB_GLUE_H #include <_PDCLIB_glue.h> -#endif #include "/usr/include/errno.h" diff --git a/platform/example/includes/float.h b/platform/example/includes/float.h index de47aeb..d10a730 100644 --- a/platform/example/includes/float.h +++ b/platform/example/includes/float.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_FLOAT_H #define _PDCLIB_FLOAT_H _PDCLIB_FLOAT_H -#ifndef _PDCLIB_CONFIG_H -#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H #include <_PDCLIB_config.h> -#endif #define FLT_ROUNDS _PDCLIB_FLT_ROUNDS #define FLT_EVAL_METHOD _PDCLIB_FLT_EVAL_METHOD diff --git a/platform/example/includes/signal.h b/platform/example/includes/signal.h index 9b812c9..5b9bef1 100644 --- a/platform/example/includes/signal.h +++ b/platform/example/includes/signal.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_SIGNAL_H #define _PDCLIB_SIGNAL_H _PDCLIB_SIGNAL_H -#ifndef _PDCLIB_CONFIG_H -#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H #include <_PDCLIB_config.h> -#endif /* Signals ------------------------------------------------------------------ */ diff --git a/platform/example/internals/_PDCLIB_config.h b/platform/example/internals/_PDCLIB_config.h index 64cc98d..233a88c 100644 --- a/platform/example/internals/_PDCLIB_config.h +++ b/platform/example/internals/_PDCLIB_config.h @@ -7,6 +7,9 @@ Permission is granted to use, modify, and / or redistribute at will. */ +#ifndef _PDCLIB_CONFIG_H +#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H + /* -------------------------------------------------------------------------- */ /* Misc */ /* -------------------------------------------------------------------------- */ @@ -354,3 +357,4 @@ typedef int _PDCLIB_fd_t; */ #define _PDCLIB_ERROR 4 +#endif diff --git a/platform/example_64/internals/_PDCLIB_config.h b/platform/example_64/internals/_PDCLIB_config.h index c50281a..92c2cd2 100644 --- a/platform/example_64/internals/_PDCLIB_config.h +++ b/platform/example_64/internals/_PDCLIB_config.h @@ -7,6 +7,9 @@ Permission is granted to use, modify, and / or redistribute at will. */ +#ifndef _PDCLIB_CONFIG_H +#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H + /* -------------------------------------------------------------------------- */ /* Misc */ /* -------------------------------------------------------------------------- */ @@ -278,3 +281,5 @@ typedef int _PDCLIB_fd_t; this capability dependent on implementation-defined behaviour (not good). */ #define _PDCLIB_UNGETCBUFSIZE 1 + +#endif diff --git a/platform/example_cygwin/functions/_PDCLIB/allocpages.c b/platform/example_cygwin/functions/_PDCLIB/allocpages.c index 5998c40..9ddca17 100644 --- a/platform/example_cygwin/functions/_PDCLIB/allocpages.c +++ b/platform/example_cygwin/functions/_PDCLIB/allocpages.c @@ -15,10 +15,7 @@ void * sbrk( intptr_t ); -#ifndef _PDCLIB_GLUE_H -#define _PDCLIB_GLUE_H _PDCLIB_GLUE_H #include <_PDCLIB_glue.h> -#endif static void * membreak = NULL; diff --git a/platform/example_cygwin/functions/_PDCLIB/seek.c b/platform/example_cygwin/functions/_PDCLIB/seek.c index 449a62a..ace9439 100644 --- a/platform/example_cygwin/functions/_PDCLIB/seek.c +++ b/platform/example_cygwin/functions/_PDCLIB/seek.c @@ -8,10 +8,7 @@ #include -#ifndef _PDCLIB_GLUE_H -#define _PDCLIB_GLUE_H #include <_PDCLIB_glue.h> -#endif #include "/usr/include/errno.h" diff --git a/platform/example_cygwin/includes/float.h b/platform/example_cygwin/includes/float.h index de47aeb..d10a730 100644 --- a/platform/example_cygwin/includes/float.h +++ b/platform/example_cygwin/includes/float.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_FLOAT_H #define _PDCLIB_FLOAT_H _PDCLIB_FLOAT_H -#ifndef _PDCLIB_CONFIG_H -#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H #include <_PDCLIB_config.h> -#endif #define FLT_ROUNDS _PDCLIB_FLT_ROUNDS #define FLT_EVAL_METHOD _PDCLIB_FLT_EVAL_METHOD diff --git a/platform/example_cygwin/includes/signal.h b/platform/example_cygwin/includes/signal.h index 9b812c9..5b9bef1 100644 --- a/platform/example_cygwin/includes/signal.h +++ b/platform/example_cygwin/includes/signal.h @@ -9,10 +9,7 @@ #ifndef _PDCLIB_SIGNAL_H #define _PDCLIB_SIGNAL_H _PDCLIB_SIGNAL_H -#ifndef _PDCLIB_CONFIG_H -#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H #include <_PDCLIB_config.h> -#endif /* Signals ------------------------------------------------------------------ */ diff --git a/platform/example_cygwin/internals/_PDCLIB_config.h b/platform/example_cygwin/internals/_PDCLIB_config.h index 2fd09e9..43e227d 100644 --- a/platform/example_cygwin/internals/_PDCLIB_config.h +++ b/platform/example_cygwin/internals/_PDCLIB_config.h @@ -7,6 +7,9 @@ Permission is granted to use, modify, and / or redistribute at will. */ +#ifndef _PDCLIB_CONFIG_H +#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H + /* -------------------------------------------------------------------------- */ /* Misc */ /* -------------------------------------------------------------------------- */ @@ -287,3 +290,5 @@ typedef int _PDCLIB_fd_t; #define _PDCLIB_UNGETCBUFSIZE 1 typedef long wint_t; + +#endif -- 2.40.0