Fix parantheses on return and sizeof statements.
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"return\s?\((?!.*\).*\()\s*\n?(.*)\n?\);", r"return \1;", \
content, flags = re.M)
content = re.sub(r"sizeof ([^\(][a-zA-Z0-9_\[\]]*)", r"sizeof(\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`
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
diff --git a/library/platform_util.c b/library/platform_util.c
index 3d5cb5b..3c3ebca 100644
--- a/library/platform_util.c
+++ b/library/platform_util.c
@@ -104,15 +104,15 @@
struct tm *tm_buf )
{
#if defined(_WIN32) && !defined(EFIX64) && !defined(EFI32)
- return( ( gmtime_s( tm_buf, tt ) == 0 ) ? tm_buf : NULL );
+ return ( gmtime_s( tm_buf, tt ) == 0 ) ? tm_buf : NULL ;
#elif !defined(PLATFORM_UTIL_USE_GMTIME)
- return( gmtime_r( tt, tm_buf ) );
+ return gmtime_r( tt, tm_buf ) ;
#else
struct tm *lt;
#if defined(MBEDTLS_THREADING_C)
if( mbedtls_mutex_lock( &mbedtls_threading_gmtime_mutex ) != 0 )
- return( NULL );
+ return NULL ;
#endif /* MBEDTLS_THREADING_C */
lt = gmtime( tt );
@@ -124,10 +124,10 @@
#if defined(MBEDTLS_THREADING_C)
if( mbedtls_mutex_unlock( &mbedtls_threading_gmtime_mutex ) != 0 )
- return( NULL );
+ return NULL ;
#endif /* MBEDTLS_THREADING_C */
- return( ( lt == NULL ) ? NULL : tm_buf );
+ return ( lt == NULL ) ? NULL : tm_buf ;
#endif /* _WIN32 && !EFIX64 && !EFI32 */
}
#endif /* MBEDTLS_HAVE_TIME_DATE && MBEDTLS_PLATFORM_GMTIME_R_ALT */