]> git.ipfire.org Git - thirdparty/qemu.git/commit
util/uri.c: wrap single statement blocks with braces {}
authorSu Hang <suhang16@mails.ucas.ac.cn>
Sun, 25 Feb 2018 04:35:58 +0000 (12:35 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 5 Mar 2018 09:03:17 +0000 (09:03 +0000)
commita1515161b563acd0986867fc37084c1cf952ba35
tree2883fccdb584c09d82694716fafc929f6482b587
parent42fa27253cfa8b9ad7d41ce63a733a4c623ffc74
util/uri.c: wrap single statement blocks with braces {}

For this patch, using curly braces to wrap `if` `while` `else` statements,
which only hold single statement. For example:
'''
if (cond)
    statement;
'''
to
'''
if (cond) {
    statement;
}
'''

And using tricks that compare the disassemblies before and after
code changes, to make sure code logic isn't changed:
'''
git checkout master
make util/uri.o
strip util/uri.o
objdump -Drx util/uri.o > /tmp/uri-master.txt
git checkout cleanupbranch
make util/uri.o
strip util/uri.o
objdump -Drx util/uri.o > /tmp/uri-cleanup.txt

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
util/uri.c