diff options
Diffstat (limited to 'lstring.c')
-rw-r--r-- | lstring.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.c,v 1.59 2001/02/20 18:15:33 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 1.60 2001/02/22 17:15:18 roberto Exp roberto $ |
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 | */ |
@@ -63,7 +63,7 @@ static void newentry (lua_State *L, stringtable *tb, TString *ts, int h) { | |||
63 | 63 | ||
64 | 64 | ||
65 | 65 | ||
66 | TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { | 66 | TString *luaS_newlstr (lua_State *L, const l_char *str, size_t l) { |
67 | TString *ts; | 67 | TString *ts; |
68 | lu_hash h = l; /* seed */ | 68 | lu_hash h = l; /* seed */ |
69 | size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */ | 69 | size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */ |
@@ -81,7 +81,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { | |||
81 | ts->len = l; | 81 | ts->len = l; |
82 | ts->u.s.hash = h; | 82 | ts->u.s.hash = h; |
83 | ts->u.s.constindex = 0; | 83 | ts->u.s.constindex = 0; |
84 | memcpy(getstr(ts), str, l*sizeof(char)); | 84 | memcpy(getstr(ts), str, l*sizeof(l_char)); |
85 | getstr(ts)[l] = 0; /* ending 0 */ | 85 | getstr(ts)[l] = 0; /* ending 0 */ |
86 | newentry(L, &G(L)->strt, ts, lmod(h, G(L)->strt.size)); /* insert it */ | 86 | newentry(L, &G(L)->strt, ts, lmod(h, G(L)->strt.size)); /* insert it */ |
87 | return ts; | 87 | return ts; |