summaryrefslogtreecommitdiff
path: root/src/font.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/font.c b/src/font.c
index e2414582f67..50ec39a9a49 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1289,8 +1289,9 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
1 + DBL_MAX_10_EXP + 1)];
if (INTEGERP (val))
{
- intmax_t v = FIXNUMP (val) ? XFIXNUM (val) : bignum_to_intmax (val);
- if (! (0 < v && v <= TYPE_MAXIMUM (uprintmax_t)))
+ intmax_t v;
+ if (! (integer_to_intmax (val, &v)
+ && 0 < v && v <= TYPE_MAXIMUM (uprintmax_t)))
v = pixel_size;
if (v > 0)
{
@@ -4747,16 +4748,10 @@ DEFUN ("open-font", Fopen_font, Sopen_font, 1, 3, 0,
else
{
CHECK_NUMBER (size);
- if (BIGNUMP (size))
- {
- isize = bignum_to_intmax (size);
- if (isize == 0)
- args_out_of_range (font_entity, size);
- }
- else
- isize = (FLOATP (size)
- ? POINT_TO_PIXEL (XFLOAT_DATA (size), FRAME_RES_Y (f))
- : XFIXNUM (size));
+ if (FLOATP (size))
+ isize = POINT_TO_PIXEL (XFLOAT_DATA (size), FRAME_RES_Y (f));
+ else if (! integer_to_intmax (size, &isize))
+ args_out_of_range (font_entity, size);
if (! (INT_MIN <= isize && isize <= INT_MAX))
args_out_of_range (font_entity, size);
if (isize == 0)