From 17a590e337c1d9995ba47d48152b86832836d0bd Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 6 Feb 2023 01:21:00 +0100 Subject: [PATCH 1/5] Plugins (gforce): Resolve multi-character character constants The related warning is -Wmultichar, can be fatal. Idea from https://stackoverflow.com/a/55505870/11626624 --- .../plugins/actor/G-Force/Common/io/CEgIOFile.cpp | 4 +++- .../plugins/actor/G-Force/Common/io/Headers/CEgFileSpec.h | 6 ++++-- libvisual-plugins/plugins/actor/G-Force/Common/io/Prefs.cpp | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libvisual-plugins/plugins/actor/G-Force/Common/io/CEgIOFile.cpp b/libvisual-plugins/plugins/actor/G-Force/Common/io/CEgIOFile.cpp index a93a2af8c..24b37d029 100644 --- a/libvisual-plugins/plugins/actor/G-Force/Common/io/CEgIOFile.cpp +++ b/libvisual-plugins/plugins/actor/G-Force/Common/io/CEgIOFile.cpp @@ -1,10 +1,12 @@ +#include + #include "CEgIOFile.h" #include "CEgFileSpec.h" -long CEgIOFile::sCreatorType = '????'; +long CEgIOFile::sCreatorType = *reinterpret_cast("????"); CEgIOFile::CEgIOFile( int inDoTrunc, long inOBufSize ) : diff --git a/libvisual-plugins/plugins/actor/G-Force/Common/io/Headers/CEgFileSpec.h b/libvisual-plugins/plugins/actor/G-Force/Common/io/Headers/CEgFileSpec.h index f80a3642a..5dc0301fc 100644 --- a/libvisual-plugins/plugins/actor/G-Force/Common/io/Headers/CEgFileSpec.h +++ b/libvisual-plugins/plugins/actor/G-Force/Common/io/Headers/CEgFileSpec.h @@ -2,6 +2,8 @@ #define _CEGFILESPEC_ +#include + #include "UtilStr.h" #include "CEgErr.h" @@ -15,7 +17,7 @@ class CEgFileSpec { public: CEgFileSpec(); - CEgFileSpec( const char* inPathName, long inType = 'TEXT' ); + CEgFileSpec( const char* inPathName, long inType = *reinterpret_cast("TEXT") ); CEgFileSpec( const CEgFileSpec& inSpec ); @@ -28,7 +30,7 @@ class CEgFileSpec { void Assign( const CEgFileSpec& inSpec ); void AssignPathName( const char* inPathName ); - void Assign( const void* inOSSpecPtr, long inType = 'TEXT' ); + void Assign( const void* inOSSpecPtr, long inType = *reinterpret_cast("TEXT") ); CEgErr Duplicate( const CEgFileSpec& inDestSpec ) const; void SaveAs( const CEgFileSpec& inDestSpec ) const; diff --git a/libvisual-plugins/plugins/actor/G-Force/Common/io/Prefs.cpp b/libvisual-plugins/plugins/actor/G-Force/Common/io/Prefs.cpp index ac4c21459..b3fff97df 100644 --- a/libvisual-plugins/plugins/actor/G-Force/Common/io/Prefs.cpp +++ b/libvisual-plugins/plugins/actor/G-Force/Common/io/Prefs.cpp @@ -35,7 +35,7 @@ Prefs::Prefs( const char* inPrefsName, bool inSysStored ) { theDirID = ( (FSSpec*) EgOSUtils::sAppSpec.OSSpec() ) -> parID; } ::FSMakeFSSpec( theVRef, theDirID, mPrefName.getPasStr(), &prefSpec ); - mFileSpec.Assign( &prefSpec, 'TEXT' ); + mFileSpec.Assign( &prefSpec, *reinterpret_cast("TEXT"); ); #endif #ifdef EG_WIN @@ -80,9 +80,9 @@ CEgErr Prefs::Store() { if ( mDirty ) { long origType = CEgIOFile::sCreatorType; #if EG_MAC - CEgIOFile::sCreatorType = 'ttxt'; + CEgIOFile::sCreatorType = *reinterpret_cast("ttxt"); #elif EG_WIN - CEgIOFile::sCreatorType = '????'; + CEgIOFile::sCreatorType = *reinterpret_cast("????"); #endif oFile.open( &mFileSpec ); From 7a89960ffdc1ddf4e12141b5b68b64fcae1ef312 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 6 Feb 2023 01:00:03 +0100 Subject: [PATCH 2/5] libvisual: Run autoreconf twice if necessary Symtom was (on macOS): > [..] > aclocal: error: too many loops > aclocal: Please contact . > at /usr/local/Cellar/automake/1.16.5/share/automake-1.16/Automake/Channels.pm line 655. > Automake::Channels::msg("automake", "", "too many loops") called at /usr/local/Cellar/automake/1.16.5/share/automake-1.16/Automake/ChannelDefs.pm line 226 > Automake::ChannelDefs::prog_error("too many loops") called at /usr/local/bin/aclocal line 1187 > autoreconf: error: aclocal failed with exit status: 255 --- libvisual-plugins/autogen.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/libvisual-plugins/autogen.sh b/libvisual-plugins/autogen.sh index 3d09034a0..a17643629 100755 --- a/libvisual-plugins/autogen.sh +++ b/libvisual-plugins/autogen.sh @@ -9,6 +9,7 @@ if [[ "$(uname -s)" == Darwin ]]; then echo 'AC_DEFUN([AM_PATH_ALSA], [HAVE_ALSA=no])' > acinclude.m4 fi +autoreconf --install --verbose --force || \ autoreconf --install --verbose --force if [[ -z "${NOCONFIGURE:-}" ]]; then From a465f68d617f00a278539bf5b07ef4350863865b Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 6 Feb 2023 01:01:42 +0100 Subject: [PATCH 3/5] Plugins: Run autoreconf twice if necessary Symtom was (on macOS): > [..] > aclocal: error: too many loops > aclocal: Please contact . > at /usr/local/Cellar/automake/1.16.5/share/automake-1.16/Automake/Channels.pm line 655. > Automake::Channels::msg("automake", "", "too many loops") called at /usr/local/Cellar/automake/1.16.5/share/automake-1.16/Automake/ChannelDefs.pm line 226 > Automake::ChannelDefs::prog_error("too many loops") called at /usr/local/bin/aclocal line 1187 > autoreconf: error: aclocal failed with exit status: 255 --- libvisual/autogen.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/libvisual/autogen.sh b/libvisual/autogen.sh index 48eac0ded..a547c6664 100755 --- a/libvisual/autogen.sh +++ b/libvisual/autogen.sh @@ -4,6 +4,7 @@ set -e -u +autoreconf --install --verbose --force || \ autoreconf --install --verbose --force if [[ -z "${NOCONFIGURE:-}" ]]; then From fe248f8cee2e7738652b2b71ecebe6c9ef0d12a1 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 6 Feb 2023 00:17:35 +0100 Subject: [PATCH 4/5] libvisual: Require a C++11 compiler + enable C++11 features Related documentation: https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html --- .github/workflows/enforce-copies-of-help-output-in-sync.yml | 1 + .github/workflows/linux_and_macos.yml | 2 ++ .github/workflows/translations.yml | 1 + libvisual/configure.ac | 1 + 4 files changed, 5 insertions(+) diff --git a/.github/workflows/enforce-copies-of-help-output-in-sync.yml b/.github/workflows/enforce-copies-of-help-output-in-sync.yml index 4909e777a..7b6634afa 100644 --- a/.github/workflows/enforce-copies-of-help-output-in-sync.yml +++ b/.github/workflows/enforce-copies-of-help-output-in-sync.yml @@ -35,6 +35,7 @@ jobs: run: | sudo apt-get update sudo apt-get install --yes --no-install-recommends \ + autoconf-archive \ autopoint \ gettext \ help2man \ diff --git a/.github/workflows/linux_and_macos.yml b/.github/workflows/linux_and_macos.yml index e545d34b4..68607660a 100644 --- a/.github/workflows/linux_and_macos.yml +++ b/.github/workflows/linux_and_macos.yml @@ -65,6 +65,7 @@ jobs: # > is to be installed sudo apt-get install --yes --no-install-recommends libunwind-dev sudo apt-get install --yes --no-install-recommends \ + autoconf-archive \ autopoint \ bison \ doxygen \ @@ -93,6 +94,7 @@ jobs: if: runner.os == 'macOS' run: |- brew install \ + autoconf-archive \ automake \ bison \ doxygen \ diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index b34a55dd2..6bf5c27cf 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -23,6 +23,7 @@ jobs: # > is to be installed sudo apt-get install --yes --no-install-recommends libunwind-dev sudo apt-get install --yes --no-install-recommends \ + autoconf-archive \ autopoint \ bison \ doxygen \ diff --git a/libvisual/configure.ac b/libvisual/configure.ac index 4c7382e32..45c2e1b7f 100644 --- a/libvisual/configure.ac +++ b/libvisual/configure.ac @@ -112,6 +112,7 @@ AC_HEADER_DIRENT AC_CHECK_HEADERS([fcntl.h sys/types.h stdlib.h string.h sys/time.h unistd.h sched.h sys/sched.h]) # Checks for typedefs, structures, and compiler characteristics. +AX_CXX_COMPILE_STDCXX_11([noext], [mandatory]) AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T From 8ca262226c80caa9ded3db9c5c963cd887225e71 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 6 Feb 2023 00:19:19 +0100 Subject: [PATCH 5/5] Plugins: Require a C++11 compiler + enable C++11 features Related documentation: https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html --- libvisual-plugins/configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/libvisual-plugins/configure.ac b/libvisual-plugins/configure.ac index 9bc0e5306..66743dde6 100644 --- a/libvisual-plugins/configure.ac +++ b/libvisual-plugins/configure.ac @@ -46,6 +46,7 @@ AC_PROG_CXX dnl Check for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE +AX_CXX_COMPILE_STDCXX_11([noext], [mandatory]) dnl 'Standard' header files. AC_CHECK_HEADERS([fcntl.h unistd.h stdlib.h string.h sys/time.h])