diff options
| author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-24 12:24:07 +0200 |
|---|---|---|
| committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-24 12:24:07 +0200 |
| commit | 0a481b9aef3726763c572ad3ce6d44ea14dd35ba (patch) | |
| tree | 06ebfda7180a81a7c48ea0c119631c58b7ce6dfc | |
| parent | a3f500cd3ef0b4b333cc3bf403c64995dea33d5f (diff) | |
| download | lanes-0a481b9aef3726763c572ad3ce6d44ea14dd35ba.tar.gz lanes-0a481b9aef3726763c572ad3ce6d44ea14dd35ba.tar.bz2 lanes-0a481b9aef3726763c572ad3ce6d44ea14dd35ba.zip | |
linda:dump correctly outputs limit as "unlimited" for unlimited keys
| -rw-r--r-- | CHANGES | 1 | ||||
| -rw-r--r-- | src/keeper.cpp | 6 |
2 files changed, 6 insertions, 1 deletions
| @@ -29,6 +29,7 @@ CHANGE 2: BGe 11-Jun-24 | |||
| 29 | - linda:deep() result no longer contains the raw C pointer of the Linda object. | 29 | - linda:deep() result no longer contains the raw C pointer of the Linda object. |
| 30 | - linda :receive(), :send(), :get(), :set(), :limit() return nil, error in case of problem. Returned values in case of success change too. | 30 | - linda :receive(), :send(), :get(), :set(), :limit() return nil, error in case of problem. Returned values in case of success change too. |
| 31 | - Lindas have a __close metamethod that calls any suitable handler that was provided at Linda creation. | 31 | - Lindas have a __close metamethod that calls any suitable handler that was provided at Linda creation. |
| 32 | - linda:dump outputs <key>.limit as 'unlimited' instead of -1 for unlimited keys. | ||
| 32 | - Lane generator settings: | 33 | - Lane generator settings: |
| 33 | - error_trace_level added. Replaces the global verbose_errors setting. | 34 | - error_trace_level added. Replaces the global verbose_errors setting. |
| 34 | - name added. Can be used to set the name early (before the lane body calls set_debug_threadname()). | 35 | - name added. Can be used to set the name early (before the lane body calls set_debug_threadname()). |
diff --git a/src/keeper.cpp b/src/keeper.cpp index 8261f5a..3054f86 100644 --- a/src/keeper.cpp +++ b/src/keeper.cpp | |||
| @@ -711,7 +711,11 @@ int Keeper::PushLindaStorage(Linda& linda_, DestState const L_) | |||
| 711 | STACK_CHECK(L_, 5); | 711 | STACK_CHECK(L_, 5); |
| 712 | lua_setfield(L_, -3, "count"); // _K: KeysDB key L_: out key keyout fifo | 712 | lua_setfield(L_, -3, "count"); // _K: KeysDB key L_: out key keyout fifo |
| 713 | // keyout.limit | 713 | // keyout.limit |
| 714 | lua_pushinteger(L_, _key->limit); // _K: KeysDB key L_: out key keyout fifo limit | 714 | if (_key->limit >= 0) { |
| 715 | lua_pushinteger(L_, _key->limit); // _K: KeysDB key L_: out key keyout fifo limit | ||
| 716 | } else { | ||
| 717 | luaG_pushstring(L_, "unlimited"); // _K: KeysDB key L_: out key keyout fifo limit | ||
| 718 | } | ||
| 715 | STACK_CHECK(L_, 5); | 719 | STACK_CHECK(L_, 5); |
| 716 | lua_setfield(L_, -3, "limit"); // _K: KeysDB key L_: out key keyout fifo | 720 | lua_setfield(L_, -3, "limit"); // _K: KeysDB key L_: out key keyout fifo |
| 717 | // keyout.fifo | 721 | // keyout.fifo |
