]> git.eshelyaron.com Git - emacs.git/commit
Add new `swap` macro and use it
authorStefan Kangas <stefankangas@gmail.com>
Sat, 6 Jan 2024 07:22:08 +0000 (08:22 +0100)
committerStefan Kangas <stefankangas@gmail.com>
Sat, 6 Jan 2024 07:22:08 +0000 (08:22 +0100)
commit37889523278fe65733938fb11c3701898309961c
treec7a2743ff17f1ce34686f26d73c4a5b9b68082d1
parent2740a3cbfde65a899f2fcefceee9c4bc06eebc2d
Add new `swap` macro and use it

A `swap` macro prevents programming errors and is more concise.
It is a natural addition to our existing `min` and `max` macros.

* src/lisp.h (swap): New macro.
* lwlib/xlwmenu.c (draw_shadow_rectangle, draw_shadow_rhombus):
* src/androidterm.c (android_get_surrounding_text):
* src/buffer.c (Fmake_overlay, modify_overlay, Fmove_overlay):
* src/dispnew.c (swap_glyphs_in_rows, reverse_rows):
* src/editfns.c (Finsert_buffer_substring)
(Fcompare_buffer_substrings):
* src/eval.c (run_hook_wrapped_funcall):
* src/fns.c (extract_data_from_object):
* src/regex-emacs.c (forall_firstchar_1):
* src/textconv.c (textconv_query, get_extracted_text)
(get_surrounding_text):
* src/textprop.c (validate_interval_range)
(verify_interval_modification):
* src/w32uniscribe.c (OTF_INT16_VAL):
* src/xfaces.c (load_face_colors):
* src/xterm.c (SWAPCARD32): Prefer using above macro to open-coding.
14 files changed:
lwlib/xlwmenu.c
src/androidterm.c
src/buffer.c
src/dispnew.c
src/editfns.c
src/eval.c
src/fns.c
src/lisp.h
src/regex-emacs.c
src/textconv.c
src/textprop.c
src/w32uniscribe.c
src/xfaces.c
src/xterm.c