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

Merge remote-tracking branch 'origin/stable-2.0'

This commit is contained in:
Mark H Weaver 2013-08-11 22:46:22 -04:00
commit 1160e2d94e
9 changed files with 80 additions and 79 deletions

View file

@ -329,9 +329,15 @@ SCM_DEFINE (scm_dereference_pointer, "dereference-pointer", 1, 0, 0,
"holds a pointer, return this pointer.")
#define FUNC_NAME s_scm_dereference_pointer
{
void **ptr;
SCM_VALIDATE_POINTER (1, pointer);
return scm_from_pointer (* (void **) SCM_POINTER_VALUE (pointer), NULL);
ptr = SCM_POINTER_VALUE (pointer);
if (SCM_UNLIKELY (ptr == NULL))
null_pointer_error (FUNC_NAME);
return scm_from_pointer (*ptr, NULL);
}
#undef FUNC_NAME

View file

@ -48,6 +48,7 @@
#endif
#include <verify.h>
#include <assert.h>
#include <math.h>
#include <string.h>
@ -5004,7 +5005,7 @@ left_shift_exact_integer (SCM n, long count)
return result;
}
else
scm_syserror ("left_shift_exact_integer");
assert (0);
}
/* Efficiently compute floor (N / 2^COUNT),
@ -5030,7 +5031,7 @@ floor_right_shift_exact_integer (SCM n, long count)
return scm_i_normbig (result);
}
else
scm_syserror ("floor_right_shift_exact_integer");
assert (0);
}
/* Efficiently compute round (N / 2^COUNT),
@ -5068,7 +5069,7 @@ round_right_shift_exact_integer (SCM n, long count)
return scm_i_normbig (q);
}
else
scm_syserror ("round_right_shift_exact_integer");
assert (0);
}
SCM_DEFINE (scm_ash, "ash", 2, 0, 0,
@ -6199,7 +6200,7 @@ mem2ureal (SCM mem, unsigned int *p_idx,
}
/* We should never get here */
scm_syserror ("mem2ureal");
assert (0);
}
@ -9194,7 +9195,15 @@ SCM_PRIMITIVE_GENERIC (scm_numerator, "numerator", 1, 0, 0,
else if (SCM_FRACTIONP (z))
return SCM_FRACTION_NUMERATOR (z);
else if (SCM_REALP (z))
return scm_exact_to_inexact (scm_numerator (scm_inexact_to_exact (z)));
{
double zz = SCM_REAL_VALUE (z);
if (zz == floor (zz))
/* Handle -0.0 and infinities in accordance with R6RS
flnumerator, and optimize handling of integers. */
return z;
else
return scm_exact_to_inexact (scm_numerator (scm_inexact_to_exact (z)));
}
else
return scm_wta_dispatch_1 (g_scm_numerator, z, SCM_ARG1, s_scm_numerator);
}
@ -9211,7 +9220,15 @@ SCM_PRIMITIVE_GENERIC (scm_denominator, "denominator", 1, 0, 0,
else if (SCM_FRACTIONP (z))
return SCM_FRACTION_DENOMINATOR (z);
else if (SCM_REALP (z))
return scm_exact_to_inexact (scm_denominator (scm_inexact_to_exact (z)));
{
double zz = SCM_REAL_VALUE (z);
if (zz == floor (zz))
/* Handle infinities in accordance with R6RS fldenominator, and
optimize handling of integers. */
return scm_i_from_double (1.0);
else
return scm_exact_to_inexact (scm_denominator (scm_inexact_to_exact (z)));
}
else
return scm_wta_dispatch_1 (g_scm_denominator, z, SCM_ARG1,
s_scm_denominator);

View file

@ -448,7 +448,8 @@ print_extended_symbol (SCM sym, SCM port)
SUBSEQUENT_IDENTIFIER_MASK
| UC_CATEGORY_MASK_Zs))
{
if (!display_character (c, port, strategy))
if (!display_character (c, port, strategy)
|| (c == '\\' && !display_character (c, port, strategy)))
scm_encoding_error ("print_extended_symbol", errno,
"cannot convert to output locale",
port, SCM_MAKE_CHAR (c));