فهرست منبع

fixed regression

Nicolas Cannasse 11 سال پیش
والد
کامیت
3f0fa751e2
1فایلهای تغییر یافته به همراه12 افزوده شده و 2 حذف شده
  1. 12 2
      std/haxe/io/Bytes.hx

+ 12 - 2
std/haxe/io/Bytes.hx

@@ -151,15 +151,25 @@ class Bytes {
 		var b2 = other.b;
 		b1.position = 0;
 		b2.position = 0;
+		b1.endian = flash.utils.Endian.BIG_ENDIAN;
+		b2.endian = flash.utils.Endian.BIG_ENDIAN;
 		for( i in 0...len>>2 )
 			if( b1.readUnsignedInt() != b2.readUnsignedInt() ) {
 				b1.position -= 4;
 				b2.position -= 4;
-				return b1.readUnsignedInt() - b2.readUnsignedInt();
+				var d = b1.readUnsignedInt() - b2.readUnsignedInt();
+				b1.endian = flash.utils.Endian.LITTLE_ENDIAN;
+				b2.endian = flash.utils.Endian.LITTLE_ENDIAN;
+				return d;
 			}
 		for( i in 0...len & 3 )
-			if( b1.readUnsignedByte() != b2.readUnsignedByte() )
+			if( b1.readUnsignedByte() != b2.readUnsignedByte() ) {
+				b1.endian = flash.utils.Endian.LITTLE_ENDIAN;
+				b2.endian = flash.utils.Endian.LITTLE_ENDIAN;
 				return b1[b1.position-1] - b2[b2.position-1];
+			}
+		b1.endian = flash.utils.Endian.LITTLE_ENDIAN;
+		b2.endian = flash.utils.Endian.LITTLE_ENDIAN;
 		return length - other.length;
 		#elseif php
 		return untyped __php__("$this->b < $other->b ? -1 : ($this->b == $other->b ? 0 : 1)");