aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-01-11 18:23:01 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-01-11 18:23:01 -0200
commitb7ae43d457ca7b5a46ca768f482b334d70897a14 (patch)
tree0f47c94c9ee6ac5ab21b7bf3c1495f1f42d55889
parentf083812c020186d0d919833100c1a0b6eda8c2c0 (diff)
downloadlua-b7ae43d457ca7b5a46ca768f482b334d70897a14.tar.gz
lua-b7ae43d457ca7b5a46ca768f482b334d70897a14.tar.bz2
lua-b7ae43d457ca7b5a46ca768f482b334d70897a14.zip
detail
-rw-r--r--llimits.h5
-rw-r--r--lstring.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/llimits.h b/llimits.h
index 2bf501d1..1b5b3e04 100644
--- a/llimits.h
+++ b/llimits.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llimits.h,v 1.33 2001/10/02 16:45:03 roberto Exp $ 2** $Id: llimits.h,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $
3** Limits, basic types, and some other `installation-dependent' definitions 3** Limits, basic types, and some other `installation-dependent' definitions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -45,7 +45,8 @@ typedef unsigned int lu_hash;
45/* its signed equivalent */ 45/* its signed equivalent */
46typedef int ls_hash; 46typedef int ls_hash;
47 47
48/* an unsigned integer big enough to count the total memory used by Lua */ 48/* an unsigned integer big enough to count the total memory used by Lua; */
49/* it should be at least as large as size_t */
49typedef unsigned long lu_mem; 50typedef unsigned long lu_mem;
50 51
51/* an integer big enough to count the number of strings in use */ 52/* an integer big enough to count the number of strings in use */
diff --git a/lstring.c b/lstring.c
index d12b6f0f..27e3214b 100644
--- a/lstring.c
+++ b/lstring.c
@@ -68,7 +68,7 @@ static TString *newlstr (lua_State *L, const char *str, size_t l, lu_hash h) {
68 68
69TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { 69TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
70 TString *ts; 70 TString *ts;
71 lu_hash h = l; /* seed */ 71 lu_hash h = (lu_hash)l; /* seed */
72 size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */ 72 size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */
73 size_t l1; 73 size_t l1;
74 for (l1=l; l1>=step; l1-=step) /* compute hash */ 74 for (l1=l; l1>=step; l1-=step) /* compute hash */