Skip to content

Commit

Permalink
util/uri.c: wrap single statement blocks with braces {}
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Su Hang authored and stefanhaRH committed Mar 5, 2018
1 parent 42fa272 commit a151516
Showing 1 changed file with 294 additions and 169 deletions.
Loading

0 comments on commit a151516

Please sign in to comment.