1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-26 10:49:33 +00:00

Update src/{ns,mac}*.m to use bignum-compatible macros

* src/nsterm.m:
* src/nsselect.m:
* src/nsmenu.m:
* src/nsimage.m:
* src/nsfont.m:
* src/nsfns.m:
* src/macfont.m: Replace
"make_number"		-> "make_fixnum",
"XINT"			-> "XFIXNUM",
"XFASTINT"		-> "XFIXNAT",
"TYPE_RANGED_INTEGERP"	-> "TYPE_RANGED_FIXNUMP",
"RANGED_INTEGERP"	-> "RANGED_FIXNUMP",
"CHECK_NATNUM"		-> "CHECK_FIXNAT",
"CHECK_NUMBER"		-> "CHECK_FIXNUM",
"INTEGERP"		-> "FIXNUMP",
"NUMBERP"		-> "FIXED_OR_FLOATP",
as done in the following changes:
2018-07-06 Rename integerp->fixnum, etc, in preparation
for bignums (42fe787b)
2018-08-07 More macro renamings for bignum (d1ec3a0a)
This commit is contained in:
Charles A. Roelli 2018-08-09 16:00:20 +02:00
parent 90dba077cf
commit d0b279a505
7 changed files with 158 additions and 158 deletions

View File

@ -851,7 +851,7 @@ static void mac_font_get_glyphs_for_variants (CFDataRef, UTF32Char,
* ((point->y - (point - 1)->y)
/ (point->x - (point - 1)->x)));
FONT_SET_STYLE (spec_or_entity, numeric_traits[i].index,
make_number (lround (floatval)));
make_fixnum (lround (floatval)));
}
}
@ -864,16 +864,16 @@ static void mac_font_get_glyphs_for_variants (CFDataRef, UTF32Char,
cfnumber_get_font_symbolic_traits_value (num, &sym_traits);
spacing = (sym_traits & kCTFontTraitMonoSpace
? FONT_SPACING_MONO : FONT_SPACING_PROPORTIONAL);
ASET (spec_or_entity, FONT_SPACING_INDEX, make_number (spacing));
ASET (spec_or_entity, FONT_SPACING_INDEX, make_fixnum (spacing));
}
CFRelease (dict);
}
num = CTFontDescriptorCopyAttribute (desc, kCTFontSizeAttribute);
if (num && CFNumberGetValue (num, kCFNumberCGFloatType, &floatval))
ASET (spec_or_entity, FONT_SIZE_INDEX, make_number (floatval));
ASET (spec_or_entity, FONT_SIZE_INDEX, make_fixnum (floatval));
else
ASET (spec_or_entity, FONT_SIZE_INDEX, make_number (0));
ASET (spec_or_entity, FONT_SIZE_INDEX, make_fixnum (0));
if (num)
CFRelease (num);
}
@ -903,22 +903,22 @@ static void mac_font_get_glyphs_for_variants (CFDataRef, UTF32Char,
cfnumber_get_font_symbolic_traits_value (num, &sym_traits);
CFRelease (dict);
}
if (EQ (AREF (entity, FONT_SIZE_INDEX), make_number (0)))
ASET (entity, FONT_AVGWIDTH_INDEX, make_number (0));
if (EQ (AREF (entity, FONT_SIZE_INDEX), make_fixnum (0)))
ASET (entity, FONT_AVGWIDTH_INDEX, make_fixnum (0));
ASET (entity, FONT_EXTRA_INDEX, Fcopy_sequence (extra));
name = CTFontDescriptorCopyAttribute (desc, kCTFontNameAttribute);
font_put_extra (entity, QCfont_entity,
Fcons (make_mint_ptr ((void *) name),
make_number (sym_traits)));
make_fixnum (sym_traits)));
if (synth_sym_traits & kCTFontTraitItalic)
FONT_SET_STYLE (entity, FONT_SLANT_INDEX,
make_number (FONT_SLANT_SYNTHETIC_ITALIC));
make_fixnum (FONT_SLANT_SYNTHETIC_ITALIC));
if (synth_sym_traits & kCTFontTraitBold)
FONT_SET_STYLE (entity, FONT_WEIGHT_INDEX,
make_number (FONT_WEIGHT_SYNTHETIC_BOLD));
make_fixnum (FONT_WEIGHT_SYNTHETIC_BOLD));
if (synth_sym_traits & kCTFontTraitMonoSpace)
ASET (entity, FONT_SPACING_INDEX,
make_number (FONT_SPACING_SYNTHETIC_MONO));
make_fixnum (FONT_SPACING_SYNTHETIC_MONO));
return entity;
}
@ -1798,9 +1798,9 @@ static int macfont_variation_glyphs (struct font *, int c,
continue;
len = Flength (val);
spec->features[i] =
(min (PTRDIFF_MAX, SIZE_MAX) / sizeof (int) < XINT (len)
(min (PTRDIFF_MAX, SIZE_MAX) / sizeof (int) < XFIXNUM (len)
? 0
: malloc (XINT (len) * sizeof *spec->features[i]));
: malloc (XFIXNUM (len) * sizeof *spec->features[i]));
if (! spec->features[i])
{
if (i > 0 && spec->features[0])
@ -1940,9 +1940,9 @@ static int macfont_variation_glyphs (struct font *, int c,
{
UniChar unichars[2];
CFIndex count =
macfont_store_utf32char_to_unichars (XFASTINT (XCAR (chars)),
macfont_store_utf32char_to_unichars (XFIXNAT (XCAR (chars)),
unichars);
CFRange range = CFRangeMake (XFASTINT (XCAR (chars)), 1);
CFRange range = CFRangeMake (XFIXNAT (XCAR (chars)), 1);
CFStringAppendCharacters (string, unichars, count);
CFCharacterSetAddCharactersInRange (cs, range);
@ -1981,10 +1981,10 @@ static int macfont_variation_glyphs (struct font *, int c,
for (i = 0; i < ARRAYELTS (numeric_traits); i++)
{
tmp = AREF (spec, numeric_traits[i].index);
if (INTEGERP (tmp))
if (FIXNUMP (tmp))
{
CGPoint *point = numeric_traits[i].points;
CGFloat floatval = (XINT (tmp) >> 8); // XXX
CGFloat floatval = (XFIXNUM (tmp) >> 8); // XXX
CFNumberRef num;
while (point->y < floatval)
@ -2069,9 +2069,9 @@ static int macfont_variation_glyphs (struct font *, int c,
ptrdiff_t j;
for (j = 0; j < ASIZE (chars); j++)
if (TYPE_RANGED_INTEGERP (UTF32Char, AREF (chars, j))
if (TYPE_RANGED_FIXNUMP (UTF32Char, AREF (chars, j))
&& CFCharacterSetIsLongCharacterMember (desc_charset,
XFASTINT (AREF (chars, j))))
XFIXNAT (AREF (chars, j))))
break;
if (j == ASIZE (chars))
result = false;
@ -2161,8 +2161,8 @@ static int macfont_variation_glyphs (struct font *, int c,
languages = CFDictionaryGetValue (attributes, kCTFontLanguagesAttribute);
if (INTEGERP (AREF (spec, FONT_SPACING_INDEX)))
spacing = XINT (AREF (spec, FONT_SPACING_INDEX));
if (FIXNUMP (AREF (spec, FONT_SPACING_INDEX)))
spacing = XFIXNUM (AREF (spec, FONT_SPACING_INDEX));
traits = ((CFMutableDictionaryRef)
CFDictionaryGetValue (attributes, kCTFontTraitsAttribute));
@ -2532,9 +2532,9 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
|| ! CONSP (XCDR (val)))
return Qnil;
font_name = xmint_pointer (XCAR (XCDR (val)));
sym_traits = XINT (XCDR (XCDR (val)));
sym_traits = XFIXNUM (XCDR (XCDR (val)));
size = XINT (AREF (entity, FONT_SIZE_INDEX));
size = XFIXNUM (AREF (entity, FONT_SIZE_INDEX));
if (size == 0)
size = pixel_size;
@ -2563,7 +2563,7 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
macfont_info->cgfont = CTFontCopyGraphicsFont (macfont, NULL);
val = assq_no_quit (QCdestination, AREF (entity, FONT_EXTRA_INDEX));
if (CONSP (val) && EQ (XCDR (val), make_number (1)))
if (CONSP (val) && EQ (XCDR (val), make_fixnum (1)))
macfont_info->screen_font = mac_screen_font_create_with_name (font_name,
size);
else
@ -2584,8 +2584,8 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
macfont_info->synthetic_bold_p = 1;
if (sym_traits & kCTFontTraitMonoSpace)
macfont_info->spacing = MACFONT_SPACING_MONO;
else if (INTEGERP (AREF (entity, FONT_SPACING_INDEX))
&& (XINT (AREF (entity, FONT_SPACING_INDEX))
else if (FIXNUMP (AREF (entity, FONT_SPACING_INDEX))
&& (XFIXNUM (AREF (entity, FONT_SPACING_INDEX))
== FONT_SPACING_SYNTHETIC_MONO))
macfont_info->spacing = MACFONT_SPACING_SYNTHETIC_MONO;
if (macfont_info->synthetic_italic_p || macfont_info->synthetic_bold_p)
@ -2992,7 +2992,7 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
if (NILP (lglyph))
{
lglyph = Fmake_vector (make_number (LGLYPH_SIZE), Qnil);
lglyph = Fmake_vector (make_fixnum (LGLYPH_SIZE), Qnil);
LGSTRING_SET_GLYPH (lgstring, i, lglyph);
}
@ -3046,17 +3046,17 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
{
Lisp_Object vec;
vec = Fmake_vector (make_number (3), Qnil);
ASET (vec, 0, make_number (xoff));
ASET (vec, 1, make_number (yoff));
ASET (vec, 2, make_number (wadjust));
vec = Fmake_vector (make_fixnum (3), Qnil);
ASET (vec, 0, make_fixnum (xoff));
ASET (vec, 1, make_fixnum (yoff));
ASET (vec, 2, make_fixnum (wadjust));
LGLYPH_SET_ADJUSTMENT (lglyph, vec);
}
}
unblock_input ();
return make_number (used);
return make_fixnum (used);
}
/* Structures for the UVS subtable (format 14) in the cmap table. */

View File

@ -209,7 +209,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
if (keys && [keys length] )
{
key = [keys characterAtIndex: 0];
res = make_number (key|super_modifier);
res = make_fixnum (key|super_modifier);
}
else
{
@ -589,8 +589,8 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
if (FRAME_MINIBUF_ONLY_P (f))
return;
if (TYPE_RANGED_INTEGERP (int, value))
nlines = XINT (value);
if (TYPE_RANGED_FIXNUMP (int, value))
nlines = XFIXNUM (value);
else
nlines = 0;
@ -627,8 +627,8 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
if (FRAME_MINIBUF_ONLY_P (f))
return;
if (RANGED_INTEGERP (0, value, INT_MAX))
nlines = XFASTINT (value);
if (RANGED_FIXNUMP (0, value, INT_MAX))
nlines = XFIXNAT (value);
else
nlines = 0;
@ -686,7 +686,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
int old_width = FRAME_INTERNAL_BORDER_WIDTH (f);
CHECK_TYPE_RANGED_INTEGER (int, arg);
f->internal_border_width = XINT (arg);
f->internal_border_width = XFIXNUM (arg);
if (FRAME_INTERNAL_BORDER_WIDTH (f) < 0)
f->internal_border_width = 0;
@ -884,10 +884,10 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
icon_y = x_get_arg (dpyinfo, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
{
CHECK_NUMBER (icon_x);
CHECK_NUMBER (icon_y);
f->output_data.ns->icon_top = XINT (icon_y);
f->output_data.ns->icon_left = XINT (icon_x);
CHECK_FIXNUM (icon_x);
CHECK_FIXNUM (icon_y);
f->output_data.ns->icon_top = XFIXNUM (icon_y);
f->output_data.ns->icon_left = XFIXNUM (icon_x);
}
else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))
error ("Both left and top icon corners of icon must be specified");
@ -1086,7 +1086,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
if (EQ (parent, Qunbound))
parent = Qnil;
if (! NILP (parent))
CHECK_NUMBER (parent);
CHECK_FIXNUM (parent);
/* make_frame_without_minibuffer can run Lisp code and garbage collect. */
/* No need to protect DISPLAY because that's not used after passing
@ -1127,9 +1127,9 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
record_unwind_protect (unwind_create_frame, frame);
f->output_data.ns->window_desc = desc_ctr++;
if (TYPE_RANGED_INTEGERP (Window, parent))
if (TYPE_RANGED_FIXNUMP (Window, parent))
{
f->output_data.ns->parent_desc = XFASTINT (parent);
f->output_data.ns->parent_desc = XFIXNAT (parent);
f->output_data.ns->explicit_parent = 1;
}
else
@ -1170,7 +1170,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
/* use for default font name */
id font = [NSFont userFixedPitchFontOfSize: -1.0]; /* default */
x_default_parameter (f, parms, Qfontsize,
make_number (0 /* (int)[font pointSize] */),
make_fixnum (0 /* (int)[font pointSize] */),
"fontSize", "FontSize", RES_TYPE_NUMBER);
// Remove ' Regular', not handled by backends.
char *fontname = xstrdup ([[font displayName] UTF8String]);
@ -1184,14 +1184,14 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
}
unblock_input ();
x_default_parameter (f, parms, Qborder_width, make_number (0),
x_default_parameter (f, parms, Qborder_width, make_fixnum (0),
"borderwidth", "BorderWidth", RES_TYPE_NUMBER);
x_default_parameter (f, parms, Qinternal_border_width, make_number (2),
x_default_parameter (f, parms, Qinternal_border_width, make_fixnum (2),
"internalBorderWidth", "InternalBorderWidth",
RES_TYPE_NUMBER);
x_default_parameter (f, parms, Qright_divider_width, make_number (0),
x_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
NULL, NULL, RES_TYPE_NUMBER);
x_default_parameter (f, parms, Qbottom_divider_width, make_number (0),
x_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0),
NULL, NULL, RES_TYPE_NUMBER);
/* default vertical scrollbars on right on Mac */
@ -1226,10 +1226,10 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
/* Read comment about this code in corresponding place in xfns.c. */
tem = x_get_arg (dpyinfo, parms, Qmin_width, NULL, NULL, RES_TYPE_NUMBER);
if (NUMBERP (tem))
if (FIXED_OR_FLOATP (tem))
store_frame_param (f, Qmin_width, tem);
tem = x_get_arg (dpyinfo, parms, Qmin_height, NULL, NULL, RES_TYPE_NUMBER);
if (NUMBERP (tem))
if (FIXED_OR_FLOATP (tem))
store_frame_param (f, Qmin_height, tem);
adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 5, 1,
@ -1275,11 +1275,11 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
variables; ignore them here. */
x_default_parameter (f, parms, Qmenu_bar_lines,
NILP (Vmenu_bar_mode)
? make_number (0) : make_number (1),
? make_fixnum (0) : make_fixnum (1),
NULL, NULL, RES_TYPE_NUMBER);
x_default_parameter (f, parms, Qtool_bar_lines,
NILP (Vtool_bar_mode)
? make_number (0) : make_number (1),
? make_fixnum (0) : make_fixnum (1),
NULL, NULL, RES_TYPE_NUMBER);
x_default_parameter (f, parms, Qbuffer_predicate, Qnil, "bufferPredicate",
@ -1781,7 +1781,7 @@ Frames are listed from topmost (first) to bottommost (last). */)
(Lisp_Object terminal)
{
check_ns_display_info (terminal);
return make_number (1);
return make_fixnum (1);
}
@ -1791,7 +1791,7 @@ Frames are listed from topmost (first) to bottommost (last). */)
{
struct ns_display_info *dpyinfo = check_ns_display_info (terminal);
return make_number (x_display_pixel_height (dpyinfo) / (92.0/25.4));
return make_fixnum (x_display_pixel_height (dpyinfo) / (92.0/25.4));
}
@ -1801,7 +1801,7 @@ Frames are listed from topmost (first) to bottommost (last). */)
{
struct ns_display_info *dpyinfo = check_ns_display_info (terminal);
return make_number (x_display_pixel_width (dpyinfo) / (92.0/25.4));
return make_fixnum (x_display_pixel_width (dpyinfo) / (92.0/25.4));
}
@ -2135,7 +2135,7 @@ Frames are listed from topmost (first) to bottommost (last). */)
// coerce the result to the appropriate ObjC type
desc = [returnDescriptor coerceToDescriptorType: typeUTF8Text];
if (desc)
*result = make_number([desc int32Value]);
*result = make_fixnum([desc int32Value]);
}
}
}
@ -2362,7 +2362,7 @@ Frames are listed from topmost (first) to bottommost (last). */)
{
struct ns_display_info *dpyinfo = check_ns_display_info (terminal);
return make_number (x_display_pixel_width (dpyinfo));
return make_fixnum (x_display_pixel_width (dpyinfo));
}
@ -2373,7 +2373,7 @@ Frames are listed from topmost (first) to bottommost (last). */)
{
struct ns_display_info *dpyinfo = check_ns_display_info (terminal);
return make_number (x_display_pixel_height (dpyinfo));
return make_fixnum (x_display_pixel_height (dpyinfo));
}
#ifdef NS_IMPL_COCOA
@ -2476,7 +2476,7 @@ Frames are listed from topmost (first) to bottommost (last). */)
int primary_monitor,
const char *source)
{
Lisp_Object monitor_frames = Fmake_vector (make_number (n_monitors), Qnil);
Lisp_Object monitor_frames = Fmake_vector (make_fixnum (n_monitors), Qnil);
Lisp_Object frame, rest;
NSArray *screens = [NSScreen screens];
int i;
@ -2617,7 +2617,7 @@ Frames are listed from topmost (first) to bottommost (last). */)
(Lisp_Object terminal)
{
check_ns_display_info (terminal);
return make_number
return make_fixnum
(NSBitsPerPixelFromDepth ([[[NSScreen screens] objectAtIndex:0] depth]));
}
@ -2629,7 +2629,7 @@ Frames are listed from topmost (first) to bottommost (last). */)
{
struct ns_display_info *dpyinfo = check_ns_display_info (terminal);
/* We force 24+ bit depths to 24-bit to prevent an overflow. */
return make_number (1 << min (dpyinfo->n_planes, 24));
return make_fixnum (1 << min (dpyinfo->n_planes, 24));
}
/* TODO: move to xdisp or similar */
@ -2653,15 +2653,15 @@ Frames are listed from topmost (first) to bottommost (last). */)
right = Fcdr (Fassq (Qright, parms));
bottom = Fcdr (Fassq (Qbottom, parms));
if ((!INTEGERP (left) && !INTEGERP (right))
|| (!INTEGERP (top) && !INTEGERP (bottom)))
if ((!FIXNUMP (left) && !FIXNUMP (right))
|| (!FIXNUMP (top) && !FIXNUMP (bottom)))
pt = [NSEvent mouseLocation];
else
{
/* Absolute coordinates. */
pt.x = INTEGERP (left) ? XINT (left) : XINT (right);
pt.x = FIXNUMP (left) ? XFIXNUM (left) : XFIXNUM (right);
pt.y = (x_display_pixel_height (FRAME_DISPLAY_INFO (f))
- (INTEGERP (top) ? XINT (top) : XINT (bottom))
- (FIXNUMP (top) ? XFIXNUM (top) : XFIXNUM (bottom))
- height);
}
@ -2681,30 +2681,30 @@ Frames are listed from topmost (first) to bottommost (last). */)
versions of macOS and in GNUstep. */
/* Ensure in bounds. (Note, screen origin = lower left.) */
if (INTEGERP (left) || INTEGERP (right))
if (FIXNUMP (left) || FIXNUMP (right))
*root_x = pt.x;
else if (pt.x + XINT (dx) <= screen.frame.origin.x)
else if (pt.x + XFIXNUM (dx) <= screen.frame.origin.x)
*root_x = screen.frame.origin.x;
else if (pt.x + XINT (dx) + width
else if (pt.x + XFIXNUM (dx) + width
<= screen.frame.origin.x + screen.frame.size.width)
/* It fits to the right of the pointer. */
*root_x = pt.x + XINT (dx);
else if (width + XINT (dx) <= pt.x)
*root_x = pt.x + XFIXNUM (dx);
else if (width + XFIXNUM (dx) <= pt.x)
/* It fits to the left of the pointer. */
*root_x = pt.x - width - XINT (dx);
*root_x = pt.x - width - XFIXNUM (dx);
else
/* Put it left justified on the screen -- it ought to fit that way. */
*root_x = screen.frame.origin.x;
if (INTEGERP (top) || INTEGERP (bottom))
if (FIXNUMP (top) || FIXNUMP (bottom))
*root_y = pt.y;
else if (pt.y - XINT (dy) - height >= screen.frame.origin.y)
else if (pt.y - XFIXNUM (dy) - height >= screen.frame.origin.y)
/* It fits below the pointer. */
*root_y = pt.y - height - XINT (dy);
else if (pt.y + XINT (dy) + height
*root_y = pt.y - height - XFIXNUM (dy);
else if (pt.y + XFIXNUM (dy) + height
<= screen.frame.origin.y + screen.frame.size.height)
/* It fits above the pointer. */
*root_y = pt.y + XINT (dy);
*root_y = pt.y + XFIXNUM (dy);
else
/* Put it on the top. */
*root_y = screen.frame.origin.y + screen.frame.size.height - height;
@ -2729,19 +2729,19 @@ Frames are listed from topmost (first) to bottommost (last). */)
str = SSDATA (string);
f = decode_window_system_frame (frame);
if (NILP (timeout))
timeout = make_number (5);
timeout = make_fixnum (5);
else
CHECK_NATNUM (timeout);
CHECK_FIXNAT (timeout);
if (NILP (dx))
dx = make_number (5);
dx = make_fixnum (5);
else
CHECK_NUMBER (dx);
CHECK_FIXNUM (dx);
if (NILP (dy))
dy = make_number (-10);
dy = make_fixnum (-10);
else
CHECK_NUMBER (dy);
CHECK_FIXNUM (dy);
block_input ();
if (ns_tooltip == nil)
@ -2765,7 +2765,7 @@ Frames are listed from topmost (first) to bottommost (last). */)
compute_tip_xy (f, parms, dx, dy, (int)size.width, (int)size.height,
&root_x, &root_y);
[ns_tooltip showAtX: root_x Y: root_y for: XINT (timeout)];
[ns_tooltip showAtX: root_x Y: root_y for: XFIXNUM (timeout)];
unblock_input ();
return unbind_to (count, Qnil);
@ -2812,44 +2812,44 @@ ATTRIBUTES return the outer edges of FRAME (Qouter_edges), the inner
/* Construct list. */
if (EQ (attribute, Qouter_edges))
return list4 (make_number (f->left_pos), make_number (f->top_pos),
make_number (f->left_pos + outer_width),
make_number (f->top_pos + outer_height));
return list4 (make_fixnum (f->left_pos), make_fixnum (f->top_pos),
make_fixnum (f->left_pos + outer_width),
make_fixnum (f->top_pos + outer_height));
else if (EQ (attribute, Qnative_edges))
return list4 (make_number (native_left), make_number (native_top),
make_number (native_right), make_number (native_bottom));
return list4 (make_fixnum (native_left), make_fixnum (native_top),
make_fixnum (native_right), make_fixnum (native_bottom));
else if (EQ (attribute, Qinner_edges))
return list4 (make_number (native_left + internal_border_width),
make_number (native_top
return list4 (make_fixnum (native_left + internal_border_width),
make_fixnum (native_top
+ tool_bar_height
+ internal_border_width),
make_number (native_right - internal_border_width),
make_number (native_bottom - internal_border_width));
make_fixnum (native_right - internal_border_width),
make_fixnum (native_bottom - internal_border_width));
else
return
listn (CONSTYPE_HEAP, 10,
Fcons (Qouter_position,
Fcons (make_number (f->left_pos),
make_number (f->top_pos))),
Fcons (make_fixnum (f->left_pos),
make_fixnum (f->top_pos))),
Fcons (Qouter_size,
Fcons (make_number (outer_width),
make_number (outer_height))),
Fcons (make_fixnum (outer_width),
make_fixnum (outer_height))),
Fcons (Qexternal_border_size,
(fullscreen
? Fcons (make_number (0), make_number (0))
: Fcons (make_number (border), make_number (border)))),
? Fcons (make_fixnum (0), make_fixnum (0))
: Fcons (make_fixnum (border), make_fixnum (border)))),
Fcons (Qtitle_bar_size,
Fcons (make_number (0), make_number (title_height))),
Fcons (make_fixnum (0), make_fixnum (title_height))),
Fcons (Qmenu_bar_external, Qnil),
Fcons (Qmenu_bar_size, Fcons (make_number (0), make_number (0))),
Fcons (Qmenu_bar_size, Fcons (make_fixnum (0), make_fixnum (0))),
Fcons (Qtool_bar_external,
FRAME_EXTERNAL_TOOL_BAR (f) ? Qt : Qnil),
Fcons (Qtool_bar_position, FRAME_TOOL_BAR_POSITION (f)),
Fcons (Qtool_bar_size,
Fcons (make_number (tool_bar_width),
make_number (tool_bar_height))),
Fcons (make_fixnum (tool_bar_width),
make_fixnum (tool_bar_height))),
Fcons (Qinternal_border_width,
make_number (internal_border_width)));
make_fixnum (internal_border_width)));
}
DEFUN ("ns-frame-geometry", Fns_frame_geometry, Sns_frame_geometry, 0, 1, 0,
@ -2947,13 +2947,13 @@ value is a list of the form (LEFT, TOP, RIGHT, BOTTOM). All values are
CHECK_TYPE_RANGED_INTEGER (int, x);
CHECK_TYPE_RANGED_INTEGER (int, y);
mouse_x = screen_frame.origin.x + XINT (x);
mouse_x = screen_frame.origin.x + XFIXNUM (x);
if (screen == primary_screen)
mouse_y = screen_frame.origin.y + XINT (y);
mouse_y = screen_frame.origin.y + XFIXNUM (y);
else
mouse_y = (primary_screen_height - screen_frame.size.height
- screen_frame.origin.y) + XINT (y);
- screen_frame.origin.y) + XFIXNUM (y);
CGPoint mouse_pos = CGPointMake(mouse_x, mouse_y);
CGWarpMouseCursorPosition (mouse_pos);
@ -2976,8 +2976,8 @@ The position is returned as a cons cell (X . Y) of the
NSScreen *screen = [[view window] screen];
NSPoint pt = [NSEvent mouseLocation];
return Fcons(make_number(pt.x - screen.frame.origin.x),
make_number(screen.frame.size.height -
return Fcons(make_fixnum(pt.x - screen.frame.origin.x),
make_fixnum(screen.frame.size.height -
(pt.y - screen.frame.origin.y)));
}

View File

@ -186,24 +186,24 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
FONT_SET_STYLE (font_entity, FONT_WEIGHT_INDEX,
traits & NSFontBoldTrait ? Qbold : Qmedium);
/* FONT_SET_STYLE (font_entity, FONT_WEIGHT_INDEX,
make_number (100 + 100
make_fixnum (100 + 100
* ns_attribute_fvalue (desc, NSFontWeightTrait)));*/
FONT_SET_STYLE (font_entity, FONT_SLANT_INDEX,
traits & NSFontItalicTrait ? Qitalic : Qnormal);
/* FONT_SET_STYLE (font_entity, FONT_SLANT_INDEX,
make_number (100 + 100
make_fixnum (100 + 100
* ns_attribute_fvalue (desc, NSFontSlantTrait)));*/
FONT_SET_STYLE (font_entity, FONT_WIDTH_INDEX,
traits & NSFontCondensedTrait ? Qcondensed :
traits & NSFontExpandedTrait ? Qexpanded : Qnormal);
/* FONT_SET_STYLE (font_entity, FONT_WIDTH_INDEX,
make_number (100 + 100
make_fixnum (100 + 100
* ns_attribute_fvalue (desc, NSFontWidthTrait)));*/
ASET (font_entity, FONT_SIZE_INDEX, make_number (0));
ASET (font_entity, FONT_AVGWIDTH_INDEX, make_number (0));
ASET (font_entity, FONT_SIZE_INDEX, make_fixnum (0));
ASET (font_entity, FONT_AVGWIDTH_INDEX, make_fixnum (0));
ASET (font_entity, FONT_SPACING_INDEX,
make_number([desc symbolicTraits] & NSFontMonoSpaceTrait
make_fixnum([desc symbolicTraits] & NSFontMonoSpaceTrait
? FONT_SPACING_MONO : FONT_SPACING_PROPORTIONAL));
ASET (font_entity, FONT_EXTRA_INDEX, extra);
@ -445,8 +445,8 @@ but also for ascii (which causes unnecessary font substitution). */
{
for (; CONSP (range_list); range_list = XCDR (range_list))
{
int start = XINT (XCAR (XCAR (range_list)));
int end = XINT (XCDR (XCAR (range_list)));
int start = XFIXNUM (XCAR (XCAR (range_list)));
int end = XFIXNUM (XCDR (XCAR (range_list)));
if (NSFONT_TRACE)
debug_print (XCAR (range_list));
if (end < 0x10000)
@ -576,7 +576,7 @@ but also for ascii (which causes unnecessary font substitution). */
/* Add synthItal member if needed. */
family = [fdesc objectForKey: NSFontFamilyAttribute];
if (family != nil && !foundItal && XINT (Flength (list)) > 0)
if (family != nil && !foundItal && XFIXNUM (Flength (list)) > 0)
{
NSFontDescriptor *s1 = [NSFontDescriptor new];
NSFontDescriptor *sDesc
@ -596,7 +596,7 @@ but also for ascii (which causes unnecessary font substitution). */
if (NSFONT_TRACE)
fprintf (stderr, " Returning %"pI"d entities.\n",
XINT (Flength (list)));
XFIXNUM (Flength (list)));
return list;
}
@ -668,7 +668,7 @@ Properties to be considered are same as for list(). */
if (NSFONT_TRACE)
fprintf (stderr, "nsfont: list families returning %"pI"d entries\n",
XINT (Flength (list)));
XFIXNUM (Flength (list)));
unblock_input ();
return list;
@ -705,7 +705,7 @@ Properties to be considered are same as for list(). */
{
/* try to get it out of frame params */
Lisp_Object tem = get_frame_param (f, Qfontsize);
pixel_size = NILP (tem) ? 0 : XFASTINT (tem);
pixel_size = NILP (tem) ? 0 : XFIXNAT (tem);
}
tem = AREF (font_entity, FONT_ADSTYLE_INDEX);

View File

@ -85,10 +85,10 @@ Updated by Christian Limpach (chris@nice.ch)
eassert (valid_image_p (img->spec));
lisp_index = Fplist_get (XCDR (img->spec), QCindex);
index = INTEGERP (lisp_index) ? XFASTINT (lisp_index) : 0;
index = FIXNUMP (lisp_index) ? XFIXNAT (lisp_index) : 0;
lisp_rotation = Fplist_get (XCDR (img->spec), QCrotation);
rotation = NUMBERP (lisp_rotation) ? XFLOATINT (lisp_rotation) : 0;
rotation = FIXED_OR_FLOATP (lisp_rotation) ? XFLOATINT (lisp_rotation) : 0;
if (STRINGP (spec_file))
{
@ -113,7 +113,7 @@ Updated by Christian Limpach (chris@nice.ch)
if (![eImg setFrame: index])
{
add_to_log ("Unable to set index %d for image %s",
make_number (index), img->spec);
make_fixnum (index), img->spec);
return 0;
}
@ -495,7 +495,7 @@ - (Lisp_Object)getMetadata
floatValue];
if (frames > 1)
metadata = Fcons (Qcount, Fcons (make_number (frames), metadata));
metadata = Fcons (Qcount, Fcons (make_fixnum (frames), metadata));
if (delay > 0)
metadata = Fcons (Qdelay, Fcons (make_float (delay), metadata));
}
@ -532,19 +532,19 @@ - (void)setSizeFromSpec: (Lisp_Object) spec
double width = -1, height = -1, max_width = -1, max_height = -1;
value = Fplist_get (spec, QCscale);
if (NUMBERP (value))
if (FIXED_OR_FLOATP (value))
scale = XFLOATINT (value) ;
value = Fplist_get (spec, QCmax_width);
if (NUMBERP (value))
if (FIXED_OR_FLOATP (value))
max_width = XFLOATINT (value);
value = Fplist_get (spec, QCmax_height);
if (NUMBERP (value))
if (FIXED_OR_FLOATP (value))
max_height = XFLOATINT (value);
value = Fplist_get (spec, QCwidth);
if (NUMBERP (value))
if (FIXED_OR_FLOATP (value))
{
width = XFLOATINT (value) * scale;
/* :width overrides :max-width. */
@ -552,7 +552,7 @@ - (void)setSizeFromSpec: (Lisp_Object) spec
}
value = Fplist_get (spec, QCheight);
if (NUMBERP (value))
if (FIXED_OR_FLOATP (value))
{
height = XFLOATINT (value) * scale;
/* :height overrides :max-height. */

View File

@ -377,7 +377,7 @@
{
string = AREF (items, 4*i+1);
if (EQ (string, make_number (0))) // FIXME: Why??? --Stef
if (EQ (string, make_fixnum (0))) // FIXME: Why??? --Stef
continue;
if (NILP (string))
{

View File

@ -90,20 +90,20 @@ Updated by Christian Limpach (chris@nice.ch)
clean_local_selection_data (Lisp_Object obj)
{
if (CONSP (obj)
&& INTEGERP (XCAR (obj))
&& FIXNUMP (XCAR (obj))
&& CONSP (XCDR (obj))
&& INTEGERP (XCAR (XCDR (obj)))
&& FIXNUMP (XCAR (XCDR (obj)))
&& NILP (XCDR (XCDR (obj))))
obj = Fcons (XCAR (obj), XCDR (obj));
if (CONSP (obj)
&& INTEGERP (XCAR (obj))
&& INTEGERP (XCDR (obj)))
&& FIXNUMP (XCAR (obj))
&& FIXNUMP (XCDR (obj)))
{
if (XINT (XCAR (obj)) == 0)
if (XFIXNUM (XCAR (obj)) == 0)
return XCDR (obj);
if (XINT (XCAR (obj)) == -1)
return make_number (- XINT (XCDR (obj)));
if (XFIXNUM (XCAR (obj)) == -1)
return make_fixnum (- XFIXNUM (XCDR (obj)));
}
if (VECTORP (obj))

View File

@ -1913,11 +1913,11 @@ breaks live resize (resizing with a mouse), so don't do it if
frame_size_history_add
(f, Qx_set_window_size_1, width, height,
list5 (Fcons (make_number (pixelwidth), make_number (pixelheight)),
Fcons (make_number (wr.size.width), make_number (wr.size.height)),
make_number (f->border_width),
make_number (FRAME_NS_TITLEBAR_HEIGHT (f)),
make_number (FRAME_TOOLBAR_HEIGHT (f))));
list5 (Fcons (make_fixnum (pixelwidth), make_fixnum (pixelheight)),
Fcons (make_fixnum (wr.size.width), make_fixnum (wr.size.height)),
make_fixnum (f->border_width),
make_fixnum (FRAME_NS_TITLEBAR_HEIGHT (f)),
make_fixnum (FRAME_TOOLBAR_HEIGHT (f))));
[window setFrame: wr display: YES];
@ -2480,8 +2480,8 @@ so some key presses (TAB) are swallowed by the system. */
if (FLOATP (Vframe_alpha_lower_limit))
alpha_min = XFLOAT_DATA (Vframe_alpha_lower_limit);
else if (INTEGERP (Vframe_alpha_lower_limit))
alpha_min = (XINT (Vframe_alpha_lower_limit)) / 100.0;
else if (FIXNUMP (Vframe_alpha_lower_limit))
alpha_min = (XFIXNUM (Vframe_alpha_lower_limit)) / 100.0;
if (alpha < 0.0)
return;
@ -3520,8 +3520,8 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
BOOL underline_at_descent_line, use_underline_position_properties;
Lisp_Object val = buffer_local_value (Qunderline_minimum_offset,
s->w->contents);
if (INTEGERP (val))
minimum_offset = XFASTINT (val);
if (FIXNUMP (val))
minimum_offset = XFIXNAT (val);
else
minimum_offset = 1;
val = buffer_local_value (Qx_underline_at_descent_line,
@ -5342,7 +5342,7 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
{
color = XCAR (color_map);
name = SSDATA (XCAR (color));
c = XINT (XCDR (color));
c = XFIXNUM (XCDR (color));
[cl setColor:
[NSColor colorForEmacsRed: RED_FROM_ULONG (c) / 255.0
green: GREEN_FROM_ULONG (c) / 255.0
@ -6155,7 +6155,7 @@ - (void)changeFont: (id)sender
emacs_event->code = KEY_NS_CHANGE_FONT;
size = [newFont pointSize];
ns_input_fontsize = make_number (lrint (size));
ns_input_fontsize = make_fixnum (lrint (size));
ns_input_font = build_string ([[newFont familyName] UTF8String]);
EV_TRAILER (e);
}
@ -6234,7 +6234,7 @@ most recently updated (I guess), which is not the correct one. */
[NSCursor setHiddenUntilMouseMoves: YES];
if (hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight))
if (hlinfo->mouse_face_hidden && FIXNUMP (Vmouse_highlight))
{
clear_mouse_face (hlinfo);
hlinfo->mouse_face_hidden = 1;
@ -6684,8 +6684,8 @@ - (void)mouseDown: (NSEvent *)theEvent
static int totalDeltaX, totalDeltaY;
int lineHeight;
if (NUMBERP (ns_mwheel_line_height))
lineHeight = XINT (ns_mwheel_line_height);
if (FIXED_OR_FLOATP (ns_mwheel_line_height))
lineHeight = XFIXNUM (ns_mwheel_line_height);
else
{
/* FIXME: Use actual line height instead of the default. */
@ -6754,7 +6754,7 @@ - (void)mouseDown: (NSEvent *)theEvent
return;
emacs_event->kind = horizontal ? HORIZ_WHEEL_EVENT : WHEEL_EVENT;
emacs_event->arg = (make_number (lines));
emacs_event->arg = (make_fixnum (lines));
emacs_event->code = 0;
emacs_event->modifiers = EV_MODIFIERS (theEvent) |
@ -9341,11 +9341,11 @@ Convert an X font name (XLFD) to an NS font name.
DEFSYM (Qfile, "file");
DEFSYM (Qurl, "url");
Fput (Qalt, Qmodifier_value, make_number (alt_modifier));
Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier));
Fput (Qmeta, Qmodifier_value, make_number (meta_modifier));
Fput (Qsuper, Qmodifier_value, make_number (super_modifier));
Fput (Qcontrol, Qmodifier_value, make_number (ctrl_modifier));
Fput (Qalt, Qmodifier_value, make_fixnum (alt_modifier));
Fput (Qhyper, Qmodifier_value, make_fixnum (hyper_modifier));
Fput (Qmeta, Qmodifier_value, make_fixnum (meta_modifier));
Fput (Qsuper, Qmodifier_value, make_fixnum (super_modifier));
Fput (Qcontrol, Qmodifier_value, make_fixnum (ctrl_modifier));
DEFVAR_LISP ("ns-input-file", ns_input_file,
"The file specified in the last NS event.");