diff options
author | Martin Kletzander <mkletzan@redhat.com> | 2012-03-22 12:33:35 +0100 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2012-03-26 14:45:22 -0600 |
commit | 9943276fd2d068756a5f11c4e1aa22e915ddb0c9 (patch) | |
tree | 6b064566d611988d6ea7320673c5bb292dc52fb7 /tests/virnetmessagetest.c | |
parent | 70c07e01dee24df0a1591d65799b66a8e89a3bd6 (diff) | |
download | libvirt-9943276fd2d068756a5f11c4e1aa22e915ddb0c9.tar.gz |
Cleanup for a return statement in source files
Return statements with parameter enclosed in parentheses were modified
and parentheses were removed. The whole change was scripted, here is how:
List of files was obtained using this command:
git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' | \
grep -e '\.[ch]$' -e '\.py$'
Found files were modified with this command:
sed -i -e \
's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
-e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
Then checked for nonsense.
The whole command looks like this:
git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' | \
grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e \
's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
-e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
Diffstat (limited to 'tests/virnetmessagetest.c')
-rw-r--r-- | tests/virnetmessagetest.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/virnetmessagetest.c b/tests/virnetmessagetest.c index a378ed535c..28dc09f9ae 100644 --- a/tests/virnetmessagetest.c +++ b/tests/virnetmessagetest.c @@ -506,7 +506,7 @@ mymain(void) if (virtTestRun("Message Payload Stream Encode", 1, testMessagePayloadStreamEncode, NULL) < 0) ret = -1; - return (ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); + return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE; } VIRT_TEST_MAIN(mymain) |