diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-11 16:59:20 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-11 16:59:20 -0200 |
commit | 321c7fb6f8e09d95be236f4206e520b613dc4d04 (patch) | |
tree | cab4d70149458edf74e34b8c7445a5e74d704e2f | |
parent | dabb19fc17acee55f9052c5d17ec07360cec809d (diff) | |
download | lua-321c7fb6f8e09d95be236f4206e520b613dc4d04.tar.gz lua-321c7fb6f8e09d95be236f4206e520b613dc4d04.tar.bz2 lua-321c7fb6f8e09d95be236f4206e520b613dc4d04.zip |
details
-rw-r--r-- | liolib.c | 8 | ||||
-rw-r--r-- | lstring.c | 4 |
2 files changed, 6 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 1.96 2000/12/22 17:32:28 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 1.97 2001/01/10 16:58:11 roberto Exp roberto $ |
3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -278,7 +278,7 @@ static int read_line (lua_State *L, FILE *f) { | |||
278 | 278 | ||
279 | static void read_file (lua_State *L, FILE *f) { | 279 | static void read_file (lua_State *L, FILE *f) { |
280 | size_t len = 0; | 280 | size_t len = 0; |
281 | size_t size = BUFSIZ; | 281 | size_t size = LUAL_BUFFERSIZE; |
282 | char *buffer = NULL; | 282 | char *buffer = NULL; |
283 | for (;;) { | 283 | for (;;) { |
284 | char *newbuffer = (char *)realloc(buffer, size); | 284 | char *newbuffer = (char *)realloc(buffer, size); |
@@ -299,8 +299,8 @@ static void read_file (lua_State *L, FILE *f) { | |||
299 | static int read_chars (lua_State *L, FILE *f, size_t n) { | 299 | static int read_chars (lua_State *L, FILE *f, size_t n) { |
300 | char *buffer; | 300 | char *buffer; |
301 | size_t n1; | 301 | size_t n1; |
302 | char statbuff[BUFSIZ]; | 302 | char statbuff[LUAL_BUFFERSIZE]; |
303 | if (n <= BUFSIZ) | 303 | if (n <= LUAL_BUFFERSIZE) |
304 | buffer = statbuff; | 304 | buffer = statbuff; |
305 | else { | 305 | else { |
306 | buffer = (char *)malloc(n); | 306 | buffer = (char *)malloc(n); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.c,v 1.48 2000/12/28 12:55:41 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 1.49 2001/01/10 17:41:50 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 | */ |
@@ -43,7 +43,7 @@ void luaS_resize (lua_State *L, stringtable *tb, int newsize) { | |||
43 | TString *next = p->nexthash; /* save next */ | 43 | TString *next = p->nexthash; /* save next */ |
44 | luint32 h = (tb == &L->strt) ? p->u.s.hash : IntPoint(p->u.d.value); | 44 | luint32 h = (tb == &L->strt) ? p->u.s.hash : IntPoint(p->u.d.value); |
45 | int h1 = lmod(h, newsize); /* new position */ | 45 | int h1 = lmod(h, newsize); /* new position */ |
46 | LUA_ASSERT(h%newsize == lmod(h, newsize), | 46 | LUA_ASSERT((int)(h%newsize) == lmod(h, newsize), |
47 | "a&(x-1) == a%x, for x power of 2"); | 47 | "a&(x-1) == a%x, for x power of 2"); |
48 | p->nexthash = newhash[h1]; /* chain it in new position */ | 48 | p->nexthash = newhash[h1]; /* chain it in new position */ |
49 | newhash[h1] = p; | 49 | newhash[h1] = p; |