Apply the formatting specified in .clang-format file.
$ clang-format --version
clang-format version 7.0.0 (tags/google/stable/2018-01-11)
$ clang-format -i --style=file $(find . -name '*.cpp' -o -name '*.h')
diff --git a/include/json/assertions.h b/include/json/assertions.h
index 1cca28d..482c4ca 100644
--- a/include/json/assertions.h
+++ b/include/json/assertions.h
@@ -6,8 +6,8 @@
#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
#define CPPTL_JSON_ASSERTIONS_H_INCLUDED
-#include <stdlib.h>
#include <sstream>
+#include <stdlib.h>
#if !defined(JSON_IS_AMALGAMATION)
#include "config.h"
@@ -20,30 +20,35 @@
#if JSON_USE_EXCEPTION
// @todo <= add detail about condition in exception
-# define JSON_ASSERT(condition) \
- {if (!(condition)) {Json::throwLogicError( "assert json failed" );}}
-
-# define JSON_FAIL_MESSAGE(message) \
+#define JSON_ASSERT(condition) \
{ \
- JSONCPP_OSTRINGSTREAM oss; oss << message; \
+ if (!(condition)) { \
+ Json::throwLogicError("assert json failed"); \
+ } \
+ }
+
+#define JSON_FAIL_MESSAGE(message) \
+ { \
+ JSONCPP_OSTRINGSTREAM oss; \
+ oss << message; \
Json::throwLogicError(oss.str()); \
abort(); \
}
#else // JSON_USE_EXCEPTION
-# define JSON_ASSERT(condition) assert(condition)
+#define JSON_ASSERT(condition) assert(condition)
// The call to assert() will show the failure message in debug builds. In
// release builds we abort, for a core-dump or debugger.
-# define JSON_FAIL_MESSAGE(message) \
+#define JSON_FAIL_MESSAGE(message) \
{ \
- JSONCPP_OSTRINGSTREAM oss; oss << message; \
+ JSONCPP_OSTRINGSTREAM oss; \
+ oss << message; \
assert(false && oss.str().c_str()); \
abort(); \
}
-
#endif
#define JSON_ASSERT_MESSAGE(condition, message) \