From e597ecb14f446e53afa05081390400dc2d08ab5b Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Mon, 21 Aug 2006 21:42:04 +0000 Subject: [PATCH] Oops: there is no such thing as integer math, so we'd better make sure that we don't try to access array element .125 at runtime. The designers of flash need to be suspended over a tank of sharks while people try to write a program in actionscript to reel them in. I bet half the time it compiles into something that just lets those ropes go. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4334 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/io/ArrayMask.as | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/as/com/threerings/io/ArrayMask.as b/src/as/com/threerings/io/ArrayMask.as index 4e1ea74d6..446077edd 100644 --- a/src/as/com/threerings/io/ArrayMask.as +++ b/src/as/com/threerings/io/ArrayMask.as @@ -6,7 +6,7 @@ public class ArrayMask { public function ArrayMask (length :int = 0) { - var mlength :int = length / 8; + var mlength :int = int(length / 8); if (length % 8 != 0) { mlength++; } @@ -19,7 +19,7 @@ public class ArrayMask */ public function setBit (index :int) :void { - _mask[index/8] |= (1 << (index % 8)); + _mask[int(index/8)] |= (1 << (index % 8)); } /** @@ -27,7 +27,7 @@ public class ArrayMask */ public function isSet (index :int) :Boolean { - return (_mask[index/8] & (1 << (index % 8))) != 0; + return (_mask[int(index/8)] & (1 << (index % 8))) != 0; } public function writeTo (out :ObjectOutputStream) :void