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/rsa.h b/include/mbedtls/rsa.h
index d03c31d..fe29548 100644
--- a/include/mbedtls/rsa.h
+++ b/include/mbedtls/rsa.h
@@ -64,11 +64,15 @@
* RSA constants
*/
-#define MBEDTLS_RSA_PKCS_V15 0 /**< Use PKCS#1 v1.5 encoding. */
-#define MBEDTLS_RSA_PKCS_V21 1 /**< Use PKCS#1 v2.1 encoding. */
+/** Use PKCS#1 v1.5 encoding. */
+#define MBEDTLS_RSA_PKCS_V15 0
+/** Use PKCS#1 v2.1 encoding. */
+#define MBEDTLS_RSA_PKCS_V21 1
-#define MBEDTLS_RSA_SIGN 1 /**< Identifier for RSA signature operations. */
-#define MBEDTLS_RSA_CRYPT 2 /**< Identifier for RSA encryption and decryption operations. */
+/** Identifier for RSA signature operations. */
+#define MBEDTLS_RSA_SIGN 1
+/** Identifier for RSA encryption and decryption operations. */
+#define MBEDTLS_RSA_CRYPT 2
#define MBEDTLS_RSA_SALT_LEN_ANY -1