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/padlock.c b/library/padlock.c
index b8ba105..a034238 100644
--- a/library/padlock.c
+++ b/library/padlock.c
@@ -65,7 +65,7 @@
flags = edx;
}
- return( flags & feature );
+ return flags & feature ;
}
/*
@@ -105,7 +105,7 @@
memcpy( output, blk, 16 );
- return( 0 );
+ return 0 ;
}
/*
@@ -127,7 +127,7 @@
if( ( (long) input & 15 ) != 0 ||
( (long) output & 15 ) != 0 )
- return( MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED );
+ return MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED ;
rk = ctx->rk;
iw = MBEDTLS_PADLOCK_ALIGN16( buf );
@@ -156,7 +156,7 @@
memcpy( iv, iw, 16 );
- return( 0 );
+ return 0 ;
}
#endif /* MBEDTLS_HAVE_X86 */