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/domainsnapshotxml2xmltest.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/domainsnapshotxml2xmltest.c')
-rw-r--r-- | tests/domainsnapshotxml2xmltest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xmltest.c index 978a2d441c..e363c99c14 100644 --- a/tests/domainsnapshotxml2xmltest.c +++ b/tests/domainsnapshotxml2xmltest.c @@ -88,7 +88,7 @@ mymain(void) int ret = 0; if ((driver.caps = testQemuCapsInit()) == NULL) - return (EXIT_FAILURE); + return EXIT_FAILURE; # define DO_TEST(name, uuid, internal) \ do { \ @@ -113,7 +113,7 @@ mymain(void) virCapabilitiesFree(driver.caps); - return (ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); + return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE; } VIRT_TEST_MAIN(mymain) |