[M3commit] CVS Update: cm3
Jay Krell
jkrell at elego.de
Wed Feb 10 14:09:59 CET 2010
CVSROOT: /usr/cvs
Changes by: jkrell at birch. 10/02/10 14:09:59
Modified files:
cm3/m3-sys/m3middle/src/: TInt.m3
Log message:
Index: m3middle/src/TInt.m3
===================================================================
RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/TInt.m3,v
retrieving revision 1.21
diff -u -r1.21 TInt.m3
--- m3middle/src/TInt.m3 10 Feb 2010 13:03:07 -0000 1.21
+++ m3middle/src/TInt.m3 10 Feb 2010 13:09:01 -0000
@@ -116,8 +116,9 @@
VAR n := MIN (a.n, b.n); carry := 0; r_sign := Sign.Bad;
a_sign := CheckSign (a, n); b_sign := CheckSign (b, n);
BEGIN
- IF a_sign = Sign.Bad THEN RETURN FALSE END;
- IF b_sign = Sign.Bad THEN RETURN FALSE END;
+ IF (a_sign = Sign.Bad) OR (b_sign = Sign.Bad) THEN
+ RETURN FALSE
+ END;
r.n := n;
FOR i := 0 TO n-1 DO
carry := a.x[i] + b.x[i] + carry;
@@ -133,8 +134,9 @@
VAR n := MIN (a.n, b.n); borrow := 0; r_sign := Sign.Bad;
a_sign := CheckSign (a, n); b_sign := CheckSign (b, n);
BEGIN
- IF a_sign = Sign.Bad THEN RETURN FALSE END;
- IF b_sign = Sign.Bad THEN RETURN FALSE END;
+ IF (a_sign = Sign.Bad) OR (b_sign = Sign.Bad) THEN
+ RETURN FALSE
+ END;
r.n := n;
FOR i := 0 TO n-1 DO
borrow := a.x[i] - b.x[i] - borrow;
@@ -167,8 +169,9 @@
p := ARRAY [0.. 2 * NUMBER (IBytes) - 1] OF IByte {0, ..};
a_sign := CheckSign (a, n); b_sign := CheckSign (b, n);
BEGIN
- IF a_sign = Sign.Bad THEN RETURN FALSE END;
- IF b_sign = Sign.Bad THEN RETURN FALSE END;
+ IF (a_sign = Sign.Bad) OR (b_sign = Sign.Bad) THEN
+ RETURN FALSE
+ END;
FOR i := 0 TO n-1 DO
FOR j := 0 TO n-1 DO
k := i + j;
@@ -228,8 +231,9 @@
b_sign := CheckSign (b, n);
min: Int;
BEGIN
- IF a_sign = Sign.Bad THEN RETURN FALSE END;
- IF b_sign = Sign.Bad THEN RETURN FALSE END;
+ IF (a_sign = Sign.Bad) OR (b_sign = Sign.Bad) THEN
+ RETURN FALSE
+ END;
IF EQ (b, Zero) THEN RETURN FALSE; END;
IF EQ (a, Zero) THEN q := Zero; r := Zero; RETURN TRUE; END;
@@ -294,8 +298,9 @@
PROCEDURE EQ (READONLY a, b: Int): BOOLEAN =
VAR n := MIN (a.n, b.n);
BEGIN
- IF CheckSign (a, n) = Sign.Bad THEN RETURN FALSE END;
- IF CheckSign (b, n) = Sign.Bad THEN RETURN FALSE END;
+ IF (CheckSign (a, n) = Sign.Bad) OR (CheckSign (b, n) = Sign.Bad) THEN
+ RETURN FALSE;
+ END;
FOR i := 0 TO n-1 DO
IF a.x[i] # b.x[i] THEN RETURN FALSE; END;
END;
More information about the M3commit
mailing list