Skip to content

Commit 5129816

Browse files
committed
cleanup: format code
1 parent 932db5c commit 5129816

File tree

7 files changed

+8
-12
lines changed

7 files changed

+8
-12
lines changed

build.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fn buildLua(b: *Builder, step: *LibExeObjStep, options: Options) *LibExeObjStep
119119
return lua;
120120
}
121121

122-
const lua_51_source_files = [_][]const u8 {
122+
const lua_51_source_files = [_][]const u8{
123123
"lapi.c",
124124
"lcode.c",
125125
"ldebug.c",
@@ -151,7 +151,7 @@ const lua_51_source_files = [_][]const u8 {
151151
"linit.c",
152152
};
153153

154-
const lua_52_source_files = [_][]const u8 {
154+
const lua_52_source_files = [_][]const u8{
155155
"lapi.c",
156156
"lcode.c",
157157
"lctype.c",

src/ziglua-5.1/lib.zig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ pub const mask_ret = c.LUA_MASKRET;
189189
/// The maximum integer value that `Integer` can store
190190
pub const max_integer = c.LUA_MAXINTEGER;
191191

192-
193192
/// The minimum Lua stack available to a function
194193
pub const min_stack = c.LUA_MINSTACK;
195194

@@ -597,7 +596,6 @@ pub const Lua = struct {
597596
return .{ .state = state };
598597
}
599598

600-
601599
/// This function allocates a new block of memory with the given size,
602600
/// pushes onto the stack a new full userdata with the block address,
603601
/// and returns this address. The host program can freely use this memory
@@ -1272,7 +1270,6 @@ pub const Lua = struct {
12721270
return if (ret == ref_nil) error.Fail else ret;
12731271
}
12741272

1275-
12761273
/// Registers all functions in the array `fns` into the table on the top of the stack
12771274
/// All functions are created with `num_upvalues` upvalues
12781275
pub fn setFuncs(lua: *Lua, funcs: []const FnReg, num_upvalues: i32) void {

src/ziglua-5.2/lib.zig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ pub const mask_ret = c.LUA_MASKRET;
218218
/// The maximum integer value that `Integer` can store
219219
pub const max_integer = c.LUA_MAXINTEGER;
220220

221-
222221
/// The minimum Lua stack available to a function
223222
pub const min_stack = c.LUA_MINSTACK;
224223

@@ -699,7 +698,6 @@ pub const Lua = struct {
699698
return .{ .state = state };
700699
}
701700

702-
703701
/// This function allocates a new block of memory with the given size,
704702
/// pushes onto the stack a new full userdata with the block address,
705703
/// and returns this address. The host program can freely use this memory

src/ziglua-5.2/tests.zig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,6 @@ test "yielding" {
849849
}
850850
}.inner;
851851

852-
853852
var thread = lua.newThread();
854853
thread.pushFunction(ziglua.wrap(willYield));
855854

@@ -1393,8 +1392,6 @@ test "userdata" {
13931392
// correct metatable and values
13941393
try lua.protectedCall(1, 0, 0);
13951394
}
1396-
1397-
13981395
}
13991396

14001397
test "refs" {

src/ziglua-5.3/lib.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,6 @@ pub const Lua = struct {
740740
return .{ .state = state };
741741
}
742742

743-
744743
/// This function allocates a new block of memory with the given size,
745744
/// pushes onto the stack a new full userdata with the block address,
746745
/// and returns this address. The host program can freely use this memory

src/ziglua-5.3/tests.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,6 @@ test "yielding" {
892892
}
893893
}.inner;
894894

895-
896895
var thread = lua.newThread();
897896
thread.pushFunction(ziglua.wrap(willYield));
898897

src/ziglua-5.4/lib.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,3 +2014,9 @@ fn wrapZigWriterFn(comptime f: ZigWriterFn) CWriterFn {
20142014
}
20152015
}.inner;
20162016
}
2017+
2018+
/// Export a Zig function to be used as a Zig (C) Module
2019+
pub fn exportFn(comptime name: []const u8, comptime func: ZigFn) void {
2020+
const declaration = wrap(func);
2021+
@export(declaration, .{ .name = "luaopen_" ++ name, .linkage = .Strong });
2022+
}

0 commit comments

Comments
 (0)