mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 22:10:21 +02:00
(scm_bit_extract): Use SCM_SRS for signed right shift.
This commit is contained in:
parent
10cc8b0197
commit
d77ad56065
1 changed files with 2 additions and 4 deletions
|
@ -1823,10 +1823,8 @@ SCM_DEFINE (scm_bit_extract, "bit-extract", 3, 0, 0,
|
|||
long int in = SCM_INUM (n);
|
||||
|
||||
/* When istart>=SCM_I_FIXNUM_BIT we can just limit the shift to
|
||||
SCM_I_FIXNUM_BIT-1 to get either 0 or -1 per the sign of "in".
|
||||
FIXME: This shift relies on signed right shifts being arithmetic,
|
||||
which is not guaranteed by C99. */
|
||||
in >>= MIN (istart, SCM_I_FIXNUM_BIT-1);
|
||||
SCM_I_FIXNUM_BIT-1 to get either 0 or -1 per the sign of "in". */
|
||||
in = SCM_SRS (in, MIN (istart, SCM_I_FIXNUM_BIT-1));
|
||||
|
||||
if (in < 0 && bits >= SCM_I_FIXNUM_BIT)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue