mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 14:49:18 +02:00
don't check for bits over 32 on 32-bit machines in integer_log2
(removes shift width warning)
This commit is contained in:
parent
482e0d79a9
commit
6fa8474c42
1 changed files with 4 additions and 1 deletions
|
@ -236,9 +236,12 @@ static const char log_table_256[256] =
|
||||||
|
|
||||||
static sexp_uint_t integer_log2 (sexp_uint_t x) {
|
static sexp_uint_t integer_log2 (sexp_uint_t x) {
|
||||||
sexp_uint_t t, tt;
|
sexp_uint_t t, tt;
|
||||||
|
#if SEXP_64_BIT
|
||||||
if ((tt = x >> 32))
|
if ((tt = x >> 32))
|
||||||
return integer_log2(tt) + 32;
|
return integer_log2(tt) + 32;
|
||||||
else if ((tt = x >> 16))
|
else
|
||||||
|
#endif
|
||||||
|
if ((tt = x >> 16))
|
||||||
return (t = tt >> 8) ? 24 + log_table_256[t] : 16 + log_table_256[tt];
|
return (t = tt >> 8) ? 24 + log_table_256[t] : 16 + log_table_256[tt];
|
||||||
else
|
else
|
||||||
return (t = x >> 8) ? 8 + log_table_256[t] : log_table_256[x];
|
return (t = x >> 8) ? 8 + log_table_256[t] : log_table_256[x];
|
||||||
|
|
Loading…
Add table
Reference in a new issue