Some changes required for the new compiler.
- Import bleeding may be fixed, as I had to import a bunch of things I should have had to earlier. - NOW they make duplicate variable definitions bad (but without block scoping... yay). - Another hoopjump. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4233 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -27,6 +27,7 @@ import com.threerings.util.ArrayUtil;
|
||||
import com.threerings.util.HashMap;
|
||||
import com.threerings.util.Map;
|
||||
import com.threerings.util.ResultListener;
|
||||
import com.threerings.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.client.BasicDirector;
|
||||
import com.threerings.presents.client.Client;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.threerings.crowd.chat.client {
|
||||
|
||||
import com.threerings.util.Name;
|
||||
import com.threerings.util.ResultAdapter;
|
||||
import com.threerings.util.ResultListener;
|
||||
import com.threerings.util.StringUtil;
|
||||
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.threerings.io {
|
||||
|
||||
import flash.errors.IOError;
|
||||
import flash.errors.MemoryError;
|
||||
|
||||
import flash.utils.ByteArray;
|
||||
import flash.utils.IDataInput;
|
||||
|
||||
@@ -26,15 +26,15 @@ public class Streamer
|
||||
|
||||
initStreamers();
|
||||
|
||||
for each (var streamer :Streamer in _streamers) {
|
||||
var streamer :Streamer;
|
||||
for each (streamer in _streamers) {
|
||||
if (streamer.isStreamerFor(obj)) {
|
||||
return streamer;
|
||||
}
|
||||
}
|
||||
|
||||
if (obj is TypedArray) {
|
||||
var streamer :Streamer = new ArrayStreamer(
|
||||
(obj as TypedArray).getJavaType());
|
||||
streamer = new ArrayStreamer((obj as TypedArray).getJavaType());
|
||||
_streamers.push(streamer);
|
||||
return streamer;
|
||||
}
|
||||
@@ -68,7 +68,8 @@ public class Streamer
|
||||
initStreamers();
|
||||
|
||||
// see if we have a streamer for it
|
||||
for each (var streamer :Streamer in _streamers) {
|
||||
var streamer :Streamer;
|
||||
for each (streamer in _streamers) {
|
||||
if (streamer.getJavaClassName() === jname) {
|
||||
return streamer;
|
||||
}
|
||||
@@ -76,7 +77,7 @@ public class Streamer
|
||||
|
||||
// see if it's an array that we unstream using an ArrayStreamer
|
||||
if (jname.charAt(0) === "[") {
|
||||
var streamer :Streamer = new ArrayStreamer(jname);
|
||||
streamer = new ArrayStreamer(jname);
|
||||
_streamers.push(streamer);
|
||||
return streamer;
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.threerings.io.streamers {
|
||||
|
||||
import com.threerings.util.ClassUtil;
|
||||
|
||||
import com.threerings.io.ArrayMask;
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.Streamer;
|
||||
import com.threerings.io.Translations;
|
||||
import com.threerings.io.TypedArray;
|
||||
|
||||
/**
|
||||
@@ -75,22 +77,23 @@ public class ArrayStreamer extends Streamer
|
||||
:void
|
||||
{
|
||||
var arr :Array = (obj as Array);
|
||||
var ii :int;
|
||||
out.writeInt(arr.length);
|
||||
if (_elementType == int) {
|
||||
for (var ii :int = 0; ii < arr.length; ii++) {
|
||||
for (ii = 0; ii < arr.length; ii++) {
|
||||
out.writeInt(arr[ii] as int);
|
||||
}
|
||||
|
||||
} else if (_isFinal) {
|
||||
var mask :ArrayMask = new ArrayMask(arr.length);
|
||||
for (var ii :int = 0; ii < arr.length; ii++) {
|
||||
for (ii = 0; ii < arr.length; ii++) {
|
||||
if (arr[ii] != null) {
|
||||
mask.setBit(ii);
|
||||
}
|
||||
}
|
||||
mask.writeTo(out);
|
||||
// now write the populated elements
|
||||
for (var ii :int = 0; ii < arr.length; ii++) {
|
||||
for (ii = 0; ii < arr.length; ii++) {
|
||||
var element :Object = arr[ii];
|
||||
if (element != null) {
|
||||
out.writeBareObjectImpl(element, _delegate);
|
||||
@@ -98,7 +101,7 @@ public class ArrayStreamer extends Streamer
|
||||
}
|
||||
|
||||
} else {
|
||||
for (var ii :int = 0; ii < arr.length; ii++) {
|
||||
for (ii = 0; ii < arr.length; ii++) {
|
||||
out.writeObject(arr[ii]);
|
||||
}
|
||||
}
|
||||
@@ -108,15 +111,16 @@ public class ArrayStreamer extends Streamer
|
||||
:void
|
||||
{
|
||||
var arr :Array = (obj as Array);
|
||||
var ii :int;
|
||||
if (_elementType == int) {
|
||||
for (var ii :int = 0; ii < arr.length; ii++) {
|
||||
for (ii = 0; ii < arr.length; ii++) {
|
||||
arr[ii] = ins.readInt();
|
||||
}
|
||||
|
||||
} else if (_isFinal) {
|
||||
var mask :ArrayMask = new ArrayMask();
|
||||
mask.readFrom(ins);
|
||||
for (var ii :int = 0; ii < length; ii++) {
|
||||
for (ii = 0; ii < length; ii++) {
|
||||
if (mask.isSet(ii)) {
|
||||
var target :Object;
|
||||
if (_delegate == null) {
|
||||
@@ -130,7 +134,7 @@ public class ArrayStreamer extends Streamer
|
||||
}
|
||||
|
||||
} else {
|
||||
for (var ii :int = 0; ii < arr.length; ii++) {
|
||||
for (ii = 0; ii < arr.length; ii++) {
|
||||
arr[ii] = ins.readObject();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,9 +30,11 @@ import mx.collections.IList;
|
||||
import com.threerings.util.ClassUtil;
|
||||
import com.threerings.util.HashMap;
|
||||
|
||||
import com.threerings.presents.dobj.CompoundEvent;
|
||||
import com.threerings.presents.dobj.DEvent;
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.dobj.DObjectManager;
|
||||
import com.threerings.presents.dobj.ObjectAccessError;
|
||||
import com.threerings.presents.dobj.ObjectDestroyedEvent;
|
||||
import com.threerings.presents.dobj.Subscriber;
|
||||
|
||||
@@ -214,8 +216,8 @@ public class ClientDObjectMgr
|
||||
}
|
||||
|
||||
} else if (obj is FailureResponse) {
|
||||
var oid :int = (obj as FailureResponse).getOid();
|
||||
notifyFailure(oid);
|
||||
var foid :int = (obj as FailureResponse).getOid();
|
||||
notifyFailure(foid);
|
||||
|
||||
} else if (obj is PongResponse) {
|
||||
_client.gotPong(obj as PongResponse);
|
||||
|
||||
@@ -14,6 +14,8 @@ import com.threerings.presents.dobj.DSet;
|
||||
import com.threerings.presents.dobj.EventListener;
|
||||
import com.threerings.presents.dobj.InvocationNotificationEvent;
|
||||
import com.threerings.presents.dobj.InvocationRequestEvent;
|
||||
import com.threerings.presents.dobj.InvocationResponseEvent;
|
||||
import com.threerings.presents.dobj.MessageEvent;
|
||||
import com.threerings.presents.dobj.ObjectAccessError;
|
||||
import com.threerings.presents.dobj.Subscriber;
|
||||
import com.threerings.presents.dobj.SubscriberAdapter;
|
||||
|
||||
@@ -25,6 +25,7 @@ import mx.utils.ObjectUtil;
|
||||
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.dobj.DSet;
|
||||
import com.threerings.presents.dobj.DSet_Entry;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
@@ -43,13 +43,9 @@ public class CompoundEvent extends DEvent
|
||||
public function CompoundEvent (
|
||||
target :DObject = null, omgr :DObjectManager = null)
|
||||
{
|
||||
if (target == null) {
|
||||
super();
|
||||
return;
|
||||
}
|
||||
|
||||
super(target.getOid());
|
||||
super((target == null) ? 0 : target.getOid());
|
||||
|
||||
if (target != null) {
|
||||
// sanity check
|
||||
if (omgr == null) {
|
||||
throw new ArgumentError(
|
||||
@@ -60,6 +56,7 @@ public class CompoundEvent extends DEvent
|
||||
_target = target;
|
||||
_events = new StreamableArrayList();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Posts an event to this transaction. The event will be delivered as
|
||||
|
||||
@@ -76,7 +76,8 @@ public class ClassUtil
|
||||
|
||||
// See which classes we extend.
|
||||
var exts :XMLList = typeInfo.child("extendsClass").attribute("type");
|
||||
for each (var type :String in exts) {
|
||||
var type :String;
|
||||
for each (type in exts) {
|
||||
if (asClass == getClassByName(type)) {
|
||||
return true;
|
||||
}
|
||||
@@ -85,7 +86,7 @@ public class ClassUtil
|
||||
// See which interfaces we implement.
|
||||
var imps :XMLList = typeInfo.child("implementsInterface")
|
||||
.attribute("type");
|
||||
for each (var type :String in imps) {
|
||||
for each (type in imps) {
|
||||
if (asClass == getClassByName(type)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -96,12 +96,13 @@ public class Hashtable
|
||||
// documentation inherited from interface Map
|
||||
public function put (key :Object, value :Object) :*
|
||||
{
|
||||
var oldValue :*;
|
||||
if (isSimple(key)) {
|
||||
if (_simpleData == null) {
|
||||
_simpleData = new Dictionary();
|
||||
}
|
||||
|
||||
var oldValue :* = _simpleData[key];
|
||||
oldValue = _simpleData[key];
|
||||
_simpleData[key] = value;
|
||||
if (oldValue === undefined) {
|
||||
_simpleSize++;
|
||||
@@ -121,7 +122,7 @@ public class Hashtable
|
||||
var firstEntry :Entry = (_entries[index] as Entry);
|
||||
for (var e :Entry = firstEntry; e != null; e = e.next) {
|
||||
if (e.hash == hash && e.key.equals(hkey)) {
|
||||
var oldValue :* = e.value;
|
||||
oldValue = e.value;
|
||||
e.value = value;
|
||||
return oldValue; // size did not change
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user