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/tests/suites/helpers.function b/tests/suites/helpers.function
index 7481c5b..0071f6f 100644
--- a/tests/suites/helpers.function
+++ b/tests/suites/helpers.function
@@ -123,14 +123,14 @@
if( dup_fd == -1 )
{
- return( -1 );
+ return -1 ;
}
path_stream = fopen( path, "w" );
if( path_stream == NULL )
{
close( dup_fd );
- return( -1 );
+ return -1 ;
}
fflush( out_stream );
@@ -138,11 +138,11 @@
{
close( dup_fd );
fclose( path_stream );
- return( -1 );
+ return -1 ;
}
fclose( path_stream );
- return( dup_fd );
+ return dup_fd ;
}
static int restore_output( FILE* out_stream, int dup_fd )
@@ -154,10 +154,10 @@
{
close( out_fd );
close( dup_fd );
- return( -1 );
+ return -1 ;
}
close( dup_fd );
- return( 0 );
+ return 0 ;
}
#endif /* __unix__ || __APPLE__ __MACH__ */