diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d0d5c85fc..e63e89cf8b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -127,7 +127,7 @@ jobs: CC: gcc # This is required to use a version of cppcheck other than that # supplied with the operating system - CPPCHECK_VER: "2.10" + CPPCHECK_VER: "2.11" CPPCHECK_REPO: https://github.com/danmar/cppcheck.git steps: # Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20') diff --git a/librfxcodec b/librfxcodec index d8f126abc4..c537401ac2 160000 --- a/librfxcodec +++ b/librfxcodec @@ -1 +1 @@ -Subproject commit d8f126abc48a1b949a0be27b334099161c06f0fc +Subproject commit c537401ac2fd5fa4671701f67367413feb51edff diff --git a/scripts/install_cppcheck.sh b/scripts/install_cppcheck.sh index db4f38801d..24ff921057 100755 --- a/scripts/install_cppcheck.sh +++ b/scripts/install_cppcheck.sh @@ -140,6 +140,14 @@ fi fi esac + # Use all available CPUs + if [ -f /proc/cpuinfo ]; then + cpus=`grep ^processor /proc/cpuinfo | wc -l` + if [ -n "$cpus" ]; then + make_args="$make_args -j $cpus" + fi + fi + echo "Making cppcheck..." # CFGDIR is needed for cppcheck before 1.86 call_make $make_args diff --git a/scripts/run_cppcheck.sh b/scripts/run_cppcheck.sh index 9e15b4a036..b3c7c4ca38 100755 --- a/scripts/run_cppcheck.sh +++ b/scripts/run_cppcheck.sh @@ -45,10 +45,16 @@ if [ -z "$CPPCHECK_FLAGS" ]; then CPPCHECK_FLAGS="--quiet --force --std=c11 --std=c++11 --inline-suppr \ --enable=warning --error-exitcode=1" fi +CPPCHECK_FLAGS="$CPPCHECK_FLAGS -D__cppcheck__" # Any options/directories specified? if [ $# -eq 0 ]; then - set -- -j 2 . + if [ -f /proc/cpuinfo ]; then + cpus=$(grep '^processor' /proc/cpuinfo | wc -l) + else + cpus=2 + fi + set -- -j $cpus . fi # Display the cppcheck version and command for debugging diff --git a/sesman/tools/sesrun.c b/sesman/tools/sesrun.c index 15bbe4accf..ddc8bf6dfe 100644 --- a/sesman/tools/sesrun.c +++ b/sesman/tools/sesrun.c @@ -42,6 +42,11 @@ #include "libscp_connection.h" +// cppcheck doesn't always set this macro to something in double-quotes +#if defined(__cppcheck__) +#undef PACKAGE_VERSION +#endif + #if !defined(PACKAGE_VERSION) #define PACKAGE_VERSION "???" #endif diff --git a/sesman/verify_user_pam_userpass.c b/sesman/verify_user_pam_userpass.c index ac5981f434..ea9b403617 100644 --- a/sesman/verify_user_pam_userpass.c +++ b/sesman/verify_user_pam_userpass.c @@ -42,7 +42,7 @@ int auth_userpass(const char *user, const char *pass, int *errorcode) { pam_handle_t *pamh; - pam_userpass_t userpass; + pam_userpass_t userpass = NULL; struct pam_conv conv = {pam_userpass_conv, &userpass}; const void *template1; int status; diff --git a/vrplayer/decoder.h b/vrplayer/decoder.h index d66b921496..c295b69887 100644 --- a/vrplayer/decoder.h +++ b/vrplayer/decoder.h @@ -32,7 +32,7 @@ class Decoder : public QObject signals: - public slots: + public slots: // cppcheck-suppress unknownMacro void onGeometryChanged(QRect *geometry); }; diff --git a/vrplayer/dlgabout.h b/vrplayer/dlgabout.h index 1960670a99..9706e3e396 100644 --- a/vrplayer/dlgabout.h +++ b/vrplayer/dlgabout.h @@ -19,7 +19,7 @@ class DlgAbout : public QDialog private: Ui::DlgAbout *ui; - private slots: + private slots: // cppcheck-suppress unknownMacro void onOk(); }; diff --git a/vrplayer/playaudio.h b/vrplayer/playaudio.h index 0a05d41fc0..8e91dcc54f 100644 --- a/vrplayer/playaudio.h +++ b/vrplayer/playaudio.h @@ -42,7 +42,7 @@ class PlayAudio : public QObject void setVcrOp(int op); - public slots: + public slots: // cppcheck-suppress unknownMacro void play(); private: diff --git a/vrplayer/playvideo.h b/vrplayer/playvideo.h index b63bc1801e..e0285d5e01 100644 --- a/vrplayer/playvideo.h +++ b/vrplayer/playvideo.h @@ -46,7 +46,7 @@ class PlayVideo : public QObject //void setVcrOp(int op); //void onMediaRestarted(); - public slots: + public slots: // cppcheck-suppress unknownMacro void play(); //signals: