aboutsummaryrefslogtreecommitdiff
path: root/lstring.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstring.c')
-rw-r--r--lstring.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lstring.c b/lstring.c
index 1454dc17..a5e0205d 100644
--- a/lstring.c
+++ b/lstring.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstring.c,v 1.65 2001/06/15 20:36:57 roberto Exp roberto $ 2** $Id: lstring.c,v 1.66 2001/08/27 15:16:28 roberto Exp $
3** String table (keeps all strings handled by Lua) 3** String table (keeps all strings handled by Lua)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -35,7 +35,7 @@ void luaS_resize (lua_State *L, int newsize) {
35 TString *next = p->tsv.nexthash; /* save next */ 35 TString *next = p->tsv.nexthash; /* save next */
36 lu_hash h = p->tsv.hash; 36 lu_hash h = p->tsv.hash;
37 int h1 = lmod(h, newsize); /* new position */ 37 int h1 = lmod(h, newsize); /* new position */
38 lua_assert((int)(h%newsize) == lmod(h, newsize)); 38 lua_assert(cast(int, h%newsize) == lmod(h, newsize));
39 p->tsv.nexthash = newhash[h1]; /* chain it in new position */ 39 p->tsv.nexthash = newhash[h1]; /* chain it in new position */
40 newhash[h1] = p; 40 newhash[h1] = p;
41 p = next; 41 p = next;
@@ -48,7 +48,7 @@ void luaS_resize (lua_State *L, int newsize) {
48 48
49 49
50static TString *newlstr (lua_State *L, const l_char *str, size_t l, lu_hash h) { 50static TString *newlstr (lua_State *L, const l_char *str, size_t l, lu_hash h) {
51 TString *ts = (TString *)luaM_malloc(L, sizestring(l)); 51 TString *ts = cast(TString *, luaM_malloc(L, sizestring(l)));
52 stringtable *tb; 52 stringtable *tb;
53 ts->tsv.nexthash = NULL; 53 ts->tsv.nexthash = NULL;
54 ts->tsv.len = l; 54 ts->tsv.len = l;
@@ -61,7 +61,7 @@ static TString *newlstr (lua_State *L, const l_char *str, size_t l, lu_hash h) {
61 ts->tsv.nexthash = tb->hash[h]; /* chain new entry */ 61 ts->tsv.nexthash = tb->hash[h]; /* chain new entry */
62 tb->hash[h] = ts; 62 tb->hash[h] = ts;
63 tb->nuse++; 63 tb->nuse++;
64 if (tb->nuse > (ls_nstr)tb->size && tb->size <= MAX_INT/2) 64 if (tb->nuse > cast(ls_nstr, tb->size) && tb->size <= MAX_INT/2)
65 luaS_resize(L, tb->size*2); /* too crowded */ 65 luaS_resize(L, tb->size*2); /* too crowded */
66 return ts; 66 return ts;
67} 67}
@@ -85,7 +85,7 @@ TString *luaS_newlstr (lua_State *L, const l_char *str, size_t l) {
85 85
86 86
87Udata *luaS_newudata (lua_State *L, size_t s) { 87Udata *luaS_newudata (lua_State *L, size_t s) {
88 Udata *u = (Udata *)luaM_malloc(L, sizeudata(s)); 88 Udata *u = cast(Udata *, luaM_malloc(L, sizeudata(s)));
89 u->uv.len = s; 89 u->uv.len = s;
90 u->uv.tag = 0; 90 u->uv.tag = 0;
91 u->uv.value = u + 1; 91 u->uv.value = u + 1;