[Scummvm-git-logs] scummvm master -> 87976acad56e59cf3e3e15aa49a81e5c818710db
digitall
noreply at scummvm.org
Wed Jan 1 20:32:26 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
87976acad5 MEDIASTATION: Fix Various GCC Compiler Warnings
Commit: 87976acad56e59cf3e3e15aa49a81e5c818710db
https://github.com/scummvm/scummvm/commit/87976acad56e59cf3e3e15aa49a81e5c818710db
Author: D G Turner (digitall at scummvm.org)
Date: 2025-01-01T20:31:58Z
Commit Message:
MEDIASTATION: Fix Various GCC Compiler Warnings
Changed paths:
engines/mediastation/assetheader.cpp
engines/mediastation/chunk.h
engines/mediastation/context.cpp
engines/mediastation/datum.cpp
engines/mediastation/mediastation.cpp
diff --git a/engines/mediastation/assetheader.cpp b/engines/mediastation/assetheader.cpp
index aefb80ce90e..525f3a0fc4a 100644
--- a/engines/mediastation/assetheader.cpp
+++ b/engines/mediastation/assetheader.cpp
@@ -32,7 +32,7 @@ AssetHeader::AssetHeader(Chunk &chunk) {
// TODO: Cast to an asset type.
_type = AssetType(Datum(chunk).u.i);
_id = Datum(chunk).u.i;
- debugC(4, kDebugLoading, "AssetHeader::AssetHeader(): _type = 0x%x, _id = 0x%x (@0x%llx)", _type, _id, chunk.pos());
+ debugC(4, kDebugLoading, "AssetHeader::AssetHeader(): _type = 0x%x, _id = 0x%x (@0x%llx)", _type, _id, static_cast<long long int>(chunk.pos()));
AssetHeader::SectionType sectionType = getSectionType(chunk);
bool moreSectionsToRead = (AssetHeader::SectionType::EMPTY != sectionType);
@@ -53,7 +53,7 @@ AssetHeader::~AssetHeader() {
}
void AssetHeader::readSection(AssetHeader::SectionType sectionType, Chunk& chunk) {
- debugC(5, kDebugLoading, "AssetHeader::AssetHeader(): sectionType = 0x%x (@0x%llx)", sectionType, chunk.pos());
+ debugC(5, kDebugLoading, "AssetHeader::AssetHeader(): sectionType = 0x%x (@0x%llx)", sectionType, static_cast<long long int>(chunk.pos()));
switch (sectionType) {
case AssetHeader::SectionType::EMPTY: {
break;
@@ -250,7 +250,7 @@ void AssetHeader::readSection(AssetHeader::SectionType sectionType, Chunk& chunk
}
default: {
- error("AssetHeader::readSection(): Unknown section type 0x%x (@0x%llx)", sectionType, chunk.pos());
+ error("AssetHeader::readSection(): Unknown section type 0x%x (@0x%llx)", sectionType, static_cast<long long int>(chunk.pos()));
break;
}
}
@@ -262,4 +262,4 @@ AssetHeader::SectionType AssetHeader::getSectionType(Chunk &chunk) {
return sectionType;
}
-} // end of namespace MediaStation
\ No newline at end of file
+} // end of namespace MediaStation
diff --git a/engines/mediastation/chunk.h b/engines/mediastation/chunk.h
index 1a4eacf906a..2048b3b523f 100644
--- a/engines/mediastation/chunk.h
+++ b/engines/mediastation/chunk.h
@@ -56,7 +56,7 @@ public:
uint32 read(void *dataPtr, uint32 dataSize) {
if (pos() > _dataEndOffset) {
uint overrun = pos() - _dataEndOffset;
- error("Attempted to read 0x%x bytes at a location 0x%x bytes past end of chunk (@0x%llx)", dataSize, overrun, pos());
+ error("Attempted to read 0x%x bytes at a location 0x%x bytes past end of chunk (@0x%llx)", dataSize, overrun, static_cast<long long int>(pos()));
} else {
return _input->read(dataPtr, dataSize);
}
@@ -76,10 +76,10 @@ public:
if (pos() < _dataStartOffset) {
uint overrun = _dataStartOffset - offset;
- error("Attempted to seek 0x%x bytes before start of chunk (@0x%llx)", overrun, pos());
+ error("Attempted to seek 0x%x bytes before start of chunk (@0x%llx)", overrun, static_cast<long long int>(pos()));
} else if (pos() > _dataEndOffset) {
uint overrun = offset - _dataEndOffset;
- error("Attempted to seek 0x%x bytes past end of chunk (@0x%llx)", overrun, pos());
+ error("Attempted to seek 0x%x bytes past end of chunk (@0x%llx)", overrun, static_cast<long long int>(pos()));
}
return true;
}
@@ -90,4 +90,4 @@ public:
} // End of namespace MediaStation
-#endif
\ No newline at end of file
+#endif
diff --git a/engines/mediastation/context.cpp b/engines/mediastation/context.cpp
index bbdb7e8b1af..2657d70b835 100644
--- a/engines/mediastation/context.cpp
+++ b/engines/mediastation/context.cpp
@@ -101,17 +101,17 @@ void Context::readNewStyleHeaderSections(Subfile &subfile, Chunk &chunk) {
// READ THE PALETTE.
bool moreSectionsToRead = (chunk.id == MKTAG('i', 'g', 'o', 'd'));
if (!moreSectionsToRead) {
- warning("Context::readNewStyleHeaderSections(): Got no header sections (@0x%llx)", chunk.pos());
+ warning("Context::readNewStyleHeaderSections(): Got no header sections (@0x%llx)", static_cast<long long int>(chunk.pos()));
}
while (moreSectionsToRead) {
// VERIFY THIS CHUNK IS A HEADER.
// TODO: What are the situations when it's not?
uint16 sectionType = Datum(chunk, DatumType::UINT16_1).u.i;
- debugC(5, kDebugLoading, "Context::readNewStyleHeaderSections(): sectionType = 0x%x (@0x%llx)", sectionType, chunk.pos());
+ debugC(5, kDebugLoading, "Context::readNewStyleHeaderSections(): sectionType = 0x%x (@0x%llx)", sectionType, static_cast<long long int>(chunk.pos()));
bool chunkIsHeader = (sectionType == 0x000d);
if (!chunkIsHeader) {
- error("Context::readNewStyleHeaderSections(): Expected header chunk, got %s (@0x%llx)", tag2str(chunk.id), chunk.pos());
+ error("Context::readNewStyleHeaderSections(): Expected header chunk, got %s (@0x%llx)", tag2str(chunk.id), static_cast<long long int>(chunk.pos()));
}
// READ THIS HEADER SECTION.
@@ -119,12 +119,12 @@ void Context::readNewStyleHeaderSections(Subfile &subfile, Chunk &chunk) {
if (subfile.atEnd()) {
break;
} else {
- debugC(5, kDebugLoading, "\nContext::readNewStyleHeaderSections(): Getting next chunk (@0x%llx)", chunk.pos());
+ debugC(5, kDebugLoading, "\nContext::readNewStyleHeaderSections(): Getting next chunk (@0x%llx)", static_cast<long long int>(chunk.pos()));
chunk = subfile.nextChunk();
moreSectionsToRead = (chunk.id == MKTAG('i', 'g', 'o', 'd'));
}
}
- debugC(5, kDebugLoading, "Context::readNewStyleHeaderSections(): Finished reading sections (@0x%llx)", chunk.pos());
+ debugC(5, kDebugLoading, "Context::readNewStyleHeaderSections(): Finished reading sections (@0x%llx)", static_cast<long long int>(chunk.pos()));
}
void Context::readAssetInFirstSubfile(Chunk &chunk) {
@@ -137,9 +137,9 @@ void Context::readAssetInFirstSubfile(Chunk &chunk) {
// TODO: Make sure this is not an asset link.
Asset *asset = g_engine->_assetsByChunkReference.getValOrDefault(chunk.id);
if (asset == nullptr) {
- error("Context::readAssetInFirstSubfile(): Asset for chunk \"%s\" (0x%x) does not exist or has not been read yet in this title. (@0x%llx)", tag2str(chunk.id), chunk.id, chunk.pos());
+ error("Context::readAssetInFirstSubfile(): Asset for chunk \"%s\" (0x%x) does not exist or has not been read yet in this title. (@0x%llx)", tag2str(chunk.id), chunk.id, static_cast<long long int>(chunk.pos()));
}
- debugC(5, kDebugLoading, "\nContext::readAssetInFirstSubfile(): Got asset with chunk ID %s in first subfile (type: 0x%x) (@0x%llx)", tag2str(chunk.id), asset->type(), chunk.pos());
+ debugC(5, kDebugLoading, "\nContext::readAssetInFirstSubfile(): Got asset with chunk ID %s in first subfile (type: 0x%x) (@0x%llx)", tag2str(chunk.id), asset->type(), static_cast<long long int>(chunk.pos()));
asset->readChunk(chunk);
}
@@ -147,19 +147,19 @@ void Context::readAssetFromLaterSubfile(Subfile &subfile) {
Chunk chunk = subfile.nextChunk();
Asset *asset = g_engine->_assetsByChunkReference.getValOrDefault(chunk.id);
if (asset == nullptr) {
- error("Context::readAssetFromLaterSubfile(): Asset for chunk \"%s\" (0x%x) does not exist or has not been read yet in this title. (@0x%llx)", tag2str(chunk.id), chunk.id, chunk.pos());
+ error("Context::readAssetFromLaterSubfile(): Asset for chunk \"%s\" (0x%x) does not exist or has not been read yet in this title. (@0x%llx)", tag2str(chunk.id), chunk.id, static_cast<long long int>(chunk.pos()));
}
- debugC(5, kDebugLoading, "\nContext::readAssetFromLaterSubfile(): Got asset with chunk ID %s in later subfile (type: 0x%x) (@0x%llx)", tag2str(chunk.id), asset->type(), chunk.pos());
+ debugC(5, kDebugLoading, "\nContext::readAssetFromLaterSubfile(): Got asset with chunk ID %s in later subfile (type: 0x%x) (@0x%llx)", tag2str(chunk.id), asset->type(), static_cast<long long int>(chunk.pos()));
asset->readSubfile(subfile, chunk);
}
bool Context::readHeaderSection(Subfile &subfile, Chunk &chunk) {
uint16 sectionType = Datum(chunk, DatumType::UINT16_1).u.i;
- debugC(5, kDebugLoading, "Context::readHeaderSection(): sectionType = 0x%x (@0x%llx)", sectionType, chunk.pos());
+ debugC(5, kDebugLoading, "Context::readHeaderSection(): sectionType = 0x%x (@0x%llx)", sectionType, static_cast<long long int>(chunk.pos()));
switch ((SectionType)sectionType) {
case SectionType::PARAMETERS: {
if (_parameters != nullptr) {
- error("Context::readHeaderSection(): Got multiple parameters (@0x%llx)", chunk.pos());
+ error("Context::readHeaderSection(): Got multiple parameters (@0x%llx)", static_cast<long long int>(chunk.pos()));
}
_parameters = new ContextParameters(chunk);
break;
@@ -172,7 +172,7 @@ bool Context::readHeaderSection(Subfile &subfile, Chunk &chunk) {
case SectionType::PALETTE: {
if (_palette != nullptr) {
- error("Context::readHeaderSection(): Got multiple palettes (@0x%llx)", chunk.pos());
+ error("Context::readHeaderSection(): Got multiple palettes (@0x%llx)", static_cast<long long int>(chunk.pos()));
}
// TODO: Avoid the copying here!
const uint PALETTE_ENTRIES = 256;
@@ -235,7 +235,7 @@ bool Context::readHeaderSection(Subfile &subfile, Chunk &chunk) {
break;
default:
- error("Context::readHeaderSection(): No class for asset type 0x%x (@0x%llx)", header->_type, chunk.pos());
+ error("Context::readHeaderSection(): No class for asset type 0x%x (@0x%llx)", header->_type, static_cast<long long int>(chunk.pos()));
}
if (g_engine->_assets.contains(header->_id)) {
@@ -283,7 +283,7 @@ bool Context::readHeaderSection(Subfile &subfile, Chunk &chunk) {
}
default: {
- error("Context::readHeaderSection(): Unknown section type 0x%x (@0x%llx)", sectionType, chunk.pos());
+ error("Context::readHeaderSection(): Unknown section type 0x%x (@0x%llx)", sectionType, static_cast<long long int>(chunk.pos()));
}
}
diff --git a/engines/mediastation/datum.cpp b/engines/mediastation/datum.cpp
index 3475ec2f51c..ee560656359 100644
--- a/engines/mediastation/datum.cpp
+++ b/engines/mediastation/datum.cpp
@@ -39,13 +39,13 @@ Datum::Datum(Common::SeekableReadStream &chunk) {
Datum::Datum(Common::SeekableReadStream &chunk, DatumType expectedType) {
t = static_cast<DatumType>(chunk.readUint16LE());
if (t != expectedType) {
- error("Datum::Datum(): Expected datum type 0x%x, got 0x%x (@0x%llx)", expectedType, t, chunk.pos());
+ error("Datum::Datum(): Expected datum type 0x%x, got 0x%x (@0x%llx)", expectedType, t, static_cast<long long int>(chunk.pos()));
}
readWithType(chunk);
}
void Datum::readWithType(Common::SeekableReadStream &chunk) {
- debugC(9, kDebugLoading, "Datum::Datum(): Type 0x%x (@0x%llx)", t, chunk.pos());
+ debugC(9, kDebugLoading, "Datum::Datum(): Type 0x%x (@0x%llx)", t, static_cast<long long int>(chunk.pos()));
if (DatumType::UINT8 == t) {
u.i = chunk.readByte();
@@ -97,8 +97,8 @@ void Datum::readWithType(Common::SeekableReadStream &chunk) {
u.chunkRef = chunk.readUint32BE();
} else {
- error("Unknown datum type: 0x%x (@0x%llx)", t, chunk.pos());
+ error("Unknown datum type: 0x%x (@0x%llx)", t, static_cast<long long int>(chunk.pos()));
}
}
-} // End of namespace MediaStation
\ No newline at end of file
+} // End of namespace MediaStation
diff --git a/engines/mediastation/mediastation.cpp b/engines/mediastation/mediastation.cpp
index b0d4b546c42..5ebd389dfa1 100644
--- a/engines/mediastation/mediastation.cpp
+++ b/engines/mediastation/mediastation.cpp
@@ -103,10 +103,10 @@ Common::Error MediaStationEngine::run() {
// LOAD THE ROOT CONTEXT.
// This is because we might have assets that always need to be loaded.
- Context *root = nullptr;
+ //Context *root = nullptr;
uint32 rootContextId = _boot->getRootContextId();
if (rootContextId != 0) {
- root = loadContext(rootContextId);
+ /*root =*/ loadContext(rootContextId);
} else {
warning("MediaStation::run(): Title has no root context");
}
More information about the Scummvm-git-logs
mailing list