From 55365b5dc3fe086e5dc3f1b9b9ec5d0da2a4ca5e Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Thu, 7 Jul 2016 22:59:54 +0200 Subject: *: fixed includes this refactoring was done with the help of the 'include-what-you-use' program. if this breaks the build for you, please report! --- src/blogc-git-receiver.c | 7 +------ src/blogc-runserver.c | 6 +++--- src/blogc.c | 9 +++------ src/content-parser.c | 5 +---- src/content-parser.h | 2 +- src/debug.c | 5 ----- src/error.c | 5 ----- src/error.h | 3 +-- src/file.c | 6 ++---- src/file.h | 2 +- src/loader.c | 6 ++---- src/renderer.c | 8 ++------ src/source-parser.c | 6 +----- src/source-parser.h | 2 +- src/template-parser.c | 5 +---- src/template-parser.h | 1 + src/utf8.c | 3 ++- src/utf8.h | 3 ++- src/utils.c | 6 ------ src/utils.h | 2 -- 20 files changed, 25 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/blogc-git-receiver.c b/src/blogc-git-receiver.c index e717259..820fce5 100644 --- a/src/blogc-git-receiver.c +++ b/src/blogc-git-receiver.c @@ -6,12 +6,8 @@ * See the file LICENSE. */ -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - -#include #include +#include #include #include #include @@ -19,7 +15,6 @@ #include #include #include -#include #include #include diff --git a/src/blogc-runserver.c b/src/blogc-runserver.c index 81bd5f9..603946d 100644 --- a/src/blogc-runserver.c +++ b/src/blogc-runserver.c @@ -13,21 +13,21 @@ #include #include #include -#include #include #include -#include #include +#include #include #include #include -#include #include #include #include #include "utils.h" +struct evhttp_request; + /** * this mapping is used to declare "supported" file types, that are forced over diff --git a/src/blogc.c b/src/blogc.c index 20e1756..c90070d 100644 --- a/src/blogc.c +++ b/src/blogc.c @@ -14,18 +14,15 @@ #include #endif /* HAVE_SYS_STAT_H */ -#ifdef HAVE_SYS_TYPES_H -#include -#endif /* HAVE_SYS_TYPES_H */ - #include #include #include #include +#include +#include #include #include "debug.h" -#include "source-parser.h" #include "template-parser.h" #include "loader.h" #include "renderer.h" @@ -78,7 +75,7 @@ blogc_mkdir_recursive(const char *filename) for (char *tmp = fname; *tmp != '\0'; tmp++) { if (*tmp != '/' && *tmp != '\\') continue; -#if defined(HAVE_SYS_STAT_H) && defined(HAVE_SYS_TYPES_H) +#ifdef HAVE_SYS_STAT_H char bkp = *tmp; *tmp = '\0'; if ((strlen(fname) > 0) && diff --git a/src/content-parser.c b/src/content-parser.c index b4bc790..ca0597b 100644 --- a/src/content-parser.c +++ b/src/content-parser.c @@ -6,11 +6,8 @@ * See the file LICENSE. */ -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - #include +#include #include #include "content-parser.h" diff --git a/src/content-parser.h b/src/content-parser.h index 85bd063..37e38d7 100644 --- a/src/content-parser.h +++ b/src/content-parser.h @@ -9,7 +9,7 @@ #ifndef _CONTENT_PARSER_H #define _CONTENT_PARSER_H -#include +#include #include char* blogc_slugify(const char *str); diff --git a/src/debug.c b/src/debug.c index 7039608..9689028 100644 --- a/src/debug.c +++ b/src/debug.c @@ -6,15 +6,10 @@ * See the file LICENSE. */ -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - #include #include "template-parser.h" #include "utils.h" - #include "debug.h" diff --git a/src/error.c b/src/error.c index 0c297b9..c238f51 100644 --- a/src/error.c +++ b/src/error.c @@ -6,14 +6,9 @@ * See the file LICENSE. */ -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - #include #include #include -#include #include "error.h" #include "utils.h" diff --git a/src/error.h b/src/error.h index acaf49e..31fbaf2 100644 --- a/src/error.h +++ b/src/error.h @@ -9,8 +9,7 @@ #ifndef _ERROR_H #define _ERROR_H -#include -#include +#include typedef enum { BLOGC_ERROR_SOURCE_PARSER = 1, diff --git a/src/file.c b/src/file.c index 547f2f7..dc43056 100644 --- a/src/file.c +++ b/src/file.c @@ -6,12 +6,10 @@ * See the file LICENSE. */ -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - #include #include +#include +#include #include #include #include "file.h" diff --git a/src/file.h b/src/file.h index 97e5274..d2c4390 100644 --- a/src/file.h +++ b/src/file.h @@ -9,8 +9,8 @@ #ifndef _FILE_H #define _FILE_H +#include #include -#include #include "error.h" #define BLOGC_FILE_CHUNK_SIZE 1024 diff --git a/src/loader.c b/src/loader.c index 5ca0aac..bd3251e 100644 --- a/src/loader.c +++ b/src/loader.c @@ -6,13 +6,11 @@ * See the file LICENSE. */ -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - #include #include +#include #include +#include #include #include "file.h" #include "source-parser.h" diff --git a/src/renderer.c b/src/renderer.c index c9cc15b..27e92bd 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -6,18 +6,14 @@ * See the file LICENSE. */ -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - #include #include +#include #include +#include #include #include "datetime-parser.h" #include "error.h" -#include "loader.h" -#include "source-parser.h" #include "template-parser.h" #include "renderer.h" #include "utils.h" diff --git a/src/source-parser.c b/src/source-parser.c index f250bd3..5d29213 100644 --- a/src/source-parser.c +++ b/src/source-parser.c @@ -6,11 +6,7 @@ * See the file LICENSE. */ -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - -#include +#include #include #include "content-parser.h" diff --git a/src/source-parser.h b/src/source-parser.h index 5cadf95..0d54742 100644 --- a/src/source-parser.h +++ b/src/source-parser.h @@ -9,7 +9,7 @@ #ifndef _SOURCE_PARSER_H #define _SOURCE_PARSER_H -#include +#include #include "error.h" #include "utils.h" diff --git a/src/template-parser.c b/src/template-parser.c index 7e9a444..6ca6eb7 100644 --- a/src/template-parser.c +++ b/src/template-parser.c @@ -6,11 +6,8 @@ * See the file LICENSE. */ -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - #include +#include #include #include "template-parser.h" diff --git a/src/template-parser.h b/src/template-parser.h index fe2721e..19df6af 100644 --- a/src/template-parser.h +++ b/src/template-parser.h @@ -9,6 +9,7 @@ #ifndef _TEMPLATE_PARSER_H #define _TEMPLATE_PARSER_H +#include #include "error.h" #include "utils.h" diff --git a/src/utf8.c b/src/utf8.c index 0c04d60..a2f4fdd 100644 --- a/src/utf8.c +++ b/src/utf8.c @@ -26,7 +26,8 @@ // See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details. #include -#include +#include +#include #include "utils.h" #define UTF8_ACCEPT 0 diff --git a/src/utf8.h b/src/utf8.h index 582ae1c..06fe07e 100644 --- a/src/utf8.h +++ b/src/utf8.h @@ -9,8 +9,9 @@ #ifndef _UTF_8_H #define _UTF_8_H -#include #include +#include +#include #include "utils.h" bool blogc_utf8_validate(const uint8_t *str, size_t len); diff --git a/src/utils.c b/src/utils.c index 9a39c61..b42ae4e 100644 --- a/src/utils.c +++ b/src/utils.c @@ -6,17 +6,11 @@ * See the file LICENSE. */ -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - #define SB_STRING_CHUNK_SIZE 128 -#include #include #include #include -#include #include #include diff --git a/src/utils.h b/src/utils.h index aefcbf3..aca02c0 100644 --- a/src/utils.h +++ b/src/utils.h @@ -12,8 +12,6 @@ #include #include #include -#include -#include // memory -- cgit v1.2.3-18-g5258