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/include/mbedtls/ecp.h b/include/mbedtls/ecp.h
index 384d060..1e5eba1 100644
--- a/include/mbedtls/ecp.h
+++ b/include/mbedtls/ecp.h
@@ -278,7 +278,8 @@
* 224 475 475 453 398 342
* 192 640 640 633 587 476
*/
-#define MBEDTLS_ECP_WINDOW_SIZE 4 /**< The maximum window size used. */
+/** The maximum window size used. */
+#define MBEDTLS_ECP_WINDOW_SIZE 4
#endif /* MBEDTLS_ECP_WINDOW_SIZE */
#if !defined(MBEDTLS_ECP_FIXED_POINT_OPTIM)
@@ -294,7 +295,8 @@
*
* Change this value to 0 to reduce code size.
*/
-#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up. */
+/** Enable fixed-point speed-up. */
+#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1
#endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */
/* \} name SECTION: Module settings */
@@ -427,13 +429,16 @@
/*
* Point formats, from RFC 4492's enum ECPointFormat
*/
-#define MBEDTLS_ECP_PF_UNCOMPRESSED 0 /**< Uncompressed point format. */
-#define MBEDTLS_ECP_PF_COMPRESSED 1 /**< Compressed point format. */
+/** Uncompressed point format. */
+#define MBEDTLS_ECP_PF_UNCOMPRESSED 0
+/** Compressed point format. */
+#define MBEDTLS_ECP_PF_COMPRESSED 1
/*
* Some other constants from RFC 4492
*/
-#define MBEDTLS_ECP_TLS_NAMED_CURVE 3 /**< The named_curve of ECCurveType. */
+/** The named_curve of ECCurveType. */
+#define MBEDTLS_ECP_TLS_NAMED_CURVE 3
#if defined(MBEDTLS_ECP_RESTARTABLE)
/**