diff --git a/test/testunusedvar.cpp b/test/testunusedvar.cpp index dcba04fc3..c8f118a3e 100644 --- a/test/testunusedvar.cpp +++ b/test/testunusedvar.cpp @@ -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()); } diff --git a/tools/readme.md b/tools/readme.md index db59cd995..d47318cab 100644 --- a/tools/readme.md +++ b/tools/readme.md @@ -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 diff --git a/tools/test_showtimetop5.sh b/tools/test_showtimetop5.sh index cd051837c..72b26d75f 100755 --- a/tools/test_showtimetop5.sh +++ b/tools/test_showtimetop5.sh @@ -1,4 +1,4 @@ #!/bin/bash if [[ "`./cppcheck --showtime=top5 cli/cmdlineparser.h --quiet | wc -l`" != 7 ]] ; then - false + false fi diff --git a/tools/times.sh b/tools/times.sh index 438c3a76e..ca0e60bd9 100755 --- a/tools/times.sh +++ b/tools/times.sh @@ -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