Fix array to array buffer on Neko with null value
This commit is contained in:
@@ -396,6 +396,7 @@ abstract TypedArrayType(Int) from Int to Int {
|
|||||||
#if cpp
|
#if cpp
|
||||||
untyped __global__.__hxcpp_memory_set_byte(buffer.getData(), byteOffset, value);
|
untyped __global__.__hxcpp_memory_set_byte(buffer.getData(), byteOffset, value);
|
||||||
#elseif neko
|
#elseif neko
|
||||||
|
if (value == null) value = 0;
|
||||||
untyped __dollar__sset(buffer.b, byteOffset, value & 0xff);
|
untyped __dollar__sset(buffer.b, byteOffset, value & 0xff);
|
||||||
#else
|
#else
|
||||||
buffer.set(byteOffset, value);
|
buffer.set(byteOffset, value);
|
||||||
@@ -427,6 +428,9 @@ abstract TypedArrayType(Int) from Int to Int {
|
|||||||
#if cpp
|
#if cpp
|
||||||
untyped __global__.__hxcpp_memory_set_byte(buffer.getData(), byteOffset, value);
|
untyped __global__.__hxcpp_memory_set_byte(buffer.getData(), byteOffset, value);
|
||||||
#else
|
#else
|
||||||
|
#if neko
|
||||||
|
if (value == null) value = 0;
|
||||||
|
#end
|
||||||
buffer.set( byteOffset, value );
|
buffer.set( byteOffset, value );
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@@ -474,6 +478,7 @@ abstract TypedArrayType(Int) from Int to Int {
|
|||||||
#if cpp
|
#if cpp
|
||||||
untyped __global__.__hxcpp_memory_set_i16(buffer.getData(), byteOffset, value);
|
untyped __global__.__hxcpp_memory_set_i16(buffer.getData(), byteOffset, value);
|
||||||
#elseif neko
|
#elseif neko
|
||||||
|
if (value == null) value = 0;
|
||||||
untyped var b = buffer.b;
|
untyped var b = buffer.b;
|
||||||
untyped __dollar__sset(b, byteOffset , (value ) & 0xff);
|
untyped __dollar__sset(b, byteOffset , (value ) & 0xff);
|
||||||
untyped __dollar__sset(b, byteOffset+1, (value >> 8) & 0xff);
|
untyped __dollar__sset(b, byteOffset+1, (value >> 8) & 0xff);
|
||||||
@@ -489,6 +494,7 @@ abstract TypedArrayType(Int) from Int to Int {
|
|||||||
#if cpp
|
#if cpp
|
||||||
untyped __global__.__hxcpp_memory_set_i16(buffer.getData(), byteOffset, value);
|
untyped __global__.__hxcpp_memory_set_i16(buffer.getData(), byteOffset, value);
|
||||||
#elseif neko
|
#elseif neko
|
||||||
|
if (value == null) value = 0;
|
||||||
untyped var b = buffer.b;
|
untyped var b = buffer.b;
|
||||||
untyped __dollar__sset(b, byteOffset , (value >> 8) & 0xff);
|
untyped __dollar__sset(b, byteOffset , (value >> 8) & 0xff);
|
||||||
untyped __dollar__sset(b, byteOffset+1, (value ) & 0xff);
|
untyped __dollar__sset(b, byteOffset+1, (value ) & 0xff);
|
||||||
@@ -608,6 +614,9 @@ abstract TypedArrayType(Int) from Int to Int {
|
|||||||
#if cpp
|
#if cpp
|
||||||
untyped __global__.__hxcpp_memory_set_i32(buffer.getData(), byteOffset, value);
|
untyped __global__.__hxcpp_memory_set_i32(buffer.getData(), byteOffset, value);
|
||||||
#else
|
#else
|
||||||
|
#if neko
|
||||||
|
if (value == null) value = 0;
|
||||||
|
#end
|
||||||
#if (haxe_ver >= 3.2)
|
#if (haxe_ver >= 3.2)
|
||||||
buffer.setInt32(byteOffset,value);
|
buffer.setInt32(byteOffset,value);
|
||||||
#else
|
#else
|
||||||
@@ -626,6 +635,9 @@ abstract TypedArrayType(Int) from Int to Int {
|
|||||||
#if cpp
|
#if cpp
|
||||||
untyped __global__.__hxcpp_memory_set_i32(buffer.getData(), byteOffset, value);
|
untyped __global__.__hxcpp_memory_set_i32(buffer.getData(), byteOffset, value);
|
||||||
#else
|
#else
|
||||||
|
#if neko
|
||||||
|
if (value == null) value = 0;
|
||||||
|
#end
|
||||||
#if (haxe_ver >= 3.2)
|
#if (haxe_ver >= 3.2)
|
||||||
buffer.setInt32(byteOffset,value);
|
buffer.setInt32(byteOffset,value);
|
||||||
#else
|
#else
|
||||||
@@ -711,6 +723,9 @@ abstract TypedArrayType(Int) from Int to Int {
|
|||||||
#if cpp
|
#if cpp
|
||||||
untyped __global__.__hxcpp_memory_set_float(buffer.getData(), byteOffset, value);
|
untyped __global__.__hxcpp_memory_set_float(buffer.getData(), byteOffset, value);
|
||||||
#else
|
#else
|
||||||
|
#if neko
|
||||||
|
if (value == null) value = 0;
|
||||||
|
#end
|
||||||
buffer.setFloat( byteOffset, value );
|
buffer.setFloat( byteOffset, value );
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@@ -722,6 +737,9 @@ abstract TypedArrayType(Int) from Int to Int {
|
|||||||
#if cpp
|
#if cpp
|
||||||
untyped __global__.__hxcpp_memory_set_float(buffer.getData(), byteOffset, value);
|
untyped __global__.__hxcpp_memory_set_float(buffer.getData(), byteOffset, value);
|
||||||
#else
|
#else
|
||||||
|
#if neko
|
||||||
|
if (value == null) value = 0;
|
||||||
|
#end
|
||||||
buffer.setFloat( byteOffset, value );
|
buffer.setFloat( byteOffset, value );
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@@ -755,6 +773,9 @@ abstract TypedArrayType(Int) from Int to Int {
|
|||||||
#if cpp
|
#if cpp
|
||||||
untyped __global__.__hxcpp_memory_set_double(buffer.getData(), byteOffset, value);
|
untyped __global__.__hxcpp_memory_set_double(buffer.getData(), byteOffset, value);
|
||||||
#else
|
#else
|
||||||
|
#if neko
|
||||||
|
if (value == null) value = 0;
|
||||||
|
#end
|
||||||
buffer.setDouble( byteOffset, value );
|
buffer.setDouble( byteOffset, value );
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@@ -766,6 +787,9 @@ abstract TypedArrayType(Int) from Int to Int {
|
|||||||
#if cpp
|
#if cpp
|
||||||
untyped __global__.__hxcpp_memory_set_double(buffer.getData(), byteOffset, value);
|
untyped __global__.__hxcpp_memory_set_double(buffer.getData(), byteOffset, value);
|
||||||
#else
|
#else
|
||||||
|
#if neko
|
||||||
|
if (value == null) value = 0;
|
||||||
|
#end
|
||||||
buffer.setDouble( byteOffset, value );
|
buffer.setDouble( byteOffset, value );
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user