aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-03-22 14:06:11 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-03-22 14:06:11 -0300
commit9fa63a62682c1353eeabd4575152941fa6f3e70f (patch)
tree1aad2dd0de78388f6be134399ae4183692ce377f /ltable.c
parent0593256707ceddb1bc9cd4b25b822a7fbcfedd66 (diff)
downloadlua-9fa63a62682c1353eeabd4575152941fa6f3e70f.tar.gz
lua-9fa63a62682c1353eeabd4575152941fa6f3e70f.tar.bz2
lua-9fa63a62682c1353eeabd4575152941fa6f3e70f.zip
Some 'unsigned int' changed to 'unsigned'
'unsigned int' is too long sometimes. (We already write 'long' instead of 'long int'...)
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ltable.c b/ltable.c
index f62f36bc..ef19a5c5 100644
--- a/ltable.c
+++ b/ltable.c
@@ -358,8 +358,8 @@ static unsigned int arrayindex (lua_Integer k) {
358** elements in the array part, then elements in the hash part. The 358** elements in the array part, then elements in the hash part. The
359** beginning of a traversal is signaled by 0. 359** beginning of a traversal is signaled by 0.
360*/ 360*/
361static unsigned int findindex (lua_State *L, Table *t, TValue *key, 361static unsigned findindex (lua_State *L, Table *t, TValue *key,
362 unsigned int asize) { 362 unsigned asize) {
363 unsigned int i; 363 unsigned int i;
364 if (ttisnil(key)) return 0; /* first iteration */ 364 if (ttisnil(key)) return 0; /* first iteration */
365 i = ttisinteger(key) ? arrayindex(ivalue(key)) : 0; 365 i = ttisinteger(key) ? arrayindex(ivalue(key)) : 0;
@@ -462,7 +462,7 @@ static int keyinarray (Table *t, lua_Integer key) {
462** will go to the array part; return the optimal size. (The condition 462** will go to the array part; return the optimal size. (The condition
463** 'twotoi > 0' in the for loop stops the loop if 'twotoi' overflows.) 463** 'twotoi > 0' in the for loop stops the loop if 'twotoi' overflows.)
464*/ 464*/
465static unsigned int computesizes (unsigned int nums[], unsigned int *pna) { 465static unsigned computesizes (unsigned nums[], unsigned *pna) {
466 int i; 466 int i;
467 unsigned int twotoi; /* 2^i (candidate for optimal size) */ 467 unsigned int twotoi; /* 2^i (candidate for optimal size) */
468 unsigned int a = 0; /* number of elements smaller than 2^i */ 468 unsigned int a = 0; /* number of elements smaller than 2^i */
@@ -506,7 +506,7 @@ l_sinline int arraykeyisempty (const Table *t, lua_Integer key) {
506** number of keys that will go into corresponding slice and return 506** number of keys that will go into corresponding slice and return
507** total number of non-nil keys. 507** total number of non-nil keys.
508*/ 508*/
509static unsigned int numusearray (const Table *t, unsigned int *nums) { 509static unsigned numusearray (const Table *t, unsigned *nums) {
510 int lg; 510 int lg;
511 unsigned int ttlg; /* 2^lg */ 511 unsigned int ttlg; /* 2^lg */
512 unsigned int ause = 0; /* summation of 'nums' */ 512 unsigned int ause = 0; /* summation of 'nums' */
@@ -533,7 +533,7 @@ static unsigned int numusearray (const Table *t, unsigned int *nums) {
533} 533}
534 534
535 535
536static int numusehash (const Table *t, unsigned int *nums, unsigned int *pna) { 536static int numusehash (const Table *t, unsigned *nums, unsigned *pna) {
537 int totaluse = 0; /* total number of elements */ 537 int totaluse = 0; /* total number of elements */
538 int ause = 0; /* elements added to 'nums' (can go to array part) */ 538 int ause = 0; /* elements added to 'nums' (can go to array part) */
539 int i = sizenode(t); 539 int i = sizenode(t);
@@ -567,8 +567,8 @@ static size_t concretesize (unsigned int size) {
567 567
568 568
569static ArrayCell *resizearray (lua_State *L , Table *t, 569static ArrayCell *resizearray (lua_State *L , Table *t,
570 unsigned int oldasize, 570 unsigned oldasize,
571 unsigned int newasize) { 571 unsigned newasize) {
572 size_t oldasizeb = concretesize(oldasize); 572 size_t oldasizeb = concretesize(oldasize);
573 size_t newasizeb = concretesize(newasize); 573 size_t newasizeb = concretesize(newasize);
574 void *a = luaM_reallocvector(L, t->array, oldasizeb, newasizeb, lu_byte); 574 void *a = luaM_reallocvector(L, t->array, oldasizeb, newasizeb, lu_byte);
@@ -583,7 +583,7 @@ static ArrayCell *resizearray (lua_State *L , Table *t,
583** comparison ensures that the shift in the second one does not 583** comparison ensures that the shift in the second one does not
584** overflow. 584** overflow.
585*/ 585*/
586static void setnodevector (lua_State *L, Table *t, unsigned int size) { 586static void setnodevector (lua_State *L, Table *t, unsigned size) {
587 if (size == 0) { /* no elements to hash part? */ 587 if (size == 0) { /* no elements to hash part? */
588 t->node = cast(Node *, dummynode); /* use common 'dummynode' */ 588 t->node = cast(Node *, dummynode); /* use common 'dummynode' */
589 t->lsizenode = 0; 589 t->lsizenode = 0;
@@ -695,8 +695,8 @@ static void clearNewSlice (Table *t, unsigned oldasize, unsigned newasize) {
695** nils and reinserts the elements of the old hash back into the new 695** nils and reinserts the elements of the old hash back into the new
696** parts of the table. 696** parts of the table.
697*/ 697*/
698void luaH_resize (lua_State *L, Table *t, unsigned int newasize, 698void luaH_resize (lua_State *L, Table *t, unsigned newasize,
699 unsigned int nhsize) { 699 unsigned nhsize) {
700 Table newt; /* to keep the new hash part */ 700 Table newt; /* to keep the new hash part */
701 unsigned int oldasize = setlimittosize(t); 701 unsigned int oldasize = setlimittosize(t);
702 ArrayCell *newarray; 702 ArrayCell *newarray;