diff options
| author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-24 11:30:18 +0200 |
|---|---|---|
| committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-24 11:30:18 +0200 |
| commit | eba98e4e1adcf3ce11e5934e2dce54f29aef1e0a (patch) | |
| tree | d51d51eb2d48208df1cfdf6eb0bd40a928d6243c /src/intercopycontext.cpp | |
| parent | 8745a54f88f31cd51dc86c96039ebe0b3e98f5ea (diff) | |
| download | lanes-eba98e4e1adcf3ce11e5934e2dce54f29aef1e0a.tar.gz lanes-eba98e4e1adcf3ce11e5934e2dce54f29aef1e0a.tar.bz2 lanes-eba98e4e1adcf3ce11e5934e2dce54f29aef1e0a.zip | |
Make Unique even stronger
Diffstat (limited to 'src/intercopycontext.cpp')
| -rw-r--r-- | src/intercopycontext.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/intercopycontext.cpp b/src/intercopycontext.cpp index f54c152..5f3ce7d 100644 --- a/src/intercopycontext.cpp +++ b/src/intercopycontext.cpp | |||
| @@ -738,7 +738,7 @@ LuaType InterCopyContext::processConversion() const | |||
| 738 | lua_getupvalue(L2, -1, 2); // L2: ... userdata_clone_sentinel u | 738 | lua_getupvalue(L2, -1, 2); // L2: ... userdata_clone_sentinel u |
| 739 | } | 739 | } |
| 740 | // assign uservalues | 740 | // assign uservalues |
| 741 | int _uvi{ _nuv }; | 741 | UserValueIndex _uvi{ _nuv.value() }; |
| 742 | while (_uvi > 0) { | 742 | while (_uvi > 0) { |
| 743 | _c.L1_i = SourceIndex{ luaG_absindex(L1, kIdxTop) }; | 743 | _c.L1_i = SourceIndex{ luaG_absindex(L1, kIdxTop) }; |
| 744 | if (_c.interCopyOne() != InterCopyResult::Success) { // L2: ... u uv | 744 | if (_c.interCopyOne() != InterCopyResult::Success) { // L2: ... u uv |
| @@ -796,7 +796,7 @@ LuaType InterCopyContext::processConversion() const | |||
| 796 | InterCopyContext _c{ U, L2, L1, L2_cache_i, {}, VT::NORMAL, mode, name }; | 796 | InterCopyContext _c{ U, L2, L1, L2_cache_i, {}, VT::NORMAL, mode, name }; |
| 797 | StackIndex const _clone_i{ lua_gettop(L2) }; | 797 | StackIndex const _clone_i{ lua_gettop(L2) }; |
| 798 | STACK_GROW(L2, _nuv); | 798 | STACK_GROW(L2, _nuv); |
| 799 | int _uvi{ _nuv }; | 799 | UserValueIndex _uvi{ _nuv.value() }; |
| 800 | while (_uvi) { | 800 | while (_uvi) { |
| 801 | _c.L1_i = SourceIndex{ luaG_absindex(L1, kIdxTop) }; | 801 | _c.L1_i = SourceIndex{ luaG_absindex(L1, kIdxTop) }; |
| 802 | if (_c.interCopyOne() != InterCopyResult::Success) { // L1: ... deep ... [uv]* L2: deep uv | 802 | if (_c.interCopyOne() != InterCopyResult::Success) { // L1: ... deep ... [uv]* L2: deep uv |
| @@ -880,7 +880,7 @@ LuaType InterCopyContext::processConversion() const | |||
| 880 | lua_setmetatable(L2, -2); // L2: ... mt u | 880 | lua_setmetatable(L2, -2); // L2: ... mt u |
| 881 | // transfer and assign uservalues | 881 | // transfer and assign uservalues |
| 882 | InterCopyContext _c{ *this }; | 882 | InterCopyContext _c{ *this }; |
| 883 | int _uvi{ _nuv }; | 883 | UserValueIndex _uvi{ _nuv.value() }; |
| 884 | while (_uvi > 0) { | 884 | while (_uvi > 0) { |
| 885 | _c.L1_i = SourceIndex{ luaG_absindex(L1, kIdxTop) }; | 885 | _c.L1_i = SourceIndex{ luaG_absindex(L1, kIdxTop) }; |
| 886 | if (_c.interCopyOne() != InterCopyResult::Success) { // L2: ... mt u uv | 886 | if (_c.interCopyOne() != InterCopyResult::Success) { // L2: ... mt u uv |
| @@ -1276,7 +1276,7 @@ namespace { | |||
| 1276 | DEBUGSPEW_CODE(DebugSpewIndentScope _scope{ U }); | 1276 | DEBUGSPEW_CODE(DebugSpewIndentScope _scope{ U }); |
| 1277 | 1277 | ||
| 1278 | StackIndex const _top_L1{ lua_gettop(L1) }; | 1278 | StackIndex const _top_L1{ lua_gettop(L1) }; |
| 1279 | int const _available{ (L1_i != 0) ? (_top_L1 - L1_i + 1) : _top_L1 }; | 1279 | int const _available{ (L1_i != 0) ? (_top_L1 - L1_i + 1) : _top_L1.value() }; |
| 1280 | if (n_ > _available) { | 1280 | if (n_ > _available) { |
| 1281 | // requesting to copy more than is available? | 1281 | // requesting to copy more than is available? |
| 1282 | DEBUGSPEW_CODE(DebugSpew(U) << "nothing to copy" << std::endl); | 1282 | DEBUGSPEW_CODE(DebugSpew(U) << "nothing to copy" << std::endl); |
| @@ -1298,7 +1298,7 @@ namespace { | |||
| 1298 | InterCopyResult _copyok{ InterCopyResult::Success }; | 1298 | InterCopyResult _copyok{ InterCopyResult::Success }; |
| 1299 | STACK_CHECK_START_REL(L1, 0); | 1299 | STACK_CHECK_START_REL(L1, 0); |
| 1300 | // if L1_i is specified, start here, else take the _n items off the top of the stack | 1300 | // if L1_i is specified, start here, else take the _n items off the top of the stack |
| 1301 | for (StackIndex _i{ L1_i != 0 ? L1_i : (_top_L1 - n_ + 1) }, _j{ 1 }; _j <= n_; ++_i, ++_j) { | 1301 | for (StackIndex _i{ (L1_i != 0) ? L1_i.value() : (_top_L1 - n_ + 1) }, _j{ 1 }; _j <= n_; ++_i, ++_j) { |
| 1302 | char _tmpBuf[16]; | 1302 | char _tmpBuf[16]; |
| 1303 | if (U->verboseErrors) { | 1303 | if (U->verboseErrors) { |
| 1304 | sprintf(_tmpBuf, "arg_%d", _j.operator int()); | 1304 | sprintf(_tmpBuf, "arg_%d", _j.operator int()); |
