| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0593256 commit 9fa63a6
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,7 +60,7 @@ typedef enum UnOpr { OPR_MINUS, OPR_BNOT, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; | |||
| 60 | 60 | #define luaK_jumpto(fs,t) luaK_patchlist(fs, luaK_jump(fs), t) | |
| 61 | 61 | ||
| 62 | 62 | LUAI_FUNC int luaK_code (FuncState *fs, Instruction i); | |
| 63 | - LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); | ||
| 63 | + LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned Bx); | ||
| 64 | 64 | LUAI_FUNC int luaK_codeABCk (FuncState *fs, OpCode o, int A, | |
| 65 | 65 | int B, int C, int k); | |
| 66 | 66 | LUAI_FUNC int luaK_exp2const (FuncState *fs, const expdesc *e, TValue *v); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -91,7 +91,7 @@ typedef signed char ls_byte; | |||
| 91 | 91 | #define L_P2I size_t | |
| 92 | 92 | #endif | |
| 93 | 93 | ||
| 94 | - #define point2uint(p) ((unsigned int)((L_P2I)(p) & UINT_MAX)) | ||
| 94 | + #define point2uint(p) cast_uint((L_P2I)(p) & UINT_MAX) | ||
| 95 | 95 | ||
| 96 | 96 | ||
| 97 | 97 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -320,7 +320,7 @@ LUA_API int lua_closethread (lua_State *L, lua_State *from) { | |||
| 320 | 320 | } | |
| 321 | 321 | ||
| 322 | 322 | ||
| 323 | - LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud, unsigned int seed) { | ||
| 323 | + LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud, unsigned seed) { | ||
| 324 | 324 | int i; | |
| 325 | 325 | lua_State *L; | |
| 326 | 326 | global_State *g; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,15 +40,15 @@ int luaS_eqlngstr (TString *a, TString *b) { | |||
| 40 | 40 | } | |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | - unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { | ||
| 43 | + unsigned luaS_hash (const char *str, size_t l, unsigned seed) { | ||
| 44 | 44 | unsigned int h = seed ^ cast_uint(l); | |
| 45 | 45 | for (; l > 0; l--) | |
| 46 | 46 | h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1])); | |
| 47 | 47 | return h; | |
| 48 | 48 | } | |
| 49 | 49 | ||
| 50 | 50 | ||
| 51 | - unsigned int luaS_hashlongstr (TString *ts) { | ||
| 51 | + unsigned luaS_hashlongstr (TString *ts) { | ||
| 52 | 52 | lua_assert(ts->tt == LUA_VLNGSTR); | |
| 53 | 53 | if (ts->extra == 0) { /* no hash? */ | |
| 54 | 54 | size_t len = ts->u.lnglen; | |
@@ -155,7 +155,7 @@ size_t luaS_sizelngstr (size_t len, int kind) { | |||
| 155 | 155 | ** creates a new string object | |
| 156 | 156 | */ | |
| 157 | 157 | static TString *createstrobj (lua_State *L, size_t totalsize, int tag, | |
| 158 | - unsigned int h) { | ||
| 158 | + unsigned h) { | ||
| 159 | 159 | TString *ts; | |
| 160 | 160 | GCObject *o; | |
| 161 | 161 | o = luaC_newobj(L, tag, totalsize); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,8 +43,8 @@ | |||
| 43 | 43 | #define eqshrstr(a,b) check_exp((a)->tt == LUA_VSHRSTR, (a) == (b)) | |
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | - LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed); | ||
| 47 | - LUAI_FUNC unsigned int luaS_hashlongstr (TString *ts); | ||
| 46 | + LUAI_FUNC unsigned luaS_hash (const char *str, size_t l, unsigned seed); | ||
| 47 | + LUAI_FUNC unsigned luaS_hashlongstr (TString *ts); | ||
| 48 | 48 | LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b); | |
| 49 | 49 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); | |
| 50 | 50 | LUAI_FUNC void luaS_clearcache (global_State *g); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -358,8 +358,8 @@ static unsigned int arrayindex (lua_Integer k) { | |||
| 358 | 358 | ** elements in the array part, then elements in the hash part. The | |
| 359 | 359 | ** beginning of a traversal is signaled by 0. | |
| 360 | 360 | */ | |
| 361 | - static unsigned int findindex (lua_State *L, Table *t, TValue *key, | ||
| 362 | - unsigned int asize) { | ||
| 361 | + static unsigned findindex (lua_State *L, Table *t, TValue *key, | ||
| 362 | + unsigned asize) { | ||
| 363 | 363 | unsigned int i; | |
| 364 | 364 | if (ttisnil(key)) return 0; /* first iteration */ | |
| 365 | 365 | i = ttisinteger(key) ? arrayindex(ivalue(key)) : 0; | |
@@ -462,7 +462,7 @@ static int keyinarray (Table *t, lua_Integer key) { | |||
| 462 | 462 | ** will go to the array part; return the optimal size. (The condition | |
| 463 | 463 | ** 'twotoi > 0' in the for loop stops the loop if 'twotoi' overflows.) | |
| 464 | 464 | */ | |
| 465 | - static unsigned int computesizes (unsigned int nums[], unsigned int *pna) { | ||
| 465 | + static unsigned computesizes (unsigned nums[], unsigned *pna) { | ||
| 466 | 466 | int i; | |
| 467 | 467 | unsigned int twotoi; /* 2^i (candidate for optimal size) */ | |
| 468 | 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 | 506 | ** number of keys that will go into corresponding slice and return | |
| 507 | 507 | ** total number of non-nil keys. | |
| 508 | 508 | */ | |
| 509 | - static unsigned int numusearray (const Table *t, unsigned int *nums) { | ||
| 509 | + static unsigned numusearray (const Table *t, unsigned *nums) { | ||
| 510 | 510 | int lg; | |
| 511 | 511 | unsigned int ttlg; /* 2^lg */ | |
| 512 | 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 | ||
| 536 | - static int numusehash (const Table *t, unsigned int *nums, unsigned int *pna) { | ||
| 536 | + static int numusehash (const Table *t, unsigned *nums, unsigned *pna) { | ||
| 537 | 537 | int totaluse = 0; /* total number of elements */ | |
| 538 | 538 | int ause = 0; /* elements added to 'nums' (can go to array part) */ | |
| 539 | 539 | int i = sizenode(t); | |
@@ -567,8 +567,8 @@ static size_t concretesize (unsigned int size) { | |||
| 567 | 567 | ||
| 568 | 568 | ||
| 569 | 569 | static ArrayCell *resizearray (lua_State *L , Table *t, | |
| 570 | - unsigned int oldasize, | ||
| 571 | - unsigned int newasize) { | ||
| 570 | + unsigned oldasize, | ||
| 571 | + unsigned newasize) { | ||
| 572 | 572 | size_t oldasizeb = concretesize(oldasize); | |
| 573 | 573 | size_t newasizeb = concretesize(newasize); | |
| 574 | 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 | 583 | ** comparison ensures that the shift in the second one does not | |
| 584 | 584 | ** overflow. | |
| 585 | 585 | */ | |
| 586 | - static void setnodevector (lua_State *L, Table *t, unsigned int size) { | ||
| 586 | + static void setnodevector (lua_State *L, Table *t, unsigned size) { | ||
| 587 | 587 | if (size == 0) { /* no elements to hash part? */ | |
| 588 | 588 | t->node = cast(Node *, dummynode); /* use common 'dummynode' */ | |
| 589 | 589 | t->lsizenode = 0; | |
@@ -695,8 +695,8 @@ static void clearNewSlice (Table *t, unsigned oldasize, unsigned newasize) { | |||
| 695 | 695 | ** nils and reinserts the elements of the old hash back into the new | |
| 696 | 696 | ** parts of the table. | |
| 697 | 697 | */ | |
| 698 | - void luaH_resize (lua_State *L, Table *t, unsigned int newasize, | ||
| 699 | - unsigned int nhsize) { | ||
| 698 | + void luaH_resize (lua_State *L, Table *t, unsigned newasize, | ||
| 699 | + unsigned nhsize) { | ||
| 700 | 700 | Table newt; /* to keep the new hash part */ | |
| 701 | 701 | unsigned int oldasize = setlimittosize(t); | |
| 702 | 702 | ArrayCell *newarray; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -151,13 +151,13 @@ LUAI_FUNC void luaH_set (lua_State *L, Table *t, const TValue *key, | |||
| 151 | 151 | LUAI_FUNC void luaH_finishset (lua_State *L, Table *t, const TValue *key, | |
| 152 | 152 | TValue *value, int hres); | |
| 153 | 153 | LUAI_FUNC Table *luaH_new (lua_State *L); | |
| 154 | - LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize, | ||
| 155 | - unsigned int nhsize); | ||
| 156 | - LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize); | ||
| 154 | + LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned nasize, | ||
| 155 | + unsigned nhsize); | ||
| 156 | + LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned nasize); | ||
| 157 | 157 | LUAI_FUNC void luaH_free (lua_State *L, Table *t); | |
| 158 | 158 | LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); | |
| 159 | 159 | LUAI_FUNC lua_Unsigned luaH_getn (Table *t); | |
| 160 | - LUAI_FUNC unsigned int luaH_realasize (const Table *t); | ||
| 160 | + LUAI_FUNC unsigned luaH_realasize (const Table *t); | ||
| 161 | 161 | ||
| 162 | 162 | ||
| 163 | 163 | #if defined(LUA_DEBUG) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -329,8 +329,7 @@ static IdxT choosePivot (IdxT lo, IdxT up, unsigned int rnd) { | |||
| 329 | 329 | /* | |
| 330 | 330 | ** Quicksort algorithm (recursive function) | |
| 331 | 331 | */ | |
| 332 | - static void auxsort (lua_State *L, IdxT lo, IdxT up, | ||
| 333 | - unsigned int rnd) { | ||
| 332 | + static void auxsort (lua_State *L, IdxT lo, IdxT up, unsigned rnd) { | ||
| 334 | 333 | while (lo < up) { /* loop for tail recursion */ | |
| 335 | 334 | IdxT p; /* Pivot index */ | |
| 336 | 335 | IdxT n; /* to be used later */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1008,7 +1008,7 @@ static int table_query (lua_State *L) { | |||
| 1008 | 1008 | lua_pushinteger(L, t->alimit); | |
| 1009 | 1009 | return 3; | |
| 1010 | 1010 | } | |
| 1011 | - else if ((unsigned int)i < asize) { | ||
| 1011 | + else if (cast_uint(i) < asize) { | ||
| 1012 | 1012 | lua_pushinteger(L, i); | |
| 1013 | 1013 | arr2obj(t, i + 1, s2v(L->top.p)); | |
| 1014 | 1014 | api_incr_top(L); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments