[Scummvm-git-logs] scummvm master -> c9c13f49d8e6810aa56004684d55d16803648a5d

sev- sev at scummvm.org
Sat Aug 7 08:46:21 UTC 2021


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

Summary:
84de72ac76 MACOSX: fix deprecation warnings
b7e6d61669 JANITORIAL: Fix compiler warnings about unused code
5c78ae2e5f AGS: fix incorrect use of delete, should be delete[]
1d7d03bd6e AUDIO: fix global constructor warnings
c9731fccd0 GLK: fix global constructor warnings
445fe63524 GRIM: fix global constructor warnings
5bd265637b ULTIMA: fix global constructor warnings
c9c13f49d8 GRAPHICS: fix global constructor warnings


Commit: 84de72ac768ee76e08d287523a0fe9fb23535d88
    https://github.com/scummvm/scummvm/commit/84de72ac768ee76e08d287523a0fe9fb23535d88
Author: Max Horn (max at quendi.de)
Date: 2021-08-07T10:46:14+02:00

Commit Message:
MACOSX: fix deprecation warnings

Changed paths:
    backends/dialogs/macosx/macosx-dialogs.mm
    backends/platform/sdl/macosx/macosx_wrapper.mm


diff --git a/backends/dialogs/macosx/macosx-dialogs.mm b/backends/dialogs/macosx/macosx-dialogs.mm
index c33ee0dbad..20e09221f9 100644
--- a/backends/dialogs/macosx/macosx-dialogs.mm
+++ b/backends/dialogs/macosx/macosx-dialogs.mm
@@ -40,6 +40,19 @@
 #include <Foundation/NSURL.h>
 #include <Foundation/NSAutoreleasePool.h>
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101400
+
+    #ifndef NSControlStateValueOff
+      #define NSControlStateValueOff NSOffState
+    #endif
+
+    #ifndef NSControlStateValueOn
+      #define NSControlStateValueOn NSOnState
+    #endif
+
+#define NSButtonTypeSwitch NSSwitchButton
+#endif
+
 
 @interface BrowserDialogPresenter : NSObject {
 @public
@@ -73,7 +86,7 @@
 	NSButton *showHiddenFilesButton = 0;
 	if ([panel respondsToSelector:@selector(setShowsHiddenFiles:)]) {
 		showHiddenFilesButton = [[NSButton alloc] init];
-		[showHiddenFilesButton setButtonType:NSSwitchButton];
+		[showHiddenFilesButton setButtonType:NSButtonTypeSwitch];
 
 		CFStringRef hiddenFilesString = CFStringCreateWithCString(0, _("Show hidden files").encode().c_str(), kCFStringEncodingUTF8);
 		[showHiddenFilesButton setTitle:(NSString*)hiddenFilesString];
@@ -81,10 +94,10 @@
 
 		[showHiddenFilesButton sizeToFit];
 		if (ConfMan.getBool("gui_browser_show_hidden", Common::ConfigManager::kApplicationDomain)) {
-			[showHiddenFilesButton setState:NSOnState];
+			[showHiddenFilesButton setState:NSControlStateValueOn];
 			[panel setShowsHiddenFiles: YES];
 		} else {
-			[showHiddenFilesButton setState:NSOffState];
+			[showHiddenFilesButton setState:NSControlStateValueOff];
 			[panel setShowsHiddenFiles: NO];
 		}
 		[panel setAccessoryView:showHiddenFilesButton];
@@ -110,7 +123,7 @@
 }
 
 - (IBAction) showHiddenFiles : (id) sender {
-	if ([sender state] == NSOnState) {
+	if ([sender state] == NSControlStateValueOn) {
 		[_panel setShowsHiddenFiles: YES];
 		ConfMan.setBool("gui_browser_show_hidden", true, Common::ConfigManager::kApplicationDomain);
 	} else {
diff --git a/backends/platform/sdl/macosx/macosx_wrapper.mm b/backends/platform/sdl/macosx/macosx_wrapper.mm
index cf7964e209..baed506488 100644
--- a/backends/platform/sdl/macosx/macosx_wrapper.mm
+++ b/backends/platform/sdl/macosx/macosx_wrapper.mm
@@ -32,6 +32,10 @@
 #include <AvailabilityMacros.h>
 #include <CoreFoundation/CFString.h>
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
+#define NSPasteboardTypeString NSStringPboardType
+#endif
+
 #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
 typedef unsigned long NSUInteger;
 
@@ -47,16 +51,15 @@ enum {
 #endif
 
 bool hasTextInClipboardMacOSX() {
-	return [[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObject:NSStringPboardType]] != nil;
+	return [[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObject:NSPasteboardTypeString]] != nil;
 }
 
 Common::U32String getTextFromClipboardMacOSX() {
 	if (!hasTextInClipboardMacOSX())
 		return Common::U32String();
-	// Note: on OS X 10.6 and above it is recommended to use NSPasteboardTypeString rather than NSStringPboardType.
-	// But since we still target older version use NSStringPboardType.
+
 	NSPasteboard *pb = [NSPasteboard generalPasteboard];
-	NSString *str = [pb  stringForType:NSStringPboardType];
+	NSString *str = [pb  stringForType:NSPasteboardTypeString];
 	if (str == nil)
 		return Common::U32String();
 
@@ -82,7 +85,7 @@ Common::U32String getTextFromClipboardMacOSX() {
 
 bool setTextInClipboardMacOSX(const Common::U32String &text) {
 	NSPasteboard *pb = [NSPasteboard generalPasteboard];
-	[pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
+	[pb declareTypes:[NSArray arrayWithObject:NSPasteboardTypeString] owner:nil];
 
 #ifdef SCUMM_LITTLE_ENDIAN
 	NSStringEncoding stringEncoding = NSUTF32LittleEndianStringEncoding;
@@ -90,7 +93,7 @@ bool setTextInClipboardMacOSX(const Common::U32String &text) {
 	NSStringEncoding stringEncoding = NSUTF32BigEndianStringEncoding;
 #endif
 	NSString *nsstring = [[NSString alloc] initWithBytes:text.c_str() length:4*text.size() encoding: stringEncoding];
-	bool status =  [pb setString:nsstring forType:NSStringPboardType];
+	bool status =  [pb setString:nsstring forType:NSPasteboardTypeString];
 	[nsstring release];
 	return status;
 }


Commit: b7e6d61669c12db6f8d22484557354bd7987f53f
    https://github.com/scummvm/scummvm/commit/b7e6d61669c12db6f8d22484557354bd7987f53f
Author: Max Horn (max at quendi.de)
Date: 2021-08-07T10:46:14+02:00

Commit Message:
JANITORIAL: Fix compiler warnings about unused code

Changed paths:
    engines/ags/engine/device/mouse_w32.cpp
    engines/ags/engine/gfx/ali_3d_scummvm.h
    engines/ags/engine/platform/base/sys_main.cpp
    engines/ags/engine/script/script_runtime.cpp
    engines/ags/shared/core/asset_manager.cpp
    engines/ags/shared/util/file_stream.cpp
    engines/ags/shared/util/file_stream.h
    engines/grim/emi/sound/emisound.cpp
    engines/saga2/gfx.cpp
    engines/saga2/gfx.h
    engines/saga2/saga2.cpp
    engines/stark/gfx/driver.cpp
    graphics/scaler/edge.cpp


diff --git a/engines/ags/engine/device/mouse_w32.cpp b/engines/ags/engine/device/mouse_w32.cpp
index 9a4491c496..de66106a93 100644
--- a/engines/ags/engine/device/mouse_w32.cpp
+++ b/engines/ags/engine/device/mouse_w32.cpp
@@ -40,7 +40,7 @@ enum {
 	NONE = -1, LEFT = 0, RIGHT = 1, MIDDLE = 2
 };
 
-static const int MB_ARRAY[3] = { 1, 2, 4 };
+// static const int MB_ARRAY[3] = { 1, 2, 4 };
 
 void mgetgraphpos() {
 	// TODO: review and possibly rewrite whole thing;
diff --git a/engines/ags/engine/gfx/ali_3d_scummvm.h b/engines/ags/engine/gfx/ali_3d_scummvm.h
index 13ac002439..c353d7ef24 100644
--- a/engines/ags/engine/gfx/ali_3d_scummvm.h
+++ b/engines/ags/engine/gfx/ali_3d_scummvm.h
@@ -237,9 +237,11 @@ private:
 	PSDLRenderFilter _filter;
 
 	bool _hasGamma = false;
+#ifdef TODO
 	uint16 _defaultGammaRed[256] {};
 	uint16 _defaultGammaGreen[256] {};
 	uint16 _defaultGammaBlue[256] {};
+#endif
 
 	RendererFlip _renderFlip = FLIP_NONE;
 	/*  SDL_Renderer *_renderer = nullptr;
diff --git a/engines/ags/engine/platform/base/sys_main.cpp b/engines/ags/engine/platform/base/sys_main.cpp
index 80253ecf4e..39c34b19d1 100644
--- a/engines/ags/engine/platform/base/sys_main.cpp
+++ b/engines/ags/engine/platform/base/sys_main.cpp
@@ -49,7 +49,9 @@ void sys_set_background_mode(bool on) {
 // ----------------------------------------------------------------------------
 // DISPLAY UTILS
 // ----------------------------------------------------------------------------
+#ifdef TODO
 const int DEFAULT_DISPLAY_INDEX = 0; // TODO: is this always right?
+#endif
 
 int sys_get_desktop_resolution(int &width, int &height) {
 	// TODO: ScummVM has a hardcoded dummy desktop resolution. See if there's any
diff --git a/engines/ags/engine/script/script_runtime.cpp b/engines/ags/engine/script/script_runtime.cpp
index 9e2fcdaf46..07e2f3334b 100644
--- a/engines/ags/engine/script/script_runtime.cpp
+++ b/engines/ags/engine/script/script_runtime.cpp
@@ -47,7 +47,7 @@
 
 namespace AGS3 {
 
-static const char ccRunnerCopyright[] = "ScriptExecuter32 v" SCOM_VERSIONSTR " (c) 2001 Chris Jones";
+// static const char ccRunnerCopyright[] = "ScriptExecuter32 v" SCOM_VERSIONSTR " (c) 2001 Chris Jones";
 
 bool ccAddExternalStaticFunction(const String &name, ScriptAPIFunction *pfn) {
 	return _GP(simp).add(name, RuntimeScriptValue().SetStaticFunction(pfn), nullptr) == 0;
diff --git a/engines/ags/shared/core/asset_manager.cpp b/engines/ags/shared/core/asset_manager.cpp
index 432aff0e47..4e8f9fe954 100644
--- a/engines/ags/shared/core/asset_manager.cpp
+++ b/engines/ags/shared/core/asset_manager.cpp
@@ -42,9 +42,9 @@ AssetLocation::AssetLocation()
 inline static bool IsAssetLibDir(const AssetLibInfo *lib) {
 	return lib->BaseFileName.IsEmpty();
 }
-inline static bool IsAssetLibFile(const AssetLibInfo *lib) {
-	return !lib->BaseFileName.IsEmpty();
-}
+// inline static bool IsAssetLibFile(const AssetLibInfo *lib) {
+// 	return !lib->BaseFileName.IsEmpty();
+// }
 
 bool AssetManager::LibsByPriority::operator()(const AssetLibInfo *lib1, const AssetLibInfo *lib2) const {
 	const bool lib1dir = IsAssetLibDir(lib1);
diff --git a/engines/ags/shared/util/file_stream.cpp b/engines/ags/shared/util/file_stream.cpp
index ff405e3017..4963f81156 100644
--- a/engines/ags/shared/util/file_stream.cpp
+++ b/engines/ags/shared/util/file_stream.cpp
@@ -35,7 +35,7 @@ namespace Shared {
 FileStream::FileStream(const String &file_name, FileOpenMode open_mode, FileWorkMode work_mode,
                        DataEndianess stream_endianess)
 	: DataStream(stream_endianess), _writeBuffer(DisposeAfterUse::YES),
-	  _workMode(work_mode), _openMode(open_mode), _file(nullptr), _outSave(nullptr) {
+	  _workMode(work_mode), _file(nullptr), _outSave(nullptr) {
 	Open(file_name, open_mode, work_mode);
 }
 
diff --git a/engines/ags/shared/util/file_stream.h b/engines/ags/shared/util/file_stream.h
index cd13019b48..39630fb682 100644
--- a/engines/ags/shared/util/file_stream.h
+++ b/engines/ags/shared/util/file_stream.h
@@ -70,7 +70,6 @@ private:
 	void Open(const String &file_name, FileOpenMode open_mode, FileWorkMode work_mode);
 
 	Common::Stream *_file;
-	const FileOpenMode  _openMode;
 	const FileWorkMode  _workMode;
 	Common::MemoryWriteStreamDynamic _writeBuffer;
 	Common::OutSaveFile *_outSave;
diff --git a/engines/grim/emi/sound/emisound.cpp b/engines/grim/emi/sound/emisound.cpp
index 70859b9085..84d43deb04 100644
--- a/engines/grim/emi/sound/emisound.cpp
+++ b/engines/grim/emi/sound/emisound.cpp
@@ -49,7 +49,7 @@ EMISound *g_emiSound = nullptr;
 
 extern uint16 imuseDestTable[];
 
-MusicEntry emiPS2MusicTable[] = {
+static MusicEntry emiPS2MusicTable[] = {
 	{ 0, 0, 0, 127, 0, "", "", "" },
 	{ 0, 0, 1, 127, 1, "state", "", "1115.scx" },
 	{ 0, 0, 2, 127, 2, "state", "", "1170.scx" },
diff --git a/engines/saga2/gfx.cpp b/engines/saga2/gfx.cpp
index dfc870dcd8..78b572569e 100644
--- a/engines/saga2/gfx.cpp
+++ b/engines/saga2/gfx.cpp
@@ -28,7 +28,7 @@
 
 namespace Saga2 {
 
-Renderer::Renderer(Saga2Engine *vm) : _vm(vm) {
+Renderer::Renderer() {
 	for (int i = 0; i < kMaxBackBufferSources; ++i) {
 		_savedBackBuffers[i] = nullptr;
 	}
diff --git a/engines/saga2/gfx.h b/engines/saga2/gfx.h
index 59c2d14c60..6bca9cdab4 100644
--- a/engines/saga2/gfx.h
+++ b/engines/saga2/gfx.h
@@ -35,12 +35,10 @@ enum BackBufferSource {
 
 class Renderer : public Common::NonCopyable {
 private:
-	Saga2Engine *_vm;
-
 	byte *_savedBackBuffers[kMaxBackBufferSources];
 	
 public:
-	Renderer(Saga2Engine *vm);
+	Renderer();
 	~Renderer();
 
 	void saveBackBuffer(BackBufferSource source);
diff --git a/engines/saga2/saga2.cpp b/engines/saga2/saga2.cpp
index 96e92c90fe..0335d65d1c 100644
--- a/engines/saga2/saga2.cpp
+++ b/engines/saga2/saga2.cpp
@@ -136,7 +136,7 @@ Common::Error Saga2Engine::run() {
 	_console = new Console(this);
 	setDebugger(_console);
 
-	_renderer = new Renderer(this);
+	_renderer = new Renderer();
 
 	readConfig();
 
diff --git a/engines/stark/gfx/driver.cpp b/engines/stark/gfx/driver.cpp
index a577d5aa48..604d88a687 100644
--- a/engines/stark/gfx/driver.cpp
+++ b/engines/stark/gfx/driver.cpp
@@ -51,8 +51,6 @@ Driver *Driver::create() {
 		initGraphics(kOriginalWidth, kOriginalHeight, nullptr);
 #if defined(USE_OPENGL_GAME) || defined(USE_OPENGL_SHADERS) || defined(USE_GLES2)
 	}
-	bool backendCapableOpenGL = g_system->hasFeature(OSystem::kFeatureOpenGLForGame);
-	bool backendCapableOpenGLShaders = backendCapableOpenGL && OpenGLContext.shadersSupported;
 #endif
 
 	if (matchingRendererType != desiredRendererType && desiredRendererType != Graphics::kRendererTypeDefault) {
@@ -63,11 +61,13 @@ Driver *Driver::create() {
 	Driver *driver = nullptr;
 
 #if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+	bool backendCapableOpenGLShaders = g_system->hasFeature(OSystem::kFeatureOpenGLForGame) && OpenGLContext.shadersSupported;
 	if (backendCapableOpenGLShaders && matchingRendererType == Graphics::kRendererTypeOpenGLShaders) {
 		driver = new OpenGLSDriver();
 	}
 #endif
 #if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
+	bool backendCapableOpenGL = g_system->hasFeature(OSystem::kFeatureOpenGLForGame);
 	if (backendCapableOpenGL && matchingRendererType == Graphics::kRendererTypeOpenGL) {
 		driver = new OpenGLDriver();
 	}
diff --git a/graphics/scaler/edge.cpp b/graphics/scaler/edge.cpp
index 4447ac00ec..feee835f16 100644
--- a/graphics/scaler/edge.cpp
+++ b/graphics/scaler/edge.cpp
@@ -124,7 +124,7 @@
 #define RGB_SHIFT 13            /* bit shift for RGB precision */
 
 static const int16 one_sqrt2 = (int16)(((int16)1 << GREY_SHIFT) / sqrt(2.0) + 0.5);
-static const int16 int32_sqrt3 = (int16)(((int16)1 << GREY_SHIFT) * sqrt(3.0) + 0.5);
+// static const int16 int32_sqrt3 = (int16)(((int16)1 << GREY_SHIFT) * sqrt(3.0) + 0.5);
 
 
 #define interpolate_1_1(a,b)         (ColorMask::kBytesPerPixel == 2 ? interpolate16_1_1<ColorMask>(a,b) : interpolate32_1_1<ColorMask>(a,b))


Commit: 5c78ae2e5fea10f904bb537ae9b12be8d8e654f9
    https://github.com/scummvm/scummvm/commit/5c78ae2e5fea10f904bb537ae9b12be8d8e654f9
Author: Max Horn (max at quendi.de)
Date: 2021-08-07T10:46:14+02:00

Commit Message:
AGS: fix incorrect use of delete, should be delete[]

Changed paths:
    engines/ags/shared/util/string_utils.cpp


diff --git a/engines/ags/shared/util/string_utils.cpp b/engines/ags/shared/util/string_utils.cpp
index 5f5bb9155f..db972a42e9 100644
--- a/engines/ags/shared/util/string_utils.cpp
+++ b/engines/ags/shared/util/string_utils.cpp
@@ -92,7 +92,7 @@ String StrUtil::Unescape(const String &s) {
 	}
 	*pb = 0;
 	String dst(buf);
-	delete buf;
+	delete [] buf;
 	return dst;
 }
 


Commit: 1d7d03bd6e908d0989346aec3b0f46bd87016cee
    https://github.com/scummvm/scummvm/commit/1d7d03bd6e908d0989346aec3b0f46bd87016cee
Author: Max Horn (max at quendi.de)
Date: 2021-08-07T10:46:14+02:00

Commit Message:
AUDIO: fix global constructor warnings

Changed paths:
    audio/decoders/asf.cpp


diff --git a/audio/decoders/asf.cpp b/audio/decoders/asf.cpp
index df246efcc9..d4d8067daa 100644
--- a/audio/decoders/asf.cpp
+++ b/audio/decoders/asf.cpp
@@ -40,19 +40,12 @@ public:
 		stream.read(id, 16);
 	}
 
-	ASFGUID(byte a0, byte a1, byte a2, byte a3, byte a4, byte a5, byte a6, byte a7, byte a8, byte a9, byte a10, byte a11, byte a12, byte a13, byte a14, byte a15) {
-		id[0]  = a0;   id[1]  = a1;  id[2]  = a2;  id[3]  = a3;
-		id[4]  = a4;   id[5]  = a5;  id[6]  = a6;  id[7]  = a7;
-		id[8]  = a8;   id[9]  = a9;  id[10] = a10; id[11] = a11;
-		id[12] = a12;  id[13] = a13; id[14] = a14; id[15] = a15;
+	bool operator==(const byte gid[16]) const {
+		return !memcmp(gid, id, 16);
 	}
 
-	bool operator==(const ASFGUID &g) const {
-		return !memcmp(g.id, id, 16);
-	}
-
-	bool operator!=(const ASFGUID &g) const {
-		return memcmp(g.id, id, 16);
+	bool operator!=(const byte gid[16]) const {
+		return memcmp(gid, id, 16);
 	}
 
 	Common::String toString() const {
@@ -65,16 +58,16 @@ private:
 };
 
 // GUID's that we need
-static const ASFGUID s_asfHeader         = ASFGUID(0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C);
-static const ASFGUID s_asfFileHeader     = ASFGUID(0xA1, 0xDC, 0xAB, 0x8C, 0x47, 0xA9, 0xCF, 0x11, 0x8E, 0xE4, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65);
-static const ASFGUID s_asfHead1          = ASFGUID(0xb5, 0x03, 0xbf, 0x5f, 0x2E, 0xA9, 0xCF, 0x11, 0x8e, 0xe3, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65);
-static const ASFGUID s_asfComment        = ASFGUID(0x33, 0x26, 0xb2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c);
-static const ASFGUID s_asfStreamHeader   = ASFGUID(0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65);
-static const ASFGUID s_asfCodecComment   = ASFGUID(0x40, 0x52, 0xD1, 0x86, 0x1D, 0x31, 0xD0, 0x11, 0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6);
-static const ASFGUID s_asfDataHeader     = ASFGUID(0x36, 0x26, 0xb2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c);
-static const ASFGUID s_asfAudioStream    = ASFGUID(0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B);
-static const ASFGUID s_asfExtendedHeader = ASFGUID(0x40, 0xA4, 0xD0, 0xD2, 0x07, 0xE3, 0xD2, 0x11, 0x97, 0xF0, 0x00, 0xA0, 0xC9, 0x5E, 0xA8, 0x50);
-static const ASFGUID s_asfStreamBitRate  = ASFGUID(0xce, 0x75, 0xf8, 0x7b, 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2);
+static const byte s_asfHeader[16]         = { 0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C };
+static const byte s_asfFileHeader[16]     = { 0xA1, 0xDC, 0xAB, 0x8C, 0x47, 0xA9, 0xCF, 0x11, 0x8E, 0xE4, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65 };
+static const byte s_asfHead1[16]          = { 0xb5, 0x03, 0xbf, 0x5f, 0x2E, 0xA9, 0xCF, 0x11, 0x8e, 0xe3, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 };
+static const byte s_asfComment[16]        = { 0x33, 0x26, 0xb2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c };
+static const byte s_asfStreamHeader[16]   = { 0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65 };
+static const byte s_asfCodecComment[16]   = { 0x40, 0x52, 0xD1, 0x86, 0x1D, 0x31, 0xD0, 0x11, 0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6 };
+static const byte s_asfDataHeader[16]     = { 0x36, 0x26, 0xb2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c };
+static const byte s_asfAudioStream[16]    = { 0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B };
+static const byte s_asfExtendedHeader[16] = { 0x40, 0xA4, 0xD0, 0xD2, 0x07, 0xE3, 0xD2, 0x11, 0x97, 0xF0, 0x00, 0xA0, 0xC9, 0x5E, 0xA8, 0x50 };
+static const byte s_asfStreamBitRate[16]  = { 0xce, 0x75, 0xf8, 0x7b, 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2 };
 
 class ASFStream : public SeekableAudioStream {
 public:


Commit: c9731fccd05c0d02fc9da4af7c89f90101f77500
    https://github.com/scummvm/scummvm/commit/c9731fccd05c0d02fc9da4af7c89f90101f77500
Author: Max Horn (max at quendi.de)
Date: 2021-08-07T10:46:14+02:00

Commit Message:
GLK: fix global constructor warnings

Changed paths:
    engines/glk/archetype/archetype.h
    engines/glk/archetype/heap_sort.cpp
    engines/glk/archetype/heap_sort.h
    engines/glk/archetype/id_table.cpp
    engines/glk/quest/geas_file.cpp
    engines/glk/quest/geas_util.cpp
    engines/glk/quest/geas_util.h


diff --git a/engines/glk/archetype/archetype.h b/engines/glk/archetype/archetype.h
index f6d9871009..807fafb714 100644
--- a/engines/glk/archetype/archetype.h
+++ b/engines/glk/archetype/archetype.h
@@ -51,6 +51,12 @@ private:
 	winid_t _mainWindow;
 	String _lastOutputText;
 public:
+	// heapsort.cpp
+	XArrayType H;
+
+	// id_table.cpp
+	XArrayType h_index;
+
 	// keywords.cpp
 	XArrayType Literals, Vocabulary;
 	XArrayType Type_ID_List, Object_ID_List, Attribute_ID_List;
diff --git a/engines/glk/archetype/heap_sort.cpp b/engines/glk/archetype/heap_sort.cpp
index 91ff33a1e1..d57a6c54f8 100644
--- a/engines/glk/archetype/heap_sort.cpp
+++ b/engines/glk/archetype/heap_sort.cpp
@@ -30,18 +30,15 @@ namespace Archetype {
 const char *const CANT_PEEK = "Internal error:  cannot peek into heap";
 const char *const CANT_POKE = "Internal error:  cannot poke into heap";
 
-// FIXME: This requires global constructor
-HeapType H;
-
 void heap_sort_init() {
-	new_xarray(H);
+	g_vm->H.clear();
 }
 
 static bool lighter(const Element one, const Element two) {
 	return *static_cast<StringPtr>(one) < *static_cast<StringPtr>(two);
 }
 
-static void heapup() {
+static void heapup(HeapType &H) {
 	int L, parent;
 	Element Lp, parentp = nullptr;
 	Element temp;
@@ -67,7 +64,7 @@ static void heapup() {
 	}
 }
 
-static void heapdown() {
+static void heapdown(HeapType &H) {
 	uint L, compare, lc, rc;
 	Element lp;
 	Element lcp, rcp;
@@ -114,6 +111,7 @@ static void heapdown() {
 }
 
 bool pop_heap(Element &e) {
+	HeapType &H = g_vm->H;
 	Element temp;
 
 	if (H.empty()) {
@@ -124,25 +122,20 @@ bool pop_heap(Element &e) {
 			g_vm->writeln(CANT_PEEK);
 
 		shrink_xarray(H);
-		heapdown();
+		heapdown(H);
 		return true;
 	}
 }
 
-void drop_on_heap(Element e) {
-	append_to_xarray(H, e);
-	heapup();
-}
-
 void drop_str_on_heap(const String &s) {
 	StringPtr sp = NewDynStr(s);
 	void *p = (void *)sp;
-	drop_on_heap(p);
+	append_to_xarray(g_vm->H, p);
+	heapup(g_vm->H);
 }
 
 void reinit_heap() {
-	dispose_xarray(H);
-	new_xarray(H);
+	g_vm->H.clear();
 }
 
 } // End of namespace Archetype
diff --git a/engines/glk/archetype/heap_sort.h b/engines/glk/archetype/heap_sort.h
index 5e2512407f..8fc7974c1b 100644
--- a/engines/glk/archetype/heap_sort.h
+++ b/engines/glk/archetype/heap_sort.h
@@ -32,12 +32,9 @@ namespace Archetype {
 typedef XArrayType HeapType;
 typedef void *Element;
 
-extern HeapType H;
-
 // Public methods
 extern void heap_sort_init();
 extern bool pop_heap(Element &e);
-extern void drop_on_heap(Element e);
 extern void drop_str_on_heap(const String &s);
 extern void reinit_heap();
 
diff --git a/engines/glk/archetype/id_table.cpp b/engines/glk/archetype/id_table.cpp
index 0b1160708f..2a6709b607 100644
--- a/engines/glk/archetype/id_table.cpp
+++ b/engines/glk/archetype/id_table.cpp
@@ -22,6 +22,7 @@
 
 #include "glk/archetype/id_table.h"
 #include "glk/archetype/array.h"
+#include "glk/archetype/archetype.h"
 
 namespace Glk {
 namespace Archetype {
@@ -29,9 +30,7 @@ namespace Archetype {
 ClassifyType DefaultClassification;
 
 // Static variables
-IdRecPtr hash[BUCKETS];
-// FIXME: This requires global constructor
-XArrayType h_index;
+static IdRecPtr hash[BUCKETS];
 
 int add_ident(const String &id_str) {
 	int hasher;
@@ -47,16 +46,16 @@ int add_ident(const String &id_str) {
 
 	if (p->next == nullptr || *p->next->id_name > id_str) {
 		new_rec = new IdRecType();
-		append_to_xarray(h_index, new_rec);
+		append_to_xarray(g_vm->h_index, new_rec);
 
 		new_rec->id_kind    = DefaultClassification;
-		new_rec->id_index   = h_index.size();
+		new_rec->id_index   = g_vm->h_index.size();
 		new_rec->id_integer = new_rec->id_index;
 		new_rec->id_name    = NewConstStr(id_str);
 		new_rec->next       = p->next;
 
 		p->next = new_rec;
-		return h_index.size();
+		return g_vm->h_index.size();
 	} else {
 		// found existing identifier
 		return p->next->id_index;
@@ -65,7 +64,7 @@ int add_ident(const String &id_str) {
 
 bool index_ident(int index, IdRecPtr &id_ptr) {
 	void *p;
-	bool result = index_xarray(h_index, index, p);
+	bool result = index_xarray(g_vm->h_index, index, p);
 	id_ptr = (IdRecPtr)p;
 	return result;
 }
diff --git a/engines/glk/quest/geas_file.cpp b/engines/glk/quest/geas_file.cpp
index bdca19594d..1226e95268 100644
--- a/engines/glk/quest/geas_file.cpp
+++ b/engines/glk/quest/geas_file.cpp
@@ -37,7 +37,7 @@ void report_error(const String &s);
 reserved_words obj_tag_property("look", "examine", "speak", "take", "alias", "prefix", "suffix", "detail", "displaytype", "gender", "article", "hidden", "invisible", (char *) NULL);
 
 // FIXME: This requires global constructor
-reserved_words room_tag_property("look", "alias", "prefix", "indescription", "description", "north", "south", "east", "west", "northwest", "northeast", "southeast", "southwest", "up", "down", "out", (char *) NULL);
+//reserved_words room_tag_property("look", "alias", "prefix", "indescription", "description", "north", "south", "east", "west", "northwest", "northeast", "southeast", "southwest", "up", "down", "out", (char *) NULL);
 
 void GeasFile::debug_print(String s) const {
 	if (gi == NULL)
diff --git a/engines/glk/quest/geas_util.cpp b/engines/glk/quest/geas_util.cpp
index 6e7c8003e7..f35dfc4800 100644
--- a/engines/glk/quest/geas_util.cpp
+++ b/engines/glk/quest/geas_util.cpp
@@ -206,7 +206,7 @@ void show_split(String s) {
 	cerr << "\n";
 }
 
-Logger::Nullstreambuf Logger::cnull;
+// Logger::Nullstreambuf Logger::cnull;
 
 Logger::Logger() { // : logfilestr_(NULL), cerrbuf_(NULL) {
 /*
diff --git a/engines/glk/quest/geas_util.h b/engines/glk/quest/geas_util.h
index cf77f2427c..e17d5e4721 100644
--- a/engines/glk/quest/geas_util.h
+++ b/engines/glk/quest/geas_util.h
@@ -88,7 +88,7 @@ private:
 
 //	Common::WriteStream *logfilestr_;
 //	std::streambuf *cerrbuf_;
-	static Nullstreambuf cnull;
+// 	static Nullstreambuf cnull;
 };
 
 } // End of namespace Quest


Commit: 445fe63524e15121efd23893fc61f67f692e312a
    https://github.com/scummvm/scummvm/commit/445fe63524e15121efd23893fc61f67f692e312a
Author: Max Horn (max at quendi.de)
Date: 2021-08-07T10:46:14+02:00

Commit Message:
GRIM: fix global constructor warnings

Since now `_musicTable` always points to a an array allocated
via `new[]`, we can also simplify the `EMISound` destructor.

Changed paths:
    engines/grim/emi/sound/emisound.cpp


diff --git a/engines/grim/emi/sound/emisound.cpp b/engines/grim/emi/sound/emisound.cpp
index 84d43deb04..e29e442595 100644
--- a/engines/grim/emi/sound/emisound.cpp
+++ b/engines/grim/emi/sound/emisound.cpp
@@ -49,133 +49,139 @@ EMISound *g_emiSound = nullptr;
 
 extern uint16 imuseDestTable[];
 
-static MusicEntry emiPS2MusicTable[] = {
-	{ 0, 0, 0, 127, 0, "", "", "" },
-	{ 0, 0, 1, 127, 1, "state", "", "1115.scx" },
-	{ 0, 0, 2, 127, 2, "state", "", "1170.scx" },
-	{ 0, 0, 2, 127, 3, "state", "", "1170.scx" },
-	{ 0, 0, 2, 127, 4, "state", "", "1170.scx" },
-	{ 0, 0, 3, 127, 5, "state", "", "1165.scx" },
-	{ 0, 0, 4, 127, 6, "state", "", "1145.scx" },
-	{ 0, 0, 4, 127, 7, "state", "", "1145.scx" },
-	{ 0, 0, 1, 127, 8, "state", "", "1115.scx" },
-	{ 0, 0, 1, 127, 9, "state", "", "1115.scx" },
-	{ 0, 0, 0, 127, 10, "episode", "", "7200.scx" },
-	{ 0, 0, 0, 127, 11, "episode", "", "1210.scx" },
-	{ 0, 0, 0, 127, 12, "state", "", "1180.scx" },
-	{ 0, 0, 0, 127, 13, "state", "", "1110.scx" },
-	{ 0, 0, 1, 127, 14, "state", "", "1115.scx" },
-	{ 0, 0, 0, 127, 15, "state", "", "1105.scx" },
-	{ 0, 0, 4, 127, 16, "state", "", "1145.scx" },
-	{ 0, 0, 0, 127, 17, "state", "", "1150.scx" },
-	{ 0, 0, 0, 127, 18, "state", "", "1100.scx" },
-	{ 0, 0, 5, 127, 19, "state", "", "1120.scx" },
-	{ 0, 0, 5, 127, 20, "state", "", "1120.scx" },
-	{ 0, 0, 5, 127, 21, "state", "", "1120.scx" },
-	{ 0, 0, 3, 127, 22, "state", "", "1165.scx" },
-	{ 0, 0, 0, 127, 23, "state", "", "1155.scx" },
-	{ 0, 0, 0, 127, 24, "state", "", "1160.scx" },
-	{ 0, 0, 0, 127, 25, "state", "", "1140.scx" },
-	{ 0, 0, 0, 127, 26, "state", "", "1140.scx" },
-	{ 0, 0, 2, 127, 27, "state", "", "1170.scx" },
-	{ 0, 0, 2, 127, 28, "state", "", "1175.scx" },
-	{ 0, 0, 0, 127, 29, "episode", "", "1205.scx" },
-	{ 0, 0, 0, 127, 30, "state", "", "1000.scx" },
-	{ 0, 0, 0, 127, 31, "state", "", "1185.scx" },
-	{ 0, 0, 0, 127, 32, "state", "", "2127.scx" },
-	{ 0, 0, 0, 127, 33, "state", "", "2119.scx" },
-	{ 0, 0, 0, 127, 34, "episode", "", "2208.scx" },
-	{ 0, 0, 0, 127, 35, "state", "", "2195.scx" },
-	{ 0, 0, 0, 127, 36, "state", "", "2190.scx" },
-	{ 0, 0, 0, 127, 37, "state", "", "2185.scx" },
-	{ 0, 0, 1, 127, 38, "state", "", "2175.scx" },
-	{ 0, 0, 0, 127, 39, "state", "", "2170.scx" },
-	{ 0, 0, 0, 127, 40, "state", "", "2165.scx" },
-	{ 0, 0, 0, 127, 41, "state", "", "2160.scx" },
-	{ 0, 0, 0, 127, 42, "state", "", "2155.scx" },
-	{ 0, 0, 0, 127, 43, "state", "", "2120.scx" },
-	{ 0, 0, 0, 127, 44, "state", "", "2150.scx" },
-	{ 0, 0, 0, 127, 45, "state", "", "2145.scx" },
-	{ 0, 0, 2, 127, 46, "state", "", "2105.scx" },
-	{ 0, 0, 0, 127, 47, "state", "", "2115.scx" },
-	{ 0, 0, 0, 127, 48, "state", "", "2125.scx" },
-	{ 0, 0, 0, 127, 49, "state", "", "2130.scx" },
-	{ 0, 0, 0, 127, 50, "state", "", "2100.scx" },
-	{ 0, 0, 0, 127, 51, "state", "", "2140.scx" },
-	{ 0, 0, 0, 127, 52, "episode", "", "2200.scx" },
-	{ 0, 0, 0, 127, 53, "state", "", "2116.scx" },
-	{ 0, 0, 0, 127, 54, "episode", "", "2207.scx" },
-	{ 0, 0, 0, 127, 55, "state", "", "2107.scx" },
-	{ 0, 0, 0, 127, 56, "episode", "", "2215.scx" },
-	{ 0, 0, 0, 127, 57, "episode", "", "2220.scx" },
-	{ 0, 0, 0, 127, 58, "episode", "", "2225.scx" },
-	{ 0, 0, 0, 127, 59, "episode", "", "2210.scx" },
-	{ 0, 0, 0, 127, 60, "state", "", "2135.scx" },
-	{ 0, 0, 2, 127, 61, "state", "", "2105.scx" },
-	{ 0, 0, 0, 127, 62, "state", "", "2108.scx" },
-	{ 0, 0, 0, 127, 63, "state", "", "2117.scx" },
-	{ 0, 0, 0, 127, 64, "state", "", "2118.scx" },
-	{ 0, 0, 1, 127, 65, "state", "", "2175.scx" },
-	{ 0, 0, 0, 127, 66, "state", "", "4120.scx" },
-	{ 0, 0, 1, 127, 67, "state", "", "3100.scx" },
-	{ 0, 0, 0, 127, 68, "state", "", "4115.scx" },
-	{ 0, 0, 2, 127, 69, "state", "", "4100.scx" },
-	{ 0, 0, 0, 127, 70, "state", "", "3150.scx" },
-	{ 0, 0, 0, 127, 71, "state", "", "3145.scx" },
-	{ 0, 0, 0, 127, 72, "state", "", "4110.scx" },
-	{ 0, 0, 0, 127, 73, "state", "", "3140.scx" },
-	{ 0, 0, 3, 127, 74, "state", "", "3135.scx" },
-	{ 0, 0, 3, 127, 75, "state", "", "3120.scx" },
-	{ 0, 0, 4, 127, 76, "state", "", "3130.scx" },
-	{ 0, 0, 4, 127, 77, "state", "", "3115.scx" },
-	{ 0, 0, 1, 127, 78, "state", "", "3100.scx" },
-	{ 0, 0, 5, 127, 79, "state", "", "3125.scx" },
-	{ 0, 0, 5, 127, 80, "state", "", "3110.scx" },
-	{ 0, 0, 6, 127, 81, "state", "", "3105.scx" },
-	{ 0, 0, 0, 127, 82, "episode", "", "3210.scx" },
-	{ 0, 0, 0, 127, 83, "episode", "", "3200.scx" },
-	{ 0, 0, 0, 127, 84, "episode", "", "3205.scx" },
-	{ 0, 0, 0, 127, 85, "state", "", "3147.scx" },
-	{ 0, 0, 0, 127, 86, "episode", "", "4215.scx" },
-	{ 0, 0, 0, 127, 87, "state", "", "4105.scx" },
-	{ 0, 0, 6, 127, 88, "state", "", "3106.scx" },
-	{ 0, 0, 6, 127, 89, "state", "", "3107.scx" },
-	{ 0, 0, 2, 127, 90, "state", "", "4100.scx" },
-	{ 0, 0, 1, 127, 91, "state", "", "5145.scx" },
-	{ 0, 0, 2, 127, 92, "state", "", "5140.scx" },
-	{ 0, 0, 2, 127, 93, "state", "", "5140.scx" },
-	{ 0, 0, 3, 127, 94, "state", "", "5135.scx" },
-	{ 0, 0, 3, 127, 95, "state", "", "5135.scx" },
-	{ 0, 0, 3, 127, 96, "state", "", "5135.scx" },
-	{ 0, 0, 0, 127, 97, "state", "", "5170.scx" },
-	{ 0, 0, 0, 127, 98, "episode", "", "5205.scx" },
-	{ 0, 0, 0, 127, 99, "state", "", "5120.scx" },
-	{ 0, 0, 0, 127, 100, "episode", "", "5215.scx" },
-	{ 0, 0, 0, 127, 101, "episode", "", "5230.scx" },
-	{ 0, 0, 0, 127, 102, "episode", "", "5225.scx" },
-	{ 0, 0, 0, 127, 103, "state", "", "5117.scx" },
-	{ 0, 0, 0, 127, 104, "state", "", "5115.scx" },
-	{ 0, 0, 0, 127, 105, "episode", "", "5220.scx" },
-	{ 0, 0, 0, 127, 106, "state", "", "6105.scx" },
-	{ 0, 0, 0, 127, 107, "state", "", "6100.scx" },
-	{ 0, 0, 0, 127, 108, "state", "", "5165.scx" },
-	{ 0, 0, 0, 127, 109, "state", "", "5160.scx" },
-	{ 0, 0, 0, 127, 110, "episode", "", "5200.scx" },
-	{ 0, 0, 2, 127, 111, "state", "", "5140.scx" },
-	{ 0, 0, 3, 127, 112, "state", "", "5135.scx" },
-	{ 0, 0, 0, 127, 113, "state", "", "5155.scx" },
-	{ 0, 0, 0, 127, 114, "state", "", "5150.scx" },
-	{ 0, 0, 0, 127, 115, "state", "", "5130.scx" },
-	{ 0, 0, 0, 127, 116, "state", "", "5125.scx" },
-	{ 0, 0, 0, 127, 117, "state", "", "5110.scx" },
-	{ 0, 0, 1, 127, 118, "state", "", "5105.scx" },
-	{ 0, 0, 0, 127, 119, "state", "", "5100.scx" },
-	{ 0, 0, 0, 127, 120, "state", "", "6110.scx" },
-	{ 0, 0, 0, 127, 121, "state", "", "5106.scx" },
-	{ 0, 0, 0, 127, 122, "episode", "", "7210.scx" },
-	{ 0, 0, 0, 127, 123, "episode", "", "1200.scx" },
-	{ 0, 0, 0, 127, 124, "state", "", "1195.scx" },
-	{ 0, 0, 0, 127, 125, "episode", "", "1215.scx" }
+struct PlainMusicEntry {
+	int sync;
+	const char * type;
+	const char * filename;
+};
+
+static PlainMusicEntry emiPS2MusicTable[126] = {
+	{ 0, "", "" },
+	{ 1, "state", "1115.scx" },
+	{ 2, "state", "1170.scx" },
+	{ 2, "state", "1170.scx" },
+	{ 2, "state", "1170.scx" },
+	{ 3, "state", "1165.scx" },
+	{ 4, "state", "1145.scx" },
+	{ 4, "state", "1145.scx" },
+	{ 1, "state", "1115.scx" },
+	{ 1, "state", "1115.scx" },
+	{ 0, "episode", "7200.scx" },
+	{ 0, "episode", "1210.scx" },
+	{ 0, "state", "1180.scx" },
+	{ 0, "state", "1110.scx" },
+	{ 1, "state", "1115.scx" },
+	{ 0, "state", "1105.scx" },
+	{ 4, "state", "1145.scx" },
+	{ 0, "state", "1150.scx" },
+	{ 0, "state", "1100.scx" },
+	{ 5, "state", "1120.scx" },
+	{ 5, "state", "1120.scx" },
+	{ 5, "state", "1120.scx" },
+	{ 3, "state", "1165.scx" },
+	{ 0, "state", "1155.scx" },
+	{ 0, "state", "1160.scx" },
+	{ 0, "state", "1140.scx" },
+	{ 0, "state", "1140.scx" },
+	{ 2, "state", "1170.scx" },
+	{ 2, "state", "1175.scx" },
+	{ 0, "episode", "1205.scx" },
+	{ 0, "state", "1000.scx" },
+	{ 0, "state", "1185.scx" },
+	{ 0, "state", "2127.scx" },
+	{ 0, "state", "2119.scx" },
+	{ 0, "episode", "2208.scx" },
+	{ 0, "state", "2195.scx" },
+	{ 0, "state", "2190.scx" },
+	{ 0, "state", "2185.scx" },
+	{ 1, "state", "2175.scx" },
+	{ 0, "state", "2170.scx" },
+	{ 0, "state", "2165.scx" },
+	{ 0, "state", "2160.scx" },
+	{ 0, "state", "2155.scx" },
+	{ 0, "state", "2120.scx" },
+	{ 0, "state", "2150.scx" },
+	{ 0, "state", "2145.scx" },
+	{ 2, "state", "2105.scx" },
+	{ 0, "state", "2115.scx" },
+	{ 0, "state", "2125.scx" },
+	{ 0, "state", "2130.scx" },
+	{ 0, "state", "2100.scx" },
+	{ 0, "state", "2140.scx" },
+	{ 0, "episode", "2200.scx" },
+	{ 0, "state", "2116.scx" },
+	{ 0, "episode", "2207.scx" },
+	{ 0, "state", "2107.scx" },
+	{ 0, "episode", "2215.scx" },
+	{ 0, "episode", "2220.scx" },
+	{ 0, "episode", "2225.scx" },
+	{ 0, "episode", "2210.scx" },
+	{ 0, "state", "2135.scx" },
+	{ 2, "state", "2105.scx" },
+	{ 0, "state", "2108.scx" },
+	{ 0, "state", "2117.scx" },
+	{ 0, "state", "2118.scx" },
+	{ 1, "state", "2175.scx" },
+	{ 0, "state", "4120.scx" },
+	{ 1, "state", "3100.scx" },
+	{ 0, "state", "4115.scx" },
+	{ 2, "state", "4100.scx" },
+	{ 0, "state", "3150.scx" },
+	{ 0, "state", "3145.scx" },
+	{ 0, "state", "4110.scx" },
+	{ 0, "state", "3140.scx" },
+	{ 3, "state", "3135.scx" },
+	{ 3, "state", "3120.scx" },
+	{ 4, "state", "3130.scx" },
+	{ 4, "state", "3115.scx" },
+	{ 1, "state", "3100.scx" },
+	{ 5, "state", "3125.scx" },
+	{ 5, "state", "3110.scx" },
+	{ 6, "state", "3105.scx" },
+	{ 0, "episode", "3210.scx" },
+	{ 0, "episode", "3200.scx" },
+	{ 0, "episode", "3205.scx" },
+	{ 0, "state", "3147.scx" },
+	{ 0, "episode", "4215.scx" },
+	{ 0, "state", "4105.scx" },
+	{ 6, "state", "3106.scx" },
+	{ 6, "state", "3107.scx" },
+	{ 2, "state", "4100.scx" },
+	{ 1, "state", "5145.scx" },
+	{ 2, "state", "5140.scx" },
+	{ 2, "state", "5140.scx" },
+	{ 3, "state", "5135.scx" },
+	{ 3, "state", "5135.scx" },
+	{ 3, "state", "5135.scx" },
+	{ 0, "state", "5170.scx" },
+	{ 0, "episode", "5205.scx" },
+	{ 0, "state", "5120.scx" },
+	{ 0, "episode", "5215.scx" },
+	{ 0, "episode", "5230.scx" },
+	{ 0, "episode", "5225.scx" },
+	{ 0, "state", "5117.scx" },
+	{ 0, "state", "5115.scx" },
+	{ 0, "episode", "5220.scx" },
+	{ 0, "state", "6105.scx" },
+	{ 0, "state", "6100.scx" },
+	{ 0, "state", "5165.scx" },
+	{ 0, "state", "5160.scx" },
+	{ 0, "episode", "5200.scx" },
+	{ 2, "state", "5140.scx" },
+	{ 3, "state", "5135.scx" },
+	{ 0, "state", "5155.scx" },
+	{ 0, "state", "5150.scx" },
+	{ 0, "state", "5130.scx" },
+	{ 0, "state", "5125.scx" },
+	{ 0, "state", "5110.scx" },
+	{ 1, "state", "5105.scx" },
+	{ 0, "state", "5100.scx" },
+	{ 0, "state", "6110.scx" },
+	{ 0, "state", "5106.scx" },
+	{ 0, "episode", "7210.scx" },
+	{ 0, "episode", "1200.scx" },
+	{ 0, "state", "1195.scx" },
+	{ 0, "episode", "1215.scx" }
 };
 
 void EMISound::timerHandler(void *refCon) {
@@ -199,9 +205,7 @@ EMISound::~EMISound() {
 	freePlayingSounds();
 	freeLoadedSounds();
 	delete _musicTrack;
-	if (g_grim->getGamePlatform() != Common::kPlatformPS2) {
-		delete[] _musicTable;
-	}
+	delete[] _musicTable;
 }
 
 EMISound::TrackList::iterator EMISound::getPlayingTrackByName(const Common::String &name) {
@@ -663,8 +667,18 @@ void EMISound::initMusicTable() {
 		_musicTable = initMusicTableDemo("Music/FullMonkeyMap.imt");
 		_musicPrefix = "Music/";
 	} else if (g_grim->getGamePlatform() == Common::kPlatformPS2) {
-		_musicTable = emiPS2MusicTable;
-		_numMusicStates = ARRAYSIZE(emiPS2MusicTable);
+		STATIC_ASSERT(ARRAYSIZE(emiPS2MusicTable) == 126, emiPS2MusicTable_bad_size);
+		_numMusicStates = 126;
+		_musicTable = new MusicEntry[126];
+		for (int i = 0; i < 126; ++i) {
+			_musicTable[i]._x = 0;
+			_musicTable[i]._y = 0;
+			_musicTable[i]._sync = emiPS2MusicTable[i].sync;
+			_musicTable[i]._trim = 127;
+			_musicTable[i]._id = i;
+			_musicTable[i]._type = emiPS2MusicTable[i].type;
+			_musicTable[i]._filename = emiPS2MusicTable[i].filename;
+		}
 		_musicPrefix = "";
 	} else {
 		MusicEntry *musicTable = new MusicEntry[126];


Commit: 5bd265637badcf17851d615e547a2d1fdfef07ec
    https://github.com/scummvm/scummvm/commit/5bd265637badcf17851d615e547a2d1fdfef07ec
Author: Max Horn (max at quendi.de)
Date: 2021-08-07T10:46:14+02:00

Commit Message:
ULTIMA: fix global constructor warnings

This also makes the code independent of the user's locale (being
dependent on that by accident can lead to difficult to track down bugs)

The list of whitespace used now is what the C standard guarantees as
minimal set of characters accepted by `isspace` as whitespace.

Changed paths:
    engines/ultima/nuvie/keybinding/keys.cpp


diff --git a/engines/ultima/nuvie/keybinding/keys.cpp b/engines/ultima/nuvie/keybinding/keys.cpp
index 44023814ad..c787b32f47 100644
--- a/engines/ultima/nuvie/keybinding/keys.cpp
+++ b/engines/ultima/nuvie/keybinding/keys.cpp
@@ -41,15 +41,7 @@
 namespace Ultima {
 namespace Nuvie {
 
-static  class Chardata { // ctype-like character lists
-public:
-	string  whitespace;
-	Chardata() {
-		for (size_t i = 0; i < 256; i++)
-			if (Common::isSpace(i))
-				whitespace += static_cast<char>(i);
-	}
-} chardata;
+static const char * whitespace = "\t\n\v\f\r ";
 
 typedef void(*ActionFunc)(int const *);
 
@@ -453,7 +445,7 @@ void KeyBinder::ParseText(char *text, int len) {
 }
 
 static void skipspace(string &s) {
-	size_t i = s.findFirstNotOf(chardata.whitespace);
+	size_t i = s.findFirstNotOf(whitespace);
 	if (i && i != string::npos)
 		s.erase(0, i);
 }
@@ -494,7 +486,7 @@ void KeyBinder::ParseLine(char *line) {
 			s.erase(0, 6);
 			u.erase(0, 6);
 		} else {
-			i = s.findFirstOf(chardata.whitespace);
+			i = s.findFirstOf(whitespace);
 
 			keycode = s.substr(0, i);
 			s.erase(0, i);
@@ -532,7 +524,7 @@ void KeyBinder::ParseLine(char *line) {
 	// get function
 	skipspace(s);
 
-	i = s.findFirstOf(chardata.whitespace);
+	i = s.findFirstOf(whitespace);
 	string t = s.substr(0, i);
 	s.erase(0, i);
 	t = Std::to_uppercase(t);
@@ -550,7 +542,7 @@ void KeyBinder::ParseLine(char *line) {
 
 	int np = 0;
 	while (!s.empty() && s[0] != '#' && np < c_maxparams) {
-		i = s.findFirstOf(chardata.whitespace);
+		i = s.findFirstOf(whitespace);
 		string tmp = s.substr(0, i);
 		s.erase(0, i);
 		skipspace(s);


Commit: c9c13f49d8e6810aa56004684d55d16803648a5d
    https://github.com/scummvm/scummvm/commit/c9c13f49d8e6810aa56004684d55d16803648a5d
Author: Max Horn (max at quendi.de)
Date: 2021-08-07T10:46:14+02:00

Commit Message:
GRAPHICS: fix global constructor warnings

Arguably it's better to use a hard code constant anyway, as the result
of sqrt(2) can vary between platforms (not that it is likely to matter
in practice ;-) ).

Changed paths:
    graphics/scaler/edge.cpp


diff --git a/graphics/scaler/edge.cpp b/graphics/scaler/edge.cpp
index feee835f16..9cfff79654 100644
--- a/graphics/scaler/edge.cpp
+++ b/graphics/scaler/edge.cpp
@@ -123,7 +123,8 @@
 #define GREY_SHIFT 12           /* bit shift for greyscale precision */
 #define RGB_SHIFT 13            /* bit shift for RGB precision */
 
-static const int16 one_sqrt2 = (int16)(((int16)1 << GREY_SHIFT) / sqrt(2.0) + 0.5);
+#define SQRT2 1.41421356237309504880
+static const int16 one_sqrt2 = (int16)(((int16)1 << GREY_SHIFT) / SQRT2 + 0.5);
 // static const int16 int32_sqrt3 = (int16)(((int16)1 << GREY_SHIFT) * sqrt(3.0) + 0.5);
 
 




More information about the Scummvm-git-logs mailing list