Trim tailing spaces and convert tabs to spaces.

This commit is contained in:
XhmikosR 2014-03-17 09:40:01 +02:00
parent 4928dc52bb
commit fc54e6acc4
4 changed files with 26 additions and 26 deletions

View File

@ -3701,30 +3701,30 @@ private:
void localvarUnusedGoto() { void localvarUnusedGoto() {
// #4447 // #4447
functionVariableUsage("bool f(const int &i) {\n" functionVariableUsage("bool f(const int &i) {\n"
" int X = i;\n" " int X = i;\n"
"label:\n" "label:\n"
" if ( X == 0 ) {\n" " if ( X == 0 ) {\n"
" X -= 101;\n" " X -= 101;\n"
" return true;\n" " return true;\n"
" }\n" " }\n"
" if ( X < 1001 ) {\n" " if ( X < 1001 ) {\n"
" X += 1;\n" " X += 1;\n"
" goto label;\n" " goto label;\n"
" }\n" " }\n"
" return false;\n" " return false;\n"
"}\n"); "}\n");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
// #4558 // #4558
functionVariableUsage("int f() {\n" functionVariableUsage("int f() {\n"
" int i,j=0;\n" " int i,j=0;\n"
" start:\n" " start:\n"
" i=j;\n" " i=j;\n"
" i++;\n" " i++;\n"
" j=i;\n" " j=i;\n"
" if (i<3)\n" " if (i<3)\n"
" goto start;\n" " goto start;\n"
" return i;\n" " return i;\n"
"}"); "}");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }

View File

@ -47,7 +47,7 @@ void f2() {
Token::Match(tok, abc); Token::Match(tok, abc);
} }
``` ```
From this we can see that the usage of `Token::Match()` in `f1()` has been optimized, whereas the one in `f2()` couldn't be optimized (the string wasn't inline on the `Token::Match()` call). **The developer doesn't need to use this tool during development but should be aware of these optimizations**. *Building with this optimization, cppcheck can get a boost of 2x of speed-up.* From this we can see that the usage of `Token::Match()` in `f1()` has been optimized, whereas the one in `f2()` couldn't be optimized (the string wasn't inline on the `Token::Match()` call). **The developer doesn't need to use this tool during development but should be aware of these optimizations**. *Building with this optimization, cppcheck can get a boost of 2x of speed-up.*
### * tools/dmake.cpp ### * tools/dmake.cpp

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
if [[ "`./cppcheck --showtime=top5 cli/cmdlineparser.h --quiet | wc -l`" != 7 ]] ; then if [[ "`./cppcheck --showtime=top5 cli/cmdlineparser.h --quiet | wc -l`" != 7 ]] ; then
false false
fi fi

View File

@ -16,16 +16,16 @@ make clean
git reset --hard HEAD > times.log git reset --hard HEAD > times.log
for i in `seq 1 50`; do for i in `seq 1 50`; do
git_head=`git log -1 --format=%h` git_head=`git log -1 --format=%h`
# if build fails, make clean and try again # if build fails, make clean and try again
make SRCDIR=build CXXFLAGS=-O2 -j4 || make clean ; make SRCDIR=build CXXFLAGS=-O2 -j4 make SRCDIR=build CXXFLAGS=-O2 -j4 || make clean ; make SRCDIR=build CXXFLAGS=-O2 -j4
echo "Run number $i" echo "Run number $i"
./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log ./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log
./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log ./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log
./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log ./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log
./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log ./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log
grep "Overall" times.log | tail -4 | sed s/s// | awk -v "i=$i" -v "git_head=$git_head" '{ sum+=$3} END {print "Run " i", "git_head " Average: " sum/4}' | tee -a times.log grep "Overall" times.log | tail -4 | sed s/s// | awk -v "i=$i" -v "git_head=$git_head" '{ sum+=$3} END {print "Run " i", "git_head " Average: " sum/4}' | tee -a times.log
git reset --hard HEAD^1 | tee -a times.log git reset --hard HEAD^1 | tee -a times.log
done done
gcc -o tools/times tools/times.c gcc -o tools/times tools/times.c