diff options
| -rw-r--r-- | ltable.c | 8 | ||||
| -rw-r--r-- | ltests.c | 2 |
2 files changed, 5 insertions, 5 deletions
| @@ -951,7 +951,7 @@ lu_byte luaH_getint (Table *t, lua_Integer key, TValue *res) { | |||
| 951 | if (keyinarray(t, key)) { | 951 | if (keyinarray(t, key)) { |
| 952 | lu_byte tag = *getArrTag(t, key - 1); | 952 | lu_byte tag = *getArrTag(t, key - 1); |
| 953 | if (!tagisempty(tag)) | 953 | if (!tagisempty(tag)) |
| 954 | farr2val(t, key - 1, tag, res); | 954 | farr2val(t, cast_uint(key) - 1, tag, res); |
| 955 | return tag; | 955 | return tag; |
| 956 | } | 956 | } |
| 957 | else | 957 | else |
| @@ -1062,7 +1062,7 @@ int luaH_psetint (Table *t, lua_Integer key, TValue *val) { | |||
| 1062 | if (keyinarray(t, key)) { | 1062 | if (keyinarray(t, key)) { |
| 1063 | lu_byte *tag = getArrTag(t, key - 1); | 1063 | lu_byte *tag = getArrTag(t, key - 1); |
| 1064 | if (!tagisempty(*tag) || checknoTM(t->metatable, TM_NEWINDEX)) { | 1064 | if (!tagisempty(*tag) || checknoTM(t->metatable, TM_NEWINDEX)) { |
| 1065 | fval2arr(t, key - 1, tag, val); | 1065 | fval2arr(t, cast_uint(key) - 1, tag, val); |
| 1066 | return HOK; /* success */ | 1066 | return HOK; /* success */ |
| 1067 | } | 1067 | } |
| 1068 | else | 1068 | else |
| @@ -1118,7 +1118,7 @@ void luaH_finishset (lua_State *L, Table *t, const TValue *key, | |||
| 1118 | } | 1118 | } |
| 1119 | else { /* array entry */ | 1119 | else { /* array entry */ |
| 1120 | hres = ~hres; /* real index */ | 1120 | hres = ~hres; /* real index */ |
| 1121 | obj2arr(t, hres, value); | 1121 | obj2arr(t, cast_uint(hres), value); |
| 1122 | } | 1122 | } |
| 1123 | } | 1123 | } |
| 1124 | 1124 | ||
| @@ -1140,7 +1140,7 @@ void luaH_set (lua_State *L, Table *t, const TValue *key, TValue *value) { | |||
| 1140 | */ | 1140 | */ |
| 1141 | void luaH_setint (lua_State *L, Table *t, lua_Integer key, TValue *value) { | 1141 | void luaH_setint (lua_State *L, Table *t, lua_Integer key, TValue *value) { |
| 1142 | if (keyinarray(t, key)) | 1142 | if (keyinarray(t, key)) |
| 1143 | obj2arr(t, key - 1, value); | 1143 | obj2arr(t, cast_uint(key) - 1, value); |
| 1144 | else { | 1144 | else { |
| 1145 | int ok = rawfinishnodeset(getintfromhash(t, key), value); | 1145 | int ok = rawfinishnodeset(getintfromhash(t, key), value); |
| 1146 | if (!ok) { | 1146 | if (!ok) { |
| @@ -1043,7 +1043,7 @@ static int table_query (lua_State *L) { | |||
| 1043 | } | 1043 | } |
| 1044 | else if (cast_uint(i) < asize) { | 1044 | else if (cast_uint(i) < asize) { |
| 1045 | lua_pushinteger(L, i); | 1045 | lua_pushinteger(L, i); |
| 1046 | arr2obj(t, i, s2v(L->top.p)); | 1046 | arr2obj(t, cast_uint(i), s2v(L->top.p)); |
| 1047 | api_incr_top(L); | 1047 | api_incr_top(L); |
| 1048 | lua_pushnil(L); | 1048 | lua_pushnil(L); |
| 1049 | } | 1049 | } |
