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/poly1305.c b/library/poly1305.c
index 492d145..a81220b 100644
--- a/library/poly1305.c
+++ b/library/poly1305.c
@@ -82,7 +82,7 @@
#else
static inline uint64_t mul64( uint32_t a, uint32_t b )
{
- return( (uint64_t) a * b );
+ return (uint64_t) a * b ;
}
#endif
@@ -318,7 +318,7 @@
mbedtls_platform_zeroize( ctx->queue, sizeof( ctx->queue ) );
ctx->queue_len = 0U;
- return( 0 );
+ return 0 ;
}
int mbedtls_poly1305_update( mbedtls_poly1305_context *ctx,
@@ -382,7 +382,7 @@
memcpy( ctx->queue, &input[offset], remaining );
}
- return( 0 );
+ return 0 ;
}
int mbedtls_poly1305_finish( mbedtls_poly1305_context *ctx,
@@ -409,7 +409,7 @@
poly1305_compute_mac( ctx, mac );
- return( 0 );
+ return 0 ;
}
int mbedtls_poly1305_mac( const unsigned char key[32],
@@ -437,7 +437,7 @@
cleanup:
mbedtls_poly1305_free( &ctx );
- return( ret );
+ return ret ;
}
#endif /* MBEDTLS_POLY1305_ALT */
@@ -518,7 +518,7 @@
if( verbose != 0 ) \
mbedtls_printf args; \
\
- return( -1 ); \
+ return -1 ; \
} \
} \
while( 0 )
@@ -549,7 +549,7 @@
if( verbose != 0 )
mbedtls_printf( "\n" );
- return( 0 );
+ return 0 ;
}
#endif /* MBEDTLS_SELF_TEST */