瀏覽代碼

fixed int31 issues

Nicolas Cannasse 16 年之前
父節點
當前提交
52d6719be2
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      std/haxe/io/Output.hx

+ 4 - 4
std/haxe/io/Output.hx

@@ -186,13 +186,13 @@ class Output {
 	public function writeInt32( x : haxe.Int32 ) {
 	public function writeInt32( x : haxe.Int32 ) {
 		if( bigEndian ) {
 		if( bigEndian ) {
 			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,24)) );
 			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,24)) );
-			writeByte( haxe.Int32.toInt(haxe.Int32.shr(x,16)) & 0xFF );
-			writeByte( haxe.Int32.toInt(haxe.Int32.shr(x,8)) & 0xFF );
+			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,16)) & 0xFF );
+			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,8)) & 0xFF );
 			writeByte( haxe.Int32.toInt(haxe.Int32.and(x,haxe.Int32.ofInt(0xFF))) );
 			writeByte( haxe.Int32.toInt(haxe.Int32.and(x,haxe.Int32.ofInt(0xFF))) );
 		} else {
 		} else {
 			writeByte( haxe.Int32.toInt(haxe.Int32.and(x,haxe.Int32.ofInt(0xFF))) );
 			writeByte( haxe.Int32.toInt(haxe.Int32.and(x,haxe.Int32.ofInt(0xFF))) );
-			writeByte( haxe.Int32.toInt(haxe.Int32.shr(x,8)) & 0xFF );
-			writeByte( haxe.Int32.toInt(haxe.Int32.shr(x,16)) & 0xFF );
+			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,8)) & 0xFF );
+			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,16)) & 0xFF );
 			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,24)) );
 			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,24)) );
 		}
 		}
 	}
 	}