summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy1
-rw-r--r--.clant.json4
-rw-r--r--.includes.imp3
-rw-r--r--sord/sord.h5
-rw-r--r--sord/sordmm.hpp18
-rw-r--r--src/sord.c26
-rw-r--r--src/sord_internal.h9
-rw-r--r--src/sord_test.c7
-rw-r--r--src/sord_validate.c18
-rw-r--r--src/sordi.c14
-rw-r--r--src/syntax.c11
11 files changed, 68 insertions, 48 deletions
diff --git a/.clang-tidy b/.clang-tidy
index f95d6a3..8338fa2 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -42,7 +42,6 @@ Checks: >
-hicpp-signed-bitwise,
-hicpp-special-member-functions,
-llvm-header-guard,
- -llvm-include-order,
-llvmlibc-*,
-misc-no-recursion,
-misc-unused-parameters,
diff --git a/.clant.json b/.clant.json
new file mode 100644
index 0000000..76cae6d
--- /dev/null
+++ b/.clant.json
@@ -0,0 +1,4 @@
+{
+ "version": "1.0.0",
+ "mapping_files": [".includes.imp"]
+}
diff --git a/.includes.imp b/.includes.imp
new file mode 100644
index 0000000..84b621b
--- /dev/null
+++ b/.includes.imp
@@ -0,0 +1,3 @@
+[
+ { "symbol": [ "std::ostringstream", "private", "<sstream>", "public" ] }
+]
diff --git a/sord/sord.h b/sord/sord.h
index 62bf782..4665b50 100644
--- a/sord/sord.h
+++ b/sord/sord.h
@@ -21,12 +21,11 @@
#ifndef SORD_SORD_H
#define SORD_SORD_H
+#include "serd/serd.h"
+
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
-#include <stdio.h>
-
-#include "serd/serd.h"
#ifdef SORD_SHARED
# ifdef _WIN32
diff --git a/sord/sordmm.hpp b/sord/sordmm.hpp
index c4236d5..c6bea7b 100644
--- a/sord/sordmm.hpp
+++ b/sord/sordmm.hpp
@@ -22,14 +22,6 @@
#ifndef SORD_SORDMM_HPP
#define SORD_SORDMM_HPP
-#include <cassert>
-#include <cstring>
-#include <cstdlib>
-#include <iostream>
-#include <set>
-#include <string>
-#include <sstream>
-
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
@@ -42,6 +34,16 @@
# pragma clang diagnostic pop
#endif
+#include <cassert>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <set>
+#include <sstream>
+#include <string>
+
#define SORD_NS_XSD "http://www.w3.org/2001/XMLSchema#"
namespace Sord {
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 <assert.h>
-#include <errno.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#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 <assert.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#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 <stddef.h>
-#include <stdint.h>
-
+#include "serd/serd.h"
#include "sord/sord.h"
+#include <stddef.h>
+
#if defined(__GNUC__) && __GNUC__ > 4
# define SORD_UNREACHABLE() __builtin_unreachable()
#else
-# define SORD_UNREACHABLE() assert(false)
+# include <assert.h>
+# 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 <inttypes.h>
#include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#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 <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef _WIN32
-# include <windows.h>
-#endif
-
#include "serd/serd.h"
#include "sord/sord.h"
#include "sord_config.h"
@@ -32,6 +24,16 @@
#ifdef HAVE_PCRE
# include <pcre.h>
#endif
+#ifdef _WIN32
+# include <windows.h>
+#endif
+
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#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 <assert.h>
-#include <stdlib.h>
-#include <string.h>
+#include "serd/serd.h"
+#include "sord/sord.h"
+#include "sord_config.h"
#ifdef _WIN32
# include <windows.h>
#endif
-#include "serd/serd.h"
-#include "sord/sord.h"
-#include "sord_config.h"
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#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 <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "serd/serd.h"
+#include "sord/sord.h"
-#include "sord_config.h"
-#include "sord_internal.h"
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
struct SordInserterImpl {
SordModel* model;