[Scummvm-cvs-logs] scummvm master -> 8a52e4bf0055104047afd70ba2c6de0fcb0b630a
bluegr
md5 at scummvm.org
Mon Feb 21 05:39:01 CET 2011
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:
8a52e4bf00 SCI: Throw a warning instead of an error if there ever is a modulus calculation
Commit: 8a52e4bf0055104047afd70ba2c6de0fcb0b630a
https://github.com/scummvm/scummvm/commit/8a52e4bf0055104047afd70ba2c6de0fcb0b630a
Author: md5 (md5 at scummvm.org)
Date: 2011-02-20T20:37:03-08:00
Commit Message:
SCI: Throw a warning instead of an error if there ever is a modulus calculation
with negative numbers in SCI0 games older than 0.000.685
Changed paths:
engines/sci/engine/vm_types.cpp
diff --git a/engines/sci/engine/vm_types.cpp b/engines/sci/engine/vm_types.cpp
index 58ac7f0..dea4d63 100644
--- a/engines/sci/engine/vm_types.cpp
+++ b/engines/sci/engine/vm_types.cpp
@@ -117,15 +117,12 @@ reg_t reg_t::operator%(const reg_t right) const {
if (isNumber() && right.isNumber()) {
// Support for negative numbers was added in Iceman, and perhaps in
// SCI0 0.000.685 and later. Theoretically, this wasn't really used
- // in SCI0, so if we do find such a case, error out on purpose here,
- // so that we address it properly, as the result is probably
- // unpredictable. Such a case would indicate either a script bug, or
- // a modulo on an unsigned integer larger than 32767. In any case,
- // such a case should be investigated, instead of being silently
- // accepted.
+ // in SCI0, so the result is probably unpredictable. Such a case
+ // would indicate either a script bug, or a modulo on an unsigned
+ // integer larger than 32767. In any case, such a case should be
+ // investigated, instead of being silently accepted.
if (getSciVersion() <= SCI_VERSION_0_LATE && (toSint16() < 0 || right.toSint16() < 0))
- error("Modulo of a negative number has been requested for SCI0. "
- "Please report this error to the ScummVM team");
+ warning("Modulo of a negative number has been requested for SCI0. This *could* lead to issues");
int16 value = toSint16();
int16 modulo = ABS(right.toSint16());
int16 result = (modulo != 0 ? value % modulo : 0);
More information about the Scummvm-git-logs
mailing list