Skip to content

Commit 0eb4ae1

Browse files
committed
Fix PoolByteArray.extend argument name used
1 parent 3f1f275 commit 0eb4ae1

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
- HGDN functions are now compiled with static visibility and unused GDNative
77
extensions are excluded, also resulting in smaller dynamic libraries
88

9+
### Fixed
10+
- `PoolByteArray.extend` when called with a string argument
11+
912

1013
## [0.2.0]
1114
### Added

src/godot_pool_byte_array.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ methods.append = methods.push_back
187187
methods.extend = function(self, iterable)
188188
if type(iterable) == 'string' then
189189
local size = #self
190-
self:resize(size + #v)
190+
self:resize(size + #iterable)
191191
local write = self:write()
192-
ffi_copy(write:ptr() + size, v, #v)
192+
ffi_copy(write:ptr() + size, iterable, #iterable)
193193
write:destroy()
194194
elseif ffi_istype(PoolByteArray, iterable) then
195195
api.godot_pool_byte_array_append_array(self, iterable)

src/godot_string.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ end
783783
--- Converts `size` represented as number of bytes to human-readable format using internationalized set of data size units, namely: B, KiB, MiB, GiB, TiB, PiB, EiB.
784784
-- Note that the next smallest unit is picked automatically to hold at most 1024 units.
785785
-- @function humanize_size
786+
-- @tparam int size
786787
-- @treturn String
787788
methods.humanize_size = function(size)
788789
return ffi_gc(api.godot_string_humanize_size(size), api.godot_string_destroy)

src/language_gdnative.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ static int lps_lua_setthreadfunc(lua_State *L) {
8181
else {
8282
co = lua_newthread(L);
8383
}
84+
// move callable argument to the new/reused thread
8485
lua_pushvalue(L, 2);
8586
lua_xmove(L, co, 1);
8687
return 1;

0 commit comments

Comments
 (0)