Skip to content

Commit 8a3ed9f

Browse files
Change State typedef to use cpp.RawPointer.
1 parent 660eda8 commit 8a3ed9f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Lua.hx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private typedef IntBool = Bool;
3333
@:native("lua_State")
3434
extern class NativeState {}
3535

36-
typedef State = cpp.Pointer<NativeState>;
36+
typedef State = cpp.RawPointer<NativeState>;
3737

3838
private abstract CString(cpp.ConstCharStar) from cpp.ConstCharStar to cpp.ConstCharStar {
3939
@:from static inline function fromString(s:String):CString {
@@ -49,7 +49,7 @@ private typedef Ref<T> = cpp.Star<T>;
4949

5050
private abstract Bytes(cpp.RawPointer<Void>) {
5151
@:from static function fromBytes(b:haxe.io.Bytes) {
52-
return cpp.Pointer.ofArray(b.b).rawCast();
52+
return cast (cpp.Pointer.ofArray(b.getData()).rawCast() : cpp.RawPointer<Void>);
5353
}
5454
}
5555

@@ -70,12 +70,12 @@ private abstract IntBool(Int) from Int to Int {
7070
private class Misc {
7171
public static function writer(L:cpp.RawPointer<NativeState>, p:cpp.RawConstPointer<cpp.Void>, sz:cpp.SizeT, ud:cpp.Star<cpp.Void>):Int {
7272
var func:(State, haxe.io.Bytes) -> Int = cast ud;
73-
return func(cpp.Pointer.fromRaw(L), haxe.io.Bytes.ofData(cpp.Pointer.fromRaw((cast p : cpp.RawPointer<cpp.UInt8>)).toUnmanagedArray(sz)));
73+
return func(L, haxe.io.Bytes.ofData(cpp.Pointer.fromRaw((cast p : cpp.RawPointer<cpp.UInt8>)).toUnmanagedArray(sz)));
7474
}
7575

7676
public static function reader(L:cpp.RawPointer<NativeState>, ud:cpp.Star<cpp.Void>, sz:cpp.RawPointer<cpp.SizeT>):cpp.ConstCharStar {
7777
var func:(State) -> haxe.io.Bytes = cast ud;
78-
var b = func(cpp.Pointer.fromRaw(L));
78+
var b = func(L);
7979
sz[0] = b.length;
8080
return cast cpp.Pointer.ofArray(b.getData()).constRaw;
8181
}

0 commit comments

Comments
 (0)