1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

* unit.c (scm_cvref): Eliminate unnecessary uses of SCM_NIMP,

SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
This commit is contained in:
Dirk Herrmann 2003-09-04 20:14:02 +00:00
parent 5d7d39ff5d
commit 3ea39242b8
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
* unit.c (scm_cvref): Eliminate unnecessary uses of SCM_NIMP,
SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
2003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
* numbers.h (SCM_MAKINUM): Define in terms of scm_tc2_int.

View file

@ -1184,21 +1184,21 @@ scm_cvref (SCM v, unsigned long pos, SCM last)
return scm_long_long2num (((long long *) SCM_CELL_WORD_1 (v))[pos]);
#endif
case scm_tc7_fvect:
if (SCM_NIMP (last) && !SCM_EQ_P (last, scm_flo0) && SCM_SLOPPY_REALP (last))
if (SCM_REALP (last) && !SCM_EQ_P (last, scm_flo0))
{
SCM_REAL_VALUE (last) = ((float *) SCM_CELL_WORD_1 (v))[pos];
return last;
}
return scm_make_real (((float *) SCM_CELL_WORD_1 (v))[pos]);
case scm_tc7_dvect:
if (SCM_NIMP (last) && !SCM_EQ_P (last, scm_flo0) && SCM_SLOPPY_REALP (last))
if (SCM_REALP (last) && !SCM_EQ_P (last, scm_flo0))
{
SCM_REAL_VALUE (last) = ((double *) SCM_CELL_WORD_1 (v))[pos];
return last;
}
return scm_make_real (((double *) SCM_CELL_WORD_1 (v))[pos]);
case scm_tc7_cvect:
if (SCM_NIMP (last) && SCM_SLOPPY_COMPLEXP (last))
if (SCM_COMPLEXP (last))
{
SCM_COMPLEX_REAL (last) = ((double *) SCM_CELL_WORD_1 (v))[2 * pos];
SCM_COMPLEX_IMAG (last) = ((double *) SCM_CELL_WORD_1 (v))[2 * pos + 1];