aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Swiecki <robert@swiecki.net>2023-09-22 16:43:40 +0200
committerRobert Swiecki <robert@swiecki.net>2023-09-22 16:43:40 +0200
commit275de833ba76f3f2e32358a4d209b682df45517c (patch)
tree3b2c69397302b3c68ea0976b4a873503fe81e7bb
parentd1b74c2238a0e0a0ee2d0b6f045a5b1fef83118a (diff)
downloadnsjail-275de833ba76f3f2e32358a4d209b682df45517c.tar.gz
indent: use 'AlignEscapedNewlines: Right' to put backslashed in macros at ends of lines
-rw-r--r--Makefile2
-rw-r--r--logs.h62
-rw-r--r--macros.h14
-rw-r--r--util.h10
4 files changed, 44 insertions, 44 deletions
diff --git a/Makefile b/Makefile
index e4b2305..fb89dac 100644
--- a/Makefile
+++ b/Makefile
@@ -100,7 +100,7 @@ depend: all
.PHONY: indent
indent:
- clang-format -style="{BasedOnStyle: google, IndentWidth: 8, UseTab: Always, IndentCaseLabels: false, ColumnLimit: 100, AlignAfterOpenBracket: false, AllowShortFunctionsOnASingleLine: false, AlwaysBreakBeforeMultilineStrings: false}" -i -sort-includes $(SRCS_H) $(SRCS_CXX)
+ clang-format -style="{BasedOnStyle: google, IndentWidth: 8, UseTab: Always, IndentCaseLabels: false, ColumnLimit: 100, AlignAfterOpenBracket: false, AllowShortFunctionsOnASingleLine: false, AlwaysBreakBeforeMultilineStrings: false, AlignEscapedNewlines: Right}" -i -sort-includes $(SRCS_H) $(SRCS_CXX)
clang-format -style="{BasedOnStyle: google, IndentWidth: 4, UseTab: Always, ColumnLimit: 100}" -i $(SRCS_PROTO)
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/logs.h b/logs.h
index 00077bb..051fb95 100644
--- a/logs.h
+++ b/logs.h
@@ -30,49 +30,49 @@
namespace logs {
#define LOG_HELP(...) logs::logMsg(logs::HELP, __FUNCTION__, __LINE__, false, __VA_ARGS__);
-#define LOG_HELP_BOLD(...) \
+#define LOG_HELP_BOLD(...) \
logs::logMsg(logs::HELP_BOLD, __FUNCTION__, __LINE__, false, __VA_ARGS__);
-#define LOG_D(...) \
- if (logs::getLogLevel() <= logs::DEBUG) { \
- logs::logMsg(logs::DEBUG, __FUNCTION__, __LINE__, false, __VA_ARGS__); \
+#define LOG_D(...) \
+ if (logs::getLogLevel() <= logs::DEBUG) { \
+ logs::logMsg(logs::DEBUG, __FUNCTION__, __LINE__, false, __VA_ARGS__); \
}
-#define LOG_I(...) \
- if (logs::getLogLevel() <= logs::INFO) { \
- logs::logMsg(logs::INFO, __FUNCTION__, __LINE__, false, __VA_ARGS__); \
+#define LOG_I(...) \
+ if (logs::getLogLevel() <= logs::INFO) { \
+ logs::logMsg(logs::INFO, __FUNCTION__, __LINE__, false, __VA_ARGS__); \
}
-#define LOG_W(...) \
- if (logs::getLogLevel() <= logs::WARNING) { \
- logs::logMsg(logs::WARNING, __FUNCTION__, __LINE__, false, __VA_ARGS__); \
+#define LOG_W(...) \
+ if (logs::getLogLevel() <= logs::WARNING) { \
+ logs::logMsg(logs::WARNING, __FUNCTION__, __LINE__, false, __VA_ARGS__); \
}
-#define LOG_E(...) \
- if (logs::getLogLevel() <= logs::ERROR) { \
- logs::logMsg(logs::ERROR, __FUNCTION__, __LINE__, false, __VA_ARGS__); \
+#define LOG_E(...) \
+ if (logs::getLogLevel() <= logs::ERROR) { \
+ logs::logMsg(logs::ERROR, __FUNCTION__, __LINE__, false, __VA_ARGS__); \
}
-#define LOG_F(...) \
- if (logs::getLogLevel() <= logs::FATAL) { \
- logs::logMsg(logs::FATAL, __FUNCTION__, __LINE__, false, __VA_ARGS__); \
+#define LOG_F(...) \
+ if (logs::getLogLevel() <= logs::FATAL) { \
+ logs::logMsg(logs::FATAL, __FUNCTION__, __LINE__, false, __VA_ARGS__); \
}
-#define PLOG_D(...) \
- if (logs::getLogLevel() <= logs::DEBUG) { \
- logs::logMsg(logs::DEBUG, __FUNCTION__, __LINE__, true, __VA_ARGS__); \
+#define PLOG_D(...) \
+ if (logs::getLogLevel() <= logs::DEBUG) { \
+ logs::logMsg(logs::DEBUG, __FUNCTION__, __LINE__, true, __VA_ARGS__); \
}
-#define PLOG_I(...) \
- if (logs::getLogLevel() <= logs::INFO) { \
- logs::logMsg(logs::INFO, __FUNCTION__, __LINE__, true, __VA_ARGS__); \
+#define PLOG_I(...) \
+ if (logs::getLogLevel() <= logs::INFO) { \
+ logs::logMsg(logs::INFO, __FUNCTION__, __LINE__, true, __VA_ARGS__); \
}
-#define PLOG_W(...) \
- if (logs::getLogLevel() <= logs::WARNING) { \
- logs::logMsg(logs::WARNING, __FUNCTION__, __LINE__, true, __VA_ARGS__); \
+#define PLOG_W(...) \
+ if (logs::getLogLevel() <= logs::WARNING) { \
+ logs::logMsg(logs::WARNING, __FUNCTION__, __LINE__, true, __VA_ARGS__); \
}
-#define PLOG_E(...) \
- if (logs::getLogLevel() <= logs::ERROR) { \
- logs::logMsg(logs::ERROR, __FUNCTION__, __LINE__, true, __VA_ARGS__); \
+#define PLOG_E(...) \
+ if (logs::getLogLevel() <= logs::ERROR) { \
+ logs::logMsg(logs::ERROR, __FUNCTION__, __LINE__, true, __VA_ARGS__); \
}
-#define PLOG_F(...) \
- if (logs::getLogLevel() <= logs::FATAL) { \
- logs::logMsg(logs::FATAL, __FUNCTION__, __LINE__, true, __VA_ARGS__); \
+#define PLOG_F(...) \
+ if (logs::getLogLevel() <= logs::FATAL) { \
+ logs::logMsg(logs::FATAL, __FUNCTION__, __LINE__, true, __VA_ARGS__); \
}
enum llevel_t {
diff --git a/macros.h b/macros.h
index d25ff33..ea295ef 100644
--- a/macros.h
+++ b/macros.h
@@ -25,12 +25,12 @@
#include <unistd.h>
#if !defined(TEMP_FAILURE_RETRY)
-#define TEMP_FAILURE_RETRY(expression) \
- (__extension__({ \
- long int __result; \
- do __result = (long int)(expression); \
- while (__result == -1L && errno == EINTR); \
- __result; \
+#define TEMP_FAILURE_RETRY(expression) \
+ (__extension__({ \
+ long int __result; \
+ do __result = (long int)(expression); \
+ while (__result == -1L && errno == EINTR); \
+ __result; \
}))
#endif /* !defined(TEMP_FAILURE_RETRY) */
@@ -38,7 +38,7 @@
#define ARR_SZ(array) (sizeof(array) / sizeof(*array))
#endif /* !defined(ARR_SZ) */
-#define NS_VALSTR_STRUCT(x) \
+#define NS_VALSTR_STRUCT(x) \
{ (uint64_t) x, #x }
#endif /* NS_COMMON_H */
diff --git a/util.h b/util.h
index 821d0e3..b0f401a 100644
--- a/util.h
+++ b/util.h
@@ -32,11 +32,11 @@
#include "nsjail.h"
-#define RETURN_ON_FAILURE(expr) \
- do { \
- if (!(expr)) { \
- return false; \
- } \
+#define RETURN_ON_FAILURE(expr) \
+ do { \
+ if (!(expr)) { \
+ return false; \
+ } \
} while (0)
#define QC(x) (util::StrQuote(x).c_str())