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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user