Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36873 from rouault/cppcheck_gh_action
Fix remaining cppcheck warnings, add scripts/cppcheck.sh and corresponding GH workflow jobs
- Loading branch information
Showing
97 changed files
with
613 additions
and
396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
|
||
|
||
class QgsDiagram | ||
class QgsDiagram /NoDefaultCtors/ | ||
{ | ||
%Docstring | ||
Base class for all diagram types* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
|
||
|
||
class QgsPieDiagram: QgsDiagram | ||
class QgsPieDiagram: QgsDiagram /NoDefaultCtors/ | ||
{ | ||
|
||
%TypeHeaderCode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
|
||
|
||
class QgsTextDiagram: QgsDiagram | ||
class QgsTextDiagram: QgsDiagram /NoDefaultCtors/ | ||
{ | ||
|
||
%TypeHeaderCode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -313,6 +313,7 @@ Low-level removal of children from the node. | |
%End | ||
|
||
protected: | ||
|
||
}; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
SCRIPT_DIR=$(dirname "$0") | ||
case $SCRIPT_DIR in | ||
"/"*) | ||
;; | ||
".") | ||
SCRIPT_DIR=$(pwd) | ||
;; | ||
*) | ||
SCRIPT_DIR=$(pwd)/$(dirname "$0") | ||
;; | ||
esac | ||
|
||
LOG_FILE=/tmp/cppcheck_qgis.txt | ||
|
||
rm -f ${LOG_FILE} | ||
echo "Checking ${SCRIPT_DIR}/../src ..." | ||
|
||
cppcheck --library=qt.cfg --inline-suppr \ | ||
--template='{file}:{line},{severity},{id},{message}' \ | ||
--enable=all --inconclusive --std=c++11 \ | ||
-DPROJ_VERSION_MAJOR=6 \ | ||
-USIP_RUN \ | ||
-DSIP_TRANSFER= \ | ||
-DSIP_TRANSFERTHIS= \ | ||
-DSIP_INOUT= \ | ||
-DSIP_OUT= \ | ||
-j $(nproc) \ | ||
${SCRIPT_DIR}/../src \ | ||
>>${LOG_FILE} 2>&1 & | ||
|
||
PID=$! | ||
while kill -0 $PID 2>/dev/null; do | ||
printf "." | ||
sleep 1 | ||
done | ||
echo " done" | ||
if ! wait $PID; then | ||
echo "cppcheck failed" | ||
exit 1 | ||
fi | ||
|
||
ret_code=0 | ||
|
||
for category in "error" "style" "performance" "portability"; do | ||
if grep "${category}," ${LOG_FILE} >/dev/null; then | ||
echo "INFO: Issues in '${category}' category found, but not considered as making script to fail:" | ||
grep "${category}," ${LOG_FILE} | grep -v "clarifyCalculation," | ||
echo "" | ||
fi | ||
done | ||
|
||
for category in "warning" "clarifyCalculation"; do | ||
if grep "${category}," ${LOG_FILE} >/dev/null; then | ||
echo "ERROR: Issues in '${category}' category found:" | ||
grep "${category}," ${LOG_FILE} | ||
echo "" | ||
echo "${category} check failed !" | ||
ret_code=1 | ||
fi | ||
done | ||
|
||
if [ ${ret_code} = 0 ]; then | ||
echo "cppcheck succeeded" | ||
fi | ||
|
||
exit ${ret_code} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.