From 86da10ac94f64d16ad145200664fc8532fd90783 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 16 Dec 2020 11:02:14 +0100 Subject: Clean up includes --- src/sord.c | 26 ++++++++++++++++---------- src/sord_internal.h | 9 +++++---- src/sord_test.c | 7 +++++-- src/sord_validate.c | 18 ++++++++++-------- src/sordi.c | 14 ++++++++------ src/syntax.c | 11 +++++------ 6 files changed, 49 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/sord.c b/src/sord.c index 19e11cd..b870e1a 100644 --- a/src/sord.c +++ b/src/sord.c @@ -14,21 +14,27 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -// C99 -#include -#include -#include -#include -#include -#include +#include "sord_config.h" // IWYU pragma: keep +#include "sord_internal.h" + +#include "serd/serd.h" +#include "sord/sord.h" #define ZIX_INLINE +#include "zix/btree.c" +#include "zix/btree.h" +#include "zix/common.h" #include "zix/digest.c" #include "zix/hash.c" -#include "zix/btree.c" +#include "zix/hash.h" -#include "sord_config.h" -#include "sord_internal.h" +#include +#include +#include +#include +#include +#include +#include #ifdef __GNUC__ # define SORD_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) diff --git a/src/sord_internal.h b/src/sord_internal.h index ddfe9c6..872b1c1 100644 --- a/src/sord_internal.h +++ b/src/sord_internal.h @@ -17,15 +17,16 @@ #ifndef SORD_SORD_INTERNAL_H #define SORD_SORD_INTERNAL_H -#include -#include - +#include "serd/serd.h" #include "sord/sord.h" +#include + #if defined(__GNUC__) && __GNUC__ > 4 # define SORD_UNREACHABLE() __builtin_unreachable() #else -# define SORD_UNREACHABLE() assert(false) +# include +# define SORD_UNREACHABLE() assert(0) #endif /** Resource node metadata */ diff --git a/src/sord_test.c b/src/sord_test.c index 3553d4c..828acf8 100644 --- a/src/sord_test.c +++ b/src/sord_test.c @@ -14,14 +14,17 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "serd/serd.h" +#include "sord/sord.h" + #include #include +#include +#include #include #include #include -#include "sord/sord.h" - #ifdef __GNUC__ # define SORD_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) #else diff --git a/src/sord_validate.c b/src/sord_validate.c index 3defdec..193dc06 100644 --- a/src/sord_validate.c +++ b/src/sord_validate.c @@ -17,14 +17,6 @@ #define _BSD_SOURCE 1 // for realpath #define _DEFAULT_SOURCE 1 // for realpath -#include -#include -#include - -#ifdef _WIN32 -# include -#endif - #include "serd/serd.h" #include "sord/sord.h" #include "sord_config.h" @@ -32,6 +24,16 @@ #ifdef HAVE_PCRE # include #endif +#ifdef _WIN32 +# include +#endif + +#include +#include +#include +#include +#include +#include #ifdef __GNUC__ # define SORD_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) diff --git a/src/sordi.c b/src/sordi.c index 49d761b..cb28390 100644 --- a/src/sordi.c +++ b/src/sordi.c @@ -14,17 +14,19 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include -#include +#include "serd/serd.h" +#include "sord/sord.h" +#include "sord_config.h" #ifdef _WIN32 # include #endif -#include "serd/serd.h" -#include "sord/sord.h" -#include "sord_config.h" +#include +#include +#include +#include +#include #define SORDI_ERROR(msg) fprintf(stderr, "sordi: " msg); #define SORDI_ERRORF(fmt, ...) fprintf(stderr, "sordi: " fmt, __VA_ARGS__); diff --git a/src/syntax.c b/src/syntax.c index 10b25f9..1561c1d 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -14,14 +14,13 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include -#include - #include "serd/serd.h" +#include "sord/sord.h" -#include "sord_config.h" -#include "sord_internal.h" +#include +#include +#include +#include struct SordInserterImpl { SordModel* model; -- cgit v1.2.1