Move trailing macro comments to previous line.
Clang-format was severy confused with following construct:
\\#define MBEDTLS_macro_name /**< description */
Used script:
```
import re
import sys
for arg in sys.argv[1:]:
print(arg)
with open(arg, 'r') as file:
content = file.read()
content = re.sub(r"((//)?#define MBEDTLS_\w+ *(?<= )-?\w+) *(/\*\*<(.*))", r"/**\4\n\1", \
content, flags = re.M)
with open(arg, 'w') as file:
file.write(content)
```
Executed with:
`find . -regextype posix-egrep -regex ".*\.([hc]|fmt|function)" | xargs -L1 python script.py`
One comment in ctr_drbg.h had to be fixed manually, because /**< was spanning on multiple line.
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
diff --git a/library/entropy_poll.h b/library/entropy_poll.h
index aef1a09..4b193e4 100644
--- a/library/entropy_poll.h
+++ b/library/entropy_poll.h
@@ -33,9 +33,11 @@
/*
* Default thresholds for built-in sources, in bytes
*/
-#define MBEDTLS_ENTROPY_MIN_PLATFORM 32 /**< Minimum for platform source */
+/** Minimum for platform source */
+#define MBEDTLS_ENTROPY_MIN_PLATFORM 32
#if !defined(MBEDTLS_ENTROPY_MIN_HARDWARE)
-#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Minimum for the hardware source */
+/** Minimum for the hardware source */
+#define MBEDTLS_ENTROPY_MIN_HARDWARE 32
#endif
#if !defined(MBEDTLS_NO_PLATFORM_ENTROPY)
diff --git a/library/padlock.h b/library/padlock.h
index 1506ee0..a63d646 100644
--- a/library/padlock.h
+++ b/library/padlock.h
@@ -30,7 +30,8 @@
#include "mbedtls/aes.h"
-#define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030 /**< Input data should be aligned. */
+/** Input data should be aligned. */
+#define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030
#if defined(__has_feature)
#if __has_feature(address_sanitizer)