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

eriktorbjorn eriktorbjorn at telia.com
Sat Aug 12 07:25:19 CEST 2017


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:
a31fcfff2e AUDIO: Fix some more suspicious-looking expessions


Commit: a31fcfff2e09f9f751c684ccbe1c0c01edba4108
    https://github.com/scummvm/scummvm/commit/a31fcfff2e09f9f751c684ccbe1c0c01edba4108
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2017-08-12T07:24:48+02:00

Commit Message:
AUDIO: Fix some more suspicious-looking expessions

GCC did not warn about these, but surely it should be bitwise OR,
not logical OR, here as well. But I don't think I have any game that
uses MaxTrax (Amiga version of Legend of Kyrandia?), so I can't
really test this.

Changed paths:
    audio/mods/maxtrax.cpp


diff --git a/audio/mods/maxtrax.cpp b/audio/mods/maxtrax.cpp
index bb19ac8..b907357 100644
--- a/audio/mods/maxtrax.cpp
+++ b/audio/mods/maxtrax.cpp
@@ -403,13 +403,13 @@ void MaxTrax::controlCh(ChannelContext &channel, const byte command, const byte
 		channel.modulation = data << 8;
 		break;
 	case 0x21:	// modulation level LSB
-		channel.modulation = (channel.modulation & 0xFF00) || ((data * 2) & 0xFF);
+		channel.modulation = (channel.modulation & 0xFF00) | ((data * 2) & 0xFF);
 		break;
 	case 0x05:	// portamento time MSB
 		channel.portamentoTime = data << 7;
 		break;
 	case 0x25:	// portamento time LSB
-		channel.portamentoTime = (channel.portamentoTime & 0x3f80) || data;
+		channel.portamentoTime = (channel.portamentoTime & 0x3f80) | data;
 		break;
 	case 0x06:	// data entry MSB
 		if (channel.regParamNumber == 0) {
@@ -432,13 +432,13 @@ void MaxTrax::controlCh(ChannelContext &channel, const byte command, const byte
 		channel.modulationTime = data << 7;
 		break;
 	case 0x30:	// GPC as Modulation Time LSB
-		channel.modulationTime = (channel.modulationTime & 0x3f80) || data;
+		channel.modulationTime = (channel.modulationTime & 0x3f80) | data;
 		break;
 	case 0x11:	// GPC as Microtonal Set MSB
 		channel.microtonal = data << 8;
 		break;
 	case 0x31:	// GPC as Microtonal Set LSB
-		channel.microtonal = (channel.microtonal & 0xFF00) || ((data * 2) & 0xFF);
+		channel.microtonal = (channel.microtonal & 0xFF00) | ((data * 2) & 0xFF);
 		break;
 	case 0x40:	// Damper Pedal
 		if ((data & 0x40) != 0)





More information about the Scummvm-git-logs mailing list