[Scummvm-git-logs] scummvm master -> 39f525beeee68bf065fb3b36cea4693d05efe535

bluegr noreply at scummvm.org
Wed Aug 13 14:53:10 UTC 2025


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
4e079189b1 BUILD: AUDIO: Drop support for Tremolo
1347482c55 AUDIO: BUILD: Mark the MAKE_RAW_STREAM() macro as possibly unnecessary
46adbc28e3 BASE: Remove an old strtol() limitation that was due to WinCE
fe34b2b071 COMMON: Reword a comment of mine regarding <inttypes.h>
39f525beee AUDIO: Remove now useless macro trick


Commit: 4e079189b1dbea5d3cfdf63deeecb7d412abb886
    https://github.com/scummvm/scummvm/commit/4e079189b1dbea5d3cfdf63deeecb7d412abb886
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-08-13T17:53:04+03:00

Commit Message:
BUILD: AUDIO: Drop support for Tremolo

Tremolo was an ARM-optimised fork of Tremor, bringing "better ogg
performance" on WinCE.

But the WinCE port is no more, and there are no other users of this
library.

Changed paths:
    audio/decoders/vorbis.cpp
    base/version.cpp
    configure


diff --git a/audio/decoders/vorbis.cpp b/audio/decoders/vorbis.cpp
index 58bdc35d9aa..be3bf7c108e 100644
--- a/audio/decoders/vorbis.cpp
+++ b/audio/decoders/vorbis.cpp
@@ -36,11 +36,7 @@
 #include "audio/audiostream.h"
 
 #ifdef USE_TREMOR
-#ifdef USE_TREMOLO
-#include <tremolo/ivorbisfile.h>
-#else
 #include <tremor/ivorbisfile.h>
-#endif
 #else
 #define OV_EXCLUDE_STATIC_CALLBACKS
 #include <vorbis/vorbisfile.h>
diff --git a/base/version.cpp b/base/version.cpp
index 2e35544357e..250043cb0fe 100644
--- a/base/version.cpp
+++ b/base/version.cpp
@@ -85,12 +85,7 @@ const char gScummVMFeatures[] = ""
 #endif
 
 #ifdef USE_TREMOR
-#  ifdef USE_TREMOLO
-	// libTremolo is used on WinCE for better ogg performance
-	"Tremolo "
-#  else
 	"Tremor "
-#  endif
 #elif defined(USE_VORBIS)
 	"Vorbis "
 #endif
diff --git a/configure b/configure
index 0d2831fe3b8..da5ac9d8c56 100755
--- a/configure
+++ b/configure
@@ -150,7 +150,6 @@ _sdlnet=auto
 _libcurl=auto
 _enet=yes
 _tremor=auto
-_tremolo=no
 _flac=auto
 _mad=auto
 _opl2lpt=no
@@ -5322,10 +5321,6 @@ echo "$_vorbis"
 # Check for Tremor
 #
 echocheck "Tremor"
-if test "$_tremolo" = yes ; then
-	_tremor=yes
-fi
-
 if test "$_tremor" = auto ; then
 	_tremor=no
 	cat > $TMPC << EOF
@@ -5343,12 +5338,7 @@ fi
 if test "$_tremor" = yes && test "$_vorbis" = no; then
 	add_line_to_config_h '#define USE_TREMOR'
 	add_line_to_config_h '#define USE_VORBIS'
-	if test "$_tremolo" = yes ; then
-		add_line_to_config_h '#define USE_TREMOLO'
-		append_var LIBS "$TREMOR_LIBS -ltremolo"
-	else
-		append_var LIBS "$TREMOR_LIBS -lvorbisidec"
-	fi
+	append_var LIBS "$TREMOR_LIBS -lvorbisidec"
 	append_var INCLUDES "$TREMOR_CFLAGS"
 else
 	if test "$_vorbis" = yes; then


Commit: 1347482c55f4adddcd6ca4d440d43eb1194f2eb1
    https://github.com/scummvm/scummvm/commit/1347482c55f4adddcd6ca4d440d43eb1194f2eb1
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-08-13T17:53:04+03:00

Commit Message:
AUDIO: BUILD: Mark the MAKE_RAW_STREAM() macro as possibly unnecessary

This was introduced a long time ago for the very limited and buggy
compilers used for the WinCE port, but later on this port switched to
a newer compiler, and now that port is no more, anyway (the macro hack
was introduced by commit c55652d4a60ee51dde381417c590fff9a59ecb0d).

Maybe this code could use a template like it originally did. Or maybe
it's just OK was it is (feel free to drop the full comment section
about it, then).

Changed paths:
    audio/decoders/raw.cpp


diff --git a/audio/decoders/raw.cpp b/audio/decoders/raw.cpp
index 37d60c1df4d..52d5c3b9b58 100644
--- a/audio/decoders/raw.cpp
+++ b/audio/decoders/raw.cpp
@@ -178,11 +178,14 @@ bool RawStream<bytesPerSample, isUnsigned, isLE>::seek(const Timestamp &where) {
 
 /* In the following, we use preprocessor / macro tricks to simplify the code
  * which instantiates the input streams. We used to use template functions for
- * this, but MSVC6 / EVC 3-4 (used for WinCE builds) are extremely buggy when it
- * comes to this feature of C++... so as a compromise we use macros to cut down
+ * this, but MSVC6 / EVC 3-4 (used for WinCE builds) were extremely buggy when it
+ * came to this feature of C++... so as a compromise we used macros to cut down
  * on the (source) code duplication a bit.
  * So while normally macro tricks are said to make maintenance harder, in this
  * particular case it should actually help it :-)
+ *
+ * TODO: WinCE and ancient MSVC releases are not supported anymore. Should the
+ * macro tricks introduced in commit c55652d be reverted now?
  */
 
 #define MAKE_RAW_STREAM(UNSIGNED) \


Commit: 46adbc28e3bd86bd8e1f3f470c94ea4f159f2fb3
    https://github.com/scummvm/scummvm/commit/46adbc28e3bd86bd8e1f3f470c94ea4f159f2fb3
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-08-13T17:53:04+03:00

Commit Message:
BASE: Remove an old strtol() limitation that was due to WinCE

The WinCE port is no more, so the strtol() check can use errno again.

This reverts some parts of commit 1b6453dff4dde1e293b62f7fb4ade02507fd31bb.

Changed paths:
    base/commandLine.cpp


diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 3eb74c1dd15..a3bfb6be84b 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -54,6 +54,8 @@
 #include "backends/platform/sdl/sdl-sys.h"
 #endif
 
+#include <errno.h> // For strtol result check
+
 namespace Base {
 
 #ifndef DISABLE_COMMAND_LINE
@@ -551,12 +553,12 @@ bool ensureAccessibleDirectoryForPathOption(Common::FSNode &node,
 	if (!option) usage("Option '%s' requires an argument", argv[isLongCmd ? i : i-1]);
 
 // Use this for options which have a required integer value
-// (we don't check ERANGE because WinCE doesn't support errno, so we're stuck just rejecting LONG_MAX/LONG_MIN..)
 #define DO_OPTION_INT(shortCmd, longCmd) \
 	DO_OPTION(shortCmd, longCmd) \
 	char *endptr; \
+	errno = 0; \
 	long int retval = strtol(option, &endptr, 0); \
-	if (*endptr != '\0' || retval == LONG_MAX || retval == LONG_MIN) \
+	if (*endptr != '\0' || (errno == ERANGE && (retval == LONG_MAX || retval == LONG_MIN))) \
 		usage("--%s: Invalid number '%s'", longCmd, option);
 
 // Use this for boolean options; this distinguishes between "-x" and "-X",


Commit: fe34b2b0711f474f62dd43f9a3a2d16e5bdf5ae5
    https://github.com/scummvm/scummvm/commit/fe34b2b0711f474f62dd43f9a3a2d16e5bdf5ae5
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-08-13T17:53:04+03:00

Commit Message:
COMMON: Reword a comment of mine regarding <inttypes.h>

It's clearer this way.

See earlier commit b79cc6ebfc787b6ff10c1964a75103c32145fc29.

Changed paths:
    common/scummsys.h


diff --git a/common/scummsys.h b/common/scummsys.h
index 744c3c483f4..cff8fc4c63b 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -89,11 +89,10 @@
 	#include <assert.h>
 	#include <ctype.h>
 
-	// The C++11 standard removed the C99 requirement that some <inttypes.h>
-	// features should only be available when the following macros are defined.
-	// But on some systems (such as RISC OS or macOS < 10.7), the system headers
-	// are not necessarily up to date with this change. So, continue defining
-	// them, in order to avoid build failures on some environments.
+	// In C99, the following macros were necessary to get some <inttypes.h>
+	// features we want. The C++11 standard removed this requirement, but in
+	// practice, some systems (such as RISC OS or macOS < 10.7) are not fully
+	// compliant, and still require the old defines.
 	#define __STDC_CONSTANT_MACROS
 	#define __STDC_FORMAT_MACROS
 	#define __STDC_LIMIT_MACROS
@@ -110,6 +109,7 @@
 	#endif
 
 	#include <limits.h>
+
 	// MSVC does not define M_PI, M_SQRT2 and other math defines by default.
 	// _USE_MATH_DEFINES must be defined in order to have these defined, thus
 	// we enable it here. For more information, check:


Commit: 39f525beeee68bf065fb3b36cea4693d05efe535
    https://github.com/scummvm/scummvm/commit/39f525beeee68bf065fb3b36cea4693d05efe535
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-08-13T17:53:04+03:00

Commit Message:
AUDIO: Remove now useless macro trick

Instead use an inline function.

Changed paths:
    audio/decoders/raw.cpp


diff --git a/audio/decoders/raw.cpp b/audio/decoders/raw.cpp
index 52d5c3b9b58..acf97bbb663 100644
--- a/audio/decoders/raw.cpp
+++ b/audio/decoders/raw.cpp
@@ -176,31 +176,28 @@ bool RawStream<bytesPerSample, isUnsigned, isLE>::seek(const Timestamp &where) {
 #pragma mark --- Raw stream factories ---
 #pragma mark -
 
-/* In the following, we use preprocessor / macro tricks to simplify the code
- * which instantiates the input streams. We used to use template functions for
- * this, but MSVC6 / EVC 3-4 (used for WinCE builds) were extremely buggy when it
- * came to this feature of C++... so as a compromise we used macros to cut down
- * on the (source) code duplication a bit.
- * So while normally macro tricks are said to make maintenance harder, in this
- * particular case it should actually help it :-)
- *
- * TODO: WinCE and ancient MSVC releases are not supported anymore. Should the
- * macro tricks introduced in commit c55652d be reverted now?
+/**
+ * The following templated function is a helper to simplify the public makeRawStream function
  */
-
-#define MAKE_RAW_STREAM(UNSIGNED) \
-		if (bytesPerSample == 3) { \
-			if (isLE) \
-				return new RawStream<3, UNSIGNED, true>(rate, isStereo, disposeAfterUse, stream); \
-			else  \
-				return new RawStream<3, UNSIGNED, false>(rate, isStereo, disposeAfterUse, stream); \
-		} else if (bytesPerSample == 2) { \
-			if (isLE) \
-				return new RawStream<2, UNSIGNED, true>(rate, isStereo, disposeAfterUse, stream); \
-			else  \
-				return new RawStream<2, UNSIGNED, false>(rate, isStereo, disposeAfterUse, stream); \
-		} else \
-			return new RawStream<1, UNSIGNED, false>(rate, isStereo, disposeAfterUse, stream)
+template <bool isUnsigned>
+static FORCEINLINE SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream, int rate, bool isStereo, DisposeAfterUse::Flag disposeAfterUse, bool isLE, int bytesPerSample) {
+	switch (bytesPerSample) {
+	case 3:
+		if (isLE) {
+			return new RawStream<3, isUnsigned, true>(rate, isStereo, disposeAfterUse, stream);
+		} else {
+			return new RawStream<3, isUnsigned, false>(rate, isStereo, disposeAfterUse, stream);
+		}
+	case 2:
+		if (isLE) {
+			return new RawStream<2, isUnsigned, true>(rate, isStereo, disposeAfterUse, stream);
+		} else {
+			return new RawStream<2, isUnsigned, false>(rate, isStereo, disposeAfterUse, stream);
+		}
+	default:
+		return new RawStream<1, isUnsigned, false>(rate, isStereo, disposeAfterUse, stream);
+	}
+}
 
 SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream,
 								   int rate, byte flags,
@@ -213,9 +210,9 @@ SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream,
 	assert(stream->size() % (bytesPerSample * (isStereo ? 2 : 1)) == 0);
 
 	if (isUnsigned) {
-		MAKE_RAW_STREAM(true);
+		return makeRawStream<true>(stream, rate, isStereo, disposeAfterUse, isLE, bytesPerSample);
 	} else {
-		MAKE_RAW_STREAM(false);
+		return makeRawStream<false>(stream, rate, isStereo, disposeAfterUse, isLE, bytesPerSample);
 	}
 }
 




More information about the Scummvm-git-logs mailing list