Trim tailing spaces and convert tabs to spaces.
This commit is contained in:
parent
4928dc52bb
commit
fc54e6acc4
|
@ -3701,30 +3701,30 @@ private:
|
|||
void localvarUnusedGoto() {
|
||||
// #4447
|
||||
functionVariableUsage("bool f(const int &i) {\n"
|
||||
" int X = i;\n"
|
||||
" int X = i;\n"
|
||||
"label:\n"
|
||||
" if ( X == 0 ) {\n"
|
||||
" if ( X == 0 ) {\n"
|
||||
" X -= 101;\n"
|
||||
" return true;\n"
|
||||
" }\n"
|
||||
" if ( X < 1001 ) {\n"
|
||||
" }\n"
|
||||
" if ( X < 1001 ) {\n"
|
||||
" X += 1;\n"
|
||||
" goto label;\n"
|
||||
" }\n"
|
||||
" return false;\n"
|
||||
" }\n"
|
||||
" return false;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// #4558
|
||||
functionVariableUsage("int f() {\n"
|
||||
" int i,j=0;\n"
|
||||
" start:\n"
|
||||
" i=j;\n"
|
||||
" i++;\n"
|
||||
" j=i;\n"
|
||||
" if (i<3)\n"
|
||||
" goto start;\n"
|
||||
" return i;\n"
|
||||
" int i,j=0;\n"
|
||||
" start:\n"
|
||||
" i=j;\n"
|
||||
" i++;\n"
|
||||
" j=i;\n"
|
||||
" if (i<3)\n"
|
||||
" goto start;\n"
|
||||
" return i;\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ void f2() {
|
|||
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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
if [[ "`./cppcheck --showtime=top5 cli/cmdlineparser.h --quiet | wc -l`" != 7 ]] ; then
|
||||
false
|
||||
false
|
||||
fi
|
||||
|
|
|
@ -16,16 +16,16 @@ make clean
|
|||
git reset --hard HEAD > times.log
|
||||
|
||||
for i in `seq 1 50`; do
|
||||
git_head=`git log -1 --format=%h`
|
||||
# if build fails, make clean and try again
|
||||
make SRCDIR=build CXXFLAGS=-O2 -j4 || make clean ; make SRCDIR=build CXXFLAGS=-O2 -j4
|
||||
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
|
||||
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_head=`git log -1 --format=%h`
|
||||
# if build fails, make clean and try again
|
||||
make SRCDIR=build CXXFLAGS=-O2 -j4 || make clean ; make SRCDIR=build CXXFLAGS=-O2 -j4
|
||||
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
|
||||
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
|
||||
done
|
||||
|
||||
gcc -o tools/times tools/times.c
|
||||
|
|
Loading…
Reference in New Issue