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/platform.h b/include/mbedtls/platform.h
index 277a85c..81f981d 100644
--- a/include/mbedtls/platform.h
+++ b/include/mbedtls/platform.h
@@ -65,41 +65,53 @@
#include <time.h>
#if !defined(MBEDTLS_PLATFORM_STD_SNPRINTF)
#if defined(MBEDTLS_PLATFORM_HAS_NON_CONFORMING_SNPRINTF)
-#define MBEDTLS_PLATFORM_STD_SNPRINTF mbedtls_platform_win32_snprintf /**< The default \c snprintf function to use. */
+/** The default \c snprintf function to use. */
+#define MBEDTLS_PLATFORM_STD_SNPRINTF mbedtls_platform_win32_snprintf
#else
-#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< The default \c snprintf function to use. */
+/** The default \c snprintf function to use. */
+#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf
#endif
#endif
#if !defined(MBEDTLS_PLATFORM_STD_VSNPRINTF)
#if defined(MBEDTLS_PLATFORM_HAS_NON_CONFORMING_VSNPRINTF)
-#define MBEDTLS_PLATFORM_STD_VSNPRINTF mbedtls_platform_win32_vsnprintf /**< The default \c vsnprintf function to use. */
+/** The default \c vsnprintf function to use. */
+#define MBEDTLS_PLATFORM_STD_VSNPRINTF mbedtls_platform_win32_vsnprintf
#else
-#define MBEDTLS_PLATFORM_STD_VSNPRINTF vsnprintf /**< The default \c vsnprintf function to use. */
+/** The default \c vsnprintf function to use. */
+#define MBEDTLS_PLATFORM_STD_VSNPRINTF vsnprintf
#endif
#endif
#if !defined(MBEDTLS_PLATFORM_STD_PRINTF)
-#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< The default \c printf function to use. */
+/** The default \c printf function to use. */
+#define MBEDTLS_PLATFORM_STD_PRINTF printf
#endif
#if !defined(MBEDTLS_PLATFORM_STD_FPRINTF)
-#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< The default \c fprintf function to use. */
+/** The default \c fprintf function to use. */
+#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf
#endif
#if !defined(MBEDTLS_PLATFORM_STD_CALLOC)
-#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< The default \c calloc function to use. */
+/** The default \c calloc function to use. */
+#define MBEDTLS_PLATFORM_STD_CALLOC calloc
#endif
#if !defined(MBEDTLS_PLATFORM_STD_FREE)
-#define MBEDTLS_PLATFORM_STD_FREE free /**< The default \c free function to use. */
+/** The default \c free function to use. */
+#define MBEDTLS_PLATFORM_STD_FREE free
#endif
#if !defined(MBEDTLS_PLATFORM_STD_EXIT)
-#define MBEDTLS_PLATFORM_STD_EXIT exit /**< The default \c exit function to use. */
+/** The default \c exit function to use. */
+#define MBEDTLS_PLATFORM_STD_EXIT exit
#endif
#if !defined(MBEDTLS_PLATFORM_STD_TIME)
-#define MBEDTLS_PLATFORM_STD_TIME time /**< The default \c time function to use. */
+/** The default \c time function to use. */
+#define MBEDTLS_PLATFORM_STD_TIME time
#endif
#if !defined(MBEDTLS_PLATFORM_STD_EXIT_SUCCESS)
-#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS EXIT_SUCCESS /**< The default exit value to use. */
+/** The default exit value to use. */
+#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS EXIT_SUCCESS
#endif
#if !defined(MBEDTLS_PLATFORM_STD_EXIT_FAILURE)
-#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE EXIT_FAILURE /**< The default exit value to use. */
+/** The default exit value to use. */
+#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE EXIT_FAILURE
#endif
#if defined(MBEDTLS_FS_IO)
#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ)