@@ -705,8 +705,7 @@ pub const Lua = struct {
705
705
/// Push a formatted string onto the stack and return a pointer to the string
706
706
/// See https://www.lua.org/manual/5.1/manual.html#lua_pushfstring
707
707
pub fn pushFStringEx (lua : * Lua , fmt : [:0 ]const u8 , args : anytype ) [* :0 ]const u8 {
708
- const ptr = @call (.auto , c .lua_pushfstring , .{ lua .state , fmt .ptr } ++ args );
709
- return @ptrCast ([* :0 ]const u8 , ptr );
708
+ return @call (.auto , c .lua_pushfstring , .{ lua .state , fmt .ptr } ++ args );
710
709
}
711
710
712
711
/// Pushes an integer with value `n` onto the stack
@@ -1193,7 +1192,7 @@ pub const Lua = struct {
1193
1192
/// See https://www.lua.org/manual/5.1/manual.html#luaL_checklstring
1194
1193
pub fn checkBytes (lua : * Lua , arg : i32 ) [:0 ]const u8 {
1195
1194
var length : usize = 0 ;
1196
- const str = c .luaL_checklstring (lua .state , arg , @ptrCast ([ * c ] usize , & length ) );
1195
+ const str = c .luaL_checklstring (lua .state , arg , & length );
1197
1196
// luaL_checklstring never returns null (throws lua error)
1198
1197
return str [0.. length :0 ];
1199
1198
}
@@ -1558,8 +1557,8 @@ pub const Buffer = struct {
1558
1557
/// Adds the string to the buffer
1559
1558
/// See https://www.lua.org/manual/5.1/manual.html#luaL_addlstring
1560
1559
/// TODO: rename to addBytes
1561
- pub fn addLString (buf : * Buffer , str : []const u8 ) void {
1562
- c .luaL_addlstring (& buf .b , @ptrCast ([ * c ] const u8 , str ) , str .len );
1560
+ pub fn addBytes (buf : * Buffer , str : []const u8 ) void {
1561
+ c .luaL_addlstring (& buf .b , str . ptr , str .len );
1563
1562
}
1564
1563
1565
1564
/// Adds to the buffer a string of `length` previously copied to the buffer area
0 commit comments