Skip to content

Commit 660eda8

Browse files
Run formatter.
1 parent 9d0ecfb commit 660eda8

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

src/Lua.hx

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ private abstract CString(cpp.ConstCharStar) from cpp.ConstCharStar to cpp.ConstC
4848
private typedef Ref<T> = cpp.Star<T>;
4949

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

@@ -70,15 +70,14 @@ 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(cpp.Pointer.fromRaw(L), haxe.io.Bytes.ofData(cpp.Pointer.fromRaw((cast p : cpp.RawPointer<cpp.UInt8>)).toUnmanagedArray(sz)));
7474
}
7575

76-
public static function reader(L:cpp.RawPointer<NativeState>,ud:cpp.Star<cpp.Void>,sz:cpp.RawPointer<cpp.SizeT>):cpp.ConstCharStar {
77-
var func:(State)->haxe.io.Bytes = cast ud;
76+
public static function reader(L:cpp.RawPointer<NativeState>, ud:cpp.Star<cpp.Void>, sz:cpp.RawPointer<cpp.SizeT>):cpp.ConstCharStar {
77+
var func:(State) -> haxe.io.Bytes = cast ud;
7878
var b = func(cpp.Pointer.fromRaw(L));
7979
sz[0] = b.length;
8080
return cast cpp.Pointer.ofArray(b.getData()).constRaw;
81-
8281
}
8382
}
8483
#else
@@ -144,9 +143,9 @@ enum abstract GcOptions(Int) {
144143
extern class Lua {
145144
#if hl
146145
@:hlNative("lua", "hl_init")
147-
private static function init(t:hl.Type,t1:hl.Type):Void;
146+
private static function init(t:hl.Type, t1:hl.Type):Void;
148147
private static inline function __init__():Void {
149-
init(hl.Type.get(((s:State) -> 0 : LuaCFunction)),hl.Type.get(haxe.io.Bytes.alloc(0)));
148+
init(hl.Type.get(((s:State) -> 0 : LuaCFunction)), hl.Type.get(haxe.io.Bytes.alloc(0)));
150149
}
151150
#end
152151

@@ -207,7 +206,7 @@ extern class Lua {
207206
@:native("lua_toboolean")
208207
static function toboolean(L:State, idx:Int):IntBool;
209208
@:native("lua_tolstring")
210-
static function tolstring(L:State, idx:Int, len:Ref<#if cpp cpp.SizeT #elseif hl Int #end>):CString;
209+
static function tolstring(L:State, idx:Int, len:Ref< #if cpp cpp.SizeT #elseif hl Int #end>):CString;
211210
@:native("lua_objlen")
212211
static function objlen(L:State, idx:Int):#if cpp cpp.SizeT #else Int #end;
213212
@:native("lua_tocfunction")
@@ -271,9 +270,11 @@ extern class Lua {
271270
static function cpcall<T:Dynamic>(L:State, func:LuaCFunction, ud:T):Int;
272271
#if cpp
273272
@:native("lua_load")
274-
private static function _load(L:State, reader:cpp.Callable<(cpp.RawPointer<NativeState>,cpp.Star<cpp.Void>,cpp.RawPointer<cpp.SizeT>)->cpp.ConstCharStar>, dt:cpp.Star<cpp.Void>, chunkname:CString):Int;
275-
static inline function load(L:State,reader:(State)->haxe.io.Bytes,chunkname:String):Int {
276-
return _load(L,cpp.Callable.fromStaticFunction(Misc.reader),cast reader,chunkname);
273+
private static function _load(L:State,
274+
reader:cpp.Callable<(cpp.RawPointer<NativeState>, cpp.Star<cpp.Void>, cpp.RawPointer<cpp.SizeT>) -> cpp.ConstCharStar>, dt:cpp.Star<cpp.Void>,
275+
chunkname:CString):Int;
276+
static inline function load(L:State, reader:(State) -> haxe.io.Bytes, chunkname:String):Int {
277+
return _load(L, cpp.Callable.fromStaticFunction(Misc.reader), cast reader, chunkname);
277278
}
278279
#elseif hl
279280
@:skipHL
@@ -282,13 +283,13 @@ extern class Lua {
282283
#if cpp
283284
@:native("lua_dump")
284285
private static function _dump(L:State,
285-
writer:cpp.Callable<(cpp.RawPointer<NativeState>,cpp.RawConstPointer<cpp.Void>,cpp.SizeT,cpp.Star<cpp.Void>)->Int>,ud:cpp.Star<cpp.Void>):Int;
286-
static inline function dump(L:State,writer:(State,haxe.io.Bytes)->Int):Int {
287-
return _dump(L,cpp.Function.fromStaticFunction(Misc.writer),cast writer);
286+
writer:cpp.Callable<(cpp.RawPointer<NativeState>, cpp.RawConstPointer<cpp.Void>, cpp.SizeT, cpp.Star<cpp.Void>) -> Int>, ud:cpp.Star<cpp.Void>):Int;
287+
static inline function dump(L:State, writer:(State, haxe.io.Bytes) -> Int):Int {
288+
return _dump(L, cpp.Function.fromStaticFunction(Misc.writer), cast writer);
288289
}
289290
#elseif hl
290291
@:skipHL
291-
static function dump(L:State, writer:(State,haxe.io.Bytes)->Int):Int;
292+
static function dump(L:State, writer:(State, haxe.io.Bytes) -> Int):Int;
292293
#end
293294
@:native("lua_yield")
294295
static function yield(L:State, nresults:Int):ThreadStatus;

0 commit comments

Comments
 (0)