[Scummvm-git-logs] scummvm master -> c26a2222574d80888f04e98598bcb12347fca404
digitall
noreply at scummvm.org
Mon Aug 25 13:18:46 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
c26a222257 MACVENTURE: Remove Unecessary Construct Causing GCC Warnings
Commit: c26a2222574d80888f04e98598bcb12347fca404
https://github.com/scummvm/scummvm/commit/c26a2222574d80888f04e98598bcb12347fca404
Author: D G Turner (digitall at scummvm.org)
Date: 2025-08-25T14:15:44+01:00
Commit Message:
MACVENTURE: Remove Unecessary Construct Causing GCC Warnings
In Javascript, doing a bitwise inclusive OR with zero is a trick to
ensure that the value is numeric. This is not required in C/C++.
Changed paths:
engines/macventure/macventure.cpp
engines/macventure/sound.cpp
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index 7c3f27fac10..c9fb7dc7a7d 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -674,7 +674,7 @@ Item MacVentureEngine::removeOutlier(Layout &layout, bool flag, Common::Rect rec
max = flag ? 0x7fff : -0x8000;
}
if (first || oob) {
- int center = childBounds.width() / 2 | 0;
+ int center = childBounds.width() / 2;
bool over = false;
if (flag) {
over = (max >= center);
@@ -792,7 +792,7 @@ void MacVentureEngine::cleanUp(WindowReference reference) {
Item toAdd;
toAdd.id = outlier.id;
- toAdd.bounds = Common::Rect(Common::Point(x, y + (height - outlier.bounds.height()) / 2 | 0),
+ toAdd.bounds = Common::Rect(Common::Point(x, y + (height - outlier.bounds.height()) / 2),
outlier.bounds.width(), outlier.bounds.height());
items.push_back(toAdd);
@@ -815,13 +815,13 @@ void MacVentureEngine::messUp(WindowReference reference) {
if (scale < 0)
scale = 0;
float f = randBetween(0, 10) / 10.0f;
- int y = ((int)(f * scale) | 0) + data.bounds.top;
+ int y = (int)(f * scale) + data.bounds.top;
scale = data.bounds.width() - childMeasures.x;
if (scale < 0)
scale = 0;
f = randBetween(0, 10) / 10.0f;
- int x = ((int)(f * scale) | 0) + data.bounds.left;
+ int x = (int)(f * scale) + data.bounds.left;
items.push_back(Item{child.obj, Common::Rect(Common::Point(x, y), childMeasures.x, childMeasures.y)});
}
diff --git a/engines/macventure/sound.cpp b/engines/macventure/sound.cpp
index c7da695e3e5..ace88d9a577 100644
--- a/engines/macventure/sound.cpp
+++ b/engines/macventure/sound.cpp
@@ -196,9 +196,7 @@ void SoundAsset::decode18(Common::SeekableReadStream *stream) {
wavtable.push_back(stream->readByte());
}
_length = stream->readUint32BE() * 2;
- //Unused
- stream->readUint16BE();
- // TODO: It had `| 0` at the end of this line, possible source of bugs.
+ stream->readUint16BE(); // Unused
_frequency = (stream->readUint32BE() * 22100 / 0x10000);
byte ch = 0;
for (uint i = 0; i < _length; i++) {
More information about the Scummvm-git-logs
mailing list