1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-30 11:09:23 +00:00

* lisp.h (list2i, list3i): New functions.

(list4i): Move from window.c and make LISP_INLINE.
* editfns.c (make_lisp_time):
* fns.c (Flocale_info):
* keyboard.c (parse_modifiers):
* xterm.c (x_ewmh_activate_frame): Use list2i.
* instel.c (signal_after_change):
* nsfns.m (Fx_server_version, Fxw_color_values):
* w32fns.c (Fxw_color_values, Fx_server_version):
* xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
* fileio.c (Fvisited_file_modtime):
* nsfns.m (Fns_display_usable_bounds):
* w32.c (ltime): Use list4i.
This commit is contained in:
Dmitry Antipov 2013-03-07 07:01:17 +04:00
parent ab89e9f9a5
commit 3de717bdb4
13 changed files with 61 additions and 58 deletions

View File

@ -1,3 +1,19 @@
2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
* lisp.h (list2i, list3i): New functions.
(list4i): Move from window.c and make LISP_INLINE.
* editfns.c (make_lisp_time):
* fns.c (Flocale_info):
* keyboard.c (parse_modifiers):
* xterm.c (x_ewmh_activate_frame): Use list2i.
* instel.c (signal_after_change):
* nsfns.m (Fx_server_version, Fxw_color_values):
* w32fns.c (Fxw_color_values, Fx_server_version):
* xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
* fileio.c (Fvisited_file_modtime):
* nsfns.m (Fns_display_usable_bounds):
* w32.c (ltime): Use list4i.
2013-03-06 Eli Zaretskii <eliz@gnu.org>
* search.c (find_newline_no_quit): Rename from find_next_newline.

View File

@ -1484,9 +1484,7 @@ Lisp_Object
make_lisp_time (EMACS_TIME t)
{
int ns = EMACS_NSECS (t);
return make_time_tail (EMACS_SECS (t),
list2 (make_number (ns / 1000),
make_number (ns % 1000 * 1000)));
return make_time_tail (EMACS_SECS (t), list2i (ns / 1000, ns % 1000 * 1000));
}
/* Decode a Lisp list SPECIFIED_TIME that represents a time.

View File

@ -5413,8 +5413,7 @@ See Info node `(elisp)Modification Time' for more details. */)
if (EMACS_NSECS (current_buffer->modtime) == NONEXISTENT_MODTIME_NSECS)
{
/* make_lisp_time won't work here if time_t is unsigned. */
return list4 (make_number (-1), make_number (65535),
make_number (0), make_number (0));
return list4i (-1, 65535, 0, 0);
}
return make_number (0);
}

View File

@ -2839,10 +2839,7 @@ The data read from the system are decoded using `locale-coding-system'. */)
but is in the locale files. This could be used by ps-print. */
#ifdef PAPER_WIDTH
else if (EQ (item, Qpaper))
{
return list2 (make_number (nl_langinfo (PAPER_WIDTH)),
make_number (nl_langinfo (PAPER_HEIGHT)));
}
return list2i (nl_langinfo (PAPER_WIDTH), nl_langinfo (PAPER_HEIGHT));
#endif /* PAPER_WIDTH */
#endif /* HAVE_LANGINFO_CODESET*/
return Qnil;

View File

@ -2013,9 +2013,8 @@ signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins)
&& current_buffer != XBUFFER (combine_after_change_buffer))
Fcombine_after_change_execute ();
elt = Fcons (make_number (charpos - BEG),
Fcons (make_number (Z - (charpos - lendel + lenins)),
Fcons (make_number (lenins - lendel), Qnil)));
elt = list3i (charpos - BEG, Z - (charpos - lendel + lenins),
lenins - lendel);
combine_after_change_list
= Fcons (elt, combine_after_change_list);
combine_after_change_buffer = Fcurrent_buffer ();

View File

@ -6225,9 +6225,7 @@ parse_modifiers (Lisp_Object symbol)
Lisp_Object elements;
if (INTEGERP (symbol))
return (Fcons (make_number (KEY_TO_CHAR (symbol)),
Fcons (make_number (XINT (symbol) & CHAR_MODIFIER_MASK),
Qnil)));
return list2i (KEY_TO_CHAR (symbol), XINT (symbol) & CHAR_MODIFIER_MASK);
else if (!SYMBOLP (symbol))
return Qnil;

View File

@ -3001,6 +3001,28 @@ extern Lisp_Object list5 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object,
Lisp_Object);
enum constype {CONSTYPE_HEAP, CONSTYPE_PURE};
extern Lisp_Object listn (enum constype, ptrdiff_t, Lisp_Object, ...);
/* Build a frequently used 2/3/4-integer lists. */
LISP_INLINE Lisp_Object
list2i (EMACS_INT x, EMACS_INT y)
{
return list2 (make_number (x), make_number (y));
}
LISP_INLINE Lisp_Object
list3i (EMACS_INT x, EMACS_INT y, EMACS_INT w)
{
return list3 (make_number (x), make_number (y), make_number (w));
}
LISP_INLINE Lisp_Object
list4i (EMACS_INT x, EMACS_INT y, EMACS_INT w, EMACS_INT h)
{
return list4 (make_number (x), make_number (y),
make_number (w), make_number (h));
}
extern _Noreturn void string_overflow (void);
extern Lisp_Object make_string (const char *, ptrdiff_t);
extern Lisp_Object make_formatted_string (char *, const char *, ...)

View File

@ -1649,9 +1649,7 @@ DISPLAY should be either a frame or a display name (a string).
The last number is where we distinguish between the Apple
and GNUstep implementations ("distributor-specific release
number") and give int'ized versions of major.minor. */
return Fcons (make_number (10),
Fcons (make_number (3),
Fcons (make_number (ns_appkit_version_int()), Qnil)));
return list3i (10, 3, ns_appkit_version_int ());
}
@ -2296,9 +2294,8 @@ and GNUstep implementations ("distributor-specific release
[[col colorUsingColorSpaceName: NSCalibratedRGBColorSpace]
getRed: &red green: &green blue: &blue alpha: &alpha];
return list3 (make_number (lrint (red*65280)),
make_number (lrint (green*65280)),
make_number (lrint (blue*65280)));
return list3i (lrint (red * 65280), lrint (green * 65280),
lrint (blue * 65280));
}
@ -2385,11 +2382,10 @@ The return value is a list of integers (LEFT TOP WIDTH HEIGHT), which
/* NS coordinate system is upside-down.
Transform to screen-specific coordinates. */
return list4 (make_number ((int) vScreen.origin.x),
make_number ((int) [screen frame].size.height
- vScreen.size.height - vScreen.origin.y),
make_number ((int) vScreen.size.width),
make_number ((int) vScreen.size.height));
return list4i (vScreen.origin.x,
[screen frame].size.height
- vScreen.size.height - vScreen.origin.y,
vScreen.size.width, vScreen.size.height);
}

View File

@ -5580,10 +5580,8 @@ ltime (ULONGLONG time_100ns)
{
ULONGLONG time_sec = time_100ns / 10000000;
int subsec = time_100ns % 10000000;
return list4 (make_number (time_sec >> 16),
make_number (time_sec & 0xffff),
make_number (subsec / 10),
make_number (subsec % 10 * 100000));
return list4i (time_sec >> 16, time_sec & 0xffff,
subsec / 10, subsec % 10 * 100000);
}
#define U64_TO_LISP_TIME(time) ltime (time)

View File

@ -4587,12 +4587,9 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
CHECK_STRING (color);
if (w32_defined_color (f, SDATA (color), &foo, 0))
return list3 (make_number ((GetRValue (foo.pixel) << 8)
| GetRValue (foo.pixel)),
make_number ((GetGValue (foo.pixel) << 8)
| GetGValue (foo.pixel)),
make_number ((GetBValue (foo.pixel) << 8)
| GetBValue (foo.pixel)));
return list3i ((GetRValue (foo.pixel) << 8) | GetRValue (foo.pixel),
(GetGValue (foo.pixel) << 8) | GetGValue (foo.pixel),
(GetBValue (foo.pixel) << 8) | GetBValue (foo.pixel));
else
return Qnil;
}
@ -4718,9 +4715,7 @@ DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
(Lisp_Object display)
{
return Fcons (make_number (w32_major_version),
Fcons (make_number (w32_minor_version),
Fcons (make_number (w32_build_number), Qnil)));
return list3i (w32_major_version, w32_minor_version, w32_build_number);
}
DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,

View File

@ -300,15 +300,6 @@ wset_buffer (struct window *w, Lisp_Object val)
adjust_window_count (w, 1);
}
/* Build a frequently used 4-integer (X Y W H) list. */
static Lisp_Object
list4i (EMACS_INT x, EMACS_INT y, EMACS_INT w, EMACS_INT h)
{
return list4 (make_number (x), make_number (y),
make_number (w), make_number (h));
}
DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0,
doc: /* Return t if OBJECT is a window and nil otherwise. */)
(Lisp_Object object)

View File

@ -3539,9 +3539,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
CHECK_STRING (color);
if (x_defined_color (f, SSDATA (color), &foo, 0))
return list3 (make_number (foo.red),
make_number (foo.green),
make_number (foo.blue));
return list3i (foo.red, foo.green, foo.blue);
else
return Qnil;
}
@ -3703,9 +3701,8 @@ If omitted or nil, that stands for the selected frame's display. */)
struct x_display_info *dpyinfo = check_x_display_info (terminal);
Display *dpy = dpyinfo->display;
return Fcons (make_number (ProtocolVersion (dpy)),
Fcons (make_number (ProtocolRevision (dpy)),
Fcons (make_number (VendorRelease (dpy)), Qnil)));
return list3i (ProtocolVersion (dpy), ProtocolRevision (dpy),
VendorRelease (dpy));
}
DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,

View File

@ -8951,10 +8951,7 @@ x_ewmh_activate_frame (FRAME_PTR f)
XSETFRAME (frame, f);
x_send_client_event (frame, make_number (0), frame,
dpyinfo->Xatom_net_active_window,
make_number (32),
Fcons (make_number (1),
Fcons (make_number (last_user_time),
Qnil)));
make_number (32), list2i (1, last_user_time));
}
}