diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-01-30 15:28:05 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-01-30 15:28:05 -0200 |
commit | f856fdeabde61ee2f020d5fea799e4f5cd85cb44 (patch) | |
tree | b88dba9037a2dda779fe8792d072eaa60b5b2400 | |
parent | 653977a0ac6de8f89980764da8b88412dd6ea187 (diff) | |
download | lua-f856fdeabde61ee2f020d5fea799e4f5cd85cb44.tar.gz lua-f856fdeabde61ee2f020d5fea799e4f5cd85cb44.tar.bz2 lua-f856fdeabde61ee2f020d5fea799e4f5cd85cb44.zip |
details
-rw-r--r-- | lobject.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -35,14 +35,14 @@ int luaO_log2 (unsigned int x) { | |||
35 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, | 35 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, |
36 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, | 36 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, |
37 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, | 37 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, |
38 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, | 38 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 |
39 | }; | 39 | }; |
40 | if (x & 0xffff0000) { | 40 | if (x >= 0x00010000) { |
41 | if (x & 0xff000000) return log_8[((x>>24) & 0xff) - 1]+24; | 41 | if (x >= 0x01000000) return log_8[((x>>24) & 0xff) - 1]+24; |
42 | else return log_8[((x>>16) & 0xff) - 1]+16; | 42 | else return log_8[((x>>16) & 0xff) - 1]+16; |
43 | } | 43 | } |
44 | else { | 44 | else { |
45 | if (x & 0x0000ff00) return log_8[((x>>8) & 0xff) - 1]+8; | 45 | if (x >= 0x00000100) return log_8[((x>>8) & 0xff) - 1]+8; |
46 | else if (x) return log_8[(x & 0xff) - 1]; | 46 | else if (x) return log_8[(x & 0xff) - 1]; |
47 | return -1; /* special `log' for 0 */ | 47 | return -1; /* special `log' for 0 */ |
48 | } | 48 | } |