diff options
| author | Benoit Germain <bnt period germain arrobase gmail period com> | 2014-01-09 14:24:32 +0100 |
|---|---|---|
| committer | Benoit Germain <bnt period germain arrobase gmail period com> | 2014-01-09 14:24:32 +0100 |
| commit | 2d0c030411bf717664b1a8bd502ce5a74ee9a257 (patch) | |
| tree | 058d036177c51b51572130b5682ec3f3f927e5ba /src | |
| parent | cc03c619dafe39cab231045f3c8592398e4b6944 (diff) | |
| download | lanes-2d0c030411bf717664b1a8bd502ce5a74ee9a257.tar.gz lanes-2d0c030411bf717664b1a8bd502ce5a74ee9a257.tar.bz2 lanes-2d0c030411bf717664b1a8bd502ce5a74ee9a257.zip | |
Fix argument checks in linda:limit()
Diffstat (limited to 'src')
| -rw-r--r-- | src/lanes.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lanes.c b/src/lanes.c index d852a20..ef44d90 100644 --- a/src/lanes.c +++ b/src/lanes.c | |||
| @@ -784,7 +784,7 @@ LUAG_FUNC( linda_get) | |||
| 784 | 784 | ||
| 785 | 785 | ||
| 786 | /* | 786 | /* |
| 787 | * [true] = linda_limit( linda_ud, key_num|str|bool|lightuserdata, int [, bool] ) | 787 | * [true] = linda_limit( linda_ud, key_num|str|bool|lightuserdata, int) |
| 788 | * | 788 | * |
| 789 | * Set limit to 1 Linda keys. | 789 | * Set limit to 1 Linda keys. |
| 790 | * Optionally wake threads waiting to write on the linda, in case the limit enables them to do so | 790 | * Optionally wake threads waiting to write on the linda, in case the limit enables them to do so |
| @@ -795,9 +795,9 @@ LUAG_FUNC( linda_limit) | |||
| 795 | int pushed; | 795 | int pushed; |
| 796 | bool_t wake_writers = FALSE; | 796 | bool_t wake_writers = FALSE; |
| 797 | 797 | ||
| 798 | // make sure we got at most 4 arguments: the linda, a key, a limit, and an optional wake-up flag. | 798 | // make sure we got 3 arguments: the linda, a key and a limit |
| 799 | luaL_argcheck( L, linda, 1, "expected a linda object!"); | 799 | luaL_argcheck( L, linda, 1, "expected a linda object!"); |
| 800 | luaL_argcheck( L, lua_gettop( L) <= 4, 2, "wrong number of arguments"); | 800 | luaL_argcheck( L, lua_gettop( L) == 3, 2, "wrong number of arguments"); |
| 801 | // make sure we got a numeric limit | 801 | // make sure we got a numeric limit |
| 802 | luaL_checknumber( L, 3); | 802 | luaL_checknumber( L, 3); |
| 803 | // make sure the key is of a valid type | 803 | // make sure the key is of a valid type |
