From 946d70a8910a827d74a384ff6421b9e952e0df2e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Thu, 16 Jun 2022 14:11:03 +0200 Subject: [PATCH] Use BASE_EQ instead of EQ where obviously safe * src/alloc.c (deadp): * src/buffer.c (reset_buffer_local_variables, candidate_buffer) (Fkill_buffer, Fbuffer_swap_text, Fmake_overlay, Fmove_overlay): * src/callint.c (Fcall_interactively): * src/coding.c (decode_coding_object, encode_coding_object) (code_convert_region, Ffind_operation_coding_system): * src/comp.c (Fcomp_el_to_eln_rel_filename): * src/conf_post.h (RE_TRANSLATE_P): * src/data.c (Fkill_local_variable, Fash, expt_integer): * src/dired.c (file_name_completion): * src/dispnew.c (set_window_cursor_after_update, update_frame_1) (Fframe_or_buffer_changed_p): * src/doc.c (Fdocumentation, Fdocumentation_property) (default_to_grave_quoting_style): * src/editfns.c (Fconstrain_to_field, save_excursion_save) (save_excursion_restore, Fngettext): * src/eval.c (Fautoload, un_autoload, specbind): * src/fileio.c (Fmake_temp_file_internal): * src/fns.c (string_char_to_byte, string_byte_to_char) (Fnthcdr, Fnreverse): * src/indent.c (vmotion): * src/inotify.c (add_watch): * src/keyboard.c (command_loop_1, read_char) (read_char_minibuf_menu_prompt): * src/lread.c (oblookup): * src/macfont.m (macfont_descriptor_entity, macfont_open): * src/minibuf.c (Finnermost_minibuffer_p, Ftry_completion) (Ftest_completion): * src/nsfns.m (ns_set_icon_name): * src/pdumper.c (dump_queue_dequeue): * src/pgtkfns.c (pgtk_set_icon_type, pgtk_set_icon_name): * src/process.c (Faccept_process_output): * src/textprop.c (set_text_properties): * src/w32fns.c (w32_set_icon_type, w32_set_icon_name): * src/w32select.c (validate_coding_system): * src/window.c (decode_next_window_args, window_loop) (save_window_save): * src/xdisp.c (wset_redisplay): * src/xfaces.c (Fx_family_fonts, resolve_face_name) (gui_supports_face_attributes_p): * src/xfns.c (x_set_icon_type, x_set_icon_name): * src/xselect.c (clean_local_selection_data): Use BASE_EQ instead of EQ where it is obvious that neither argument can be a symbol with properties or at least one argument is a non-symbol. --- src/alloc.c | 2 +- src/buffer.c | 33 +++++++++++++++++---------------- src/callint.c | 4 ++-- src/coding.c | 12 ++++++------ src/comp.c | 2 +- src/conf_post.h | 2 +- src/data.c | 12 ++++++------ src/dired.c | 35 ++++++++++++++++++++--------------- src/dispnew.c | 14 +++++++------- src/doc.c | 6 +++--- src/editfns.c | 8 ++++---- src/eval.c | 6 +++--- src/fileio.c | 2 +- src/fns.c | 8 ++++---- src/indent.c | 2 +- src/inotify.c | 2 +- src/keyboard.c | 10 +++++----- src/lread.c | 2 +- src/macfont.m | 4 ++-- src/minibuf.c | 27 ++++++++++++++------------- src/nsfns.m | 2 +- src/pdumper.c | 4 ++-- src/pgtkfns.c | 4 ++-- src/process.c | 2 +- src/textprop.c | 4 ++-- src/w32fns.c | 4 ++-- src/w32select.c | 2 +- src/window.c | 6 +++--- src/xdisp.c | 2 +- src/xfaces.c | 12 +++++++----- src/xfns.c | 4 ++-- src/xselect.c | 4 ++-- 32 files changed, 126 insertions(+), 117 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 02d3a3ea3a2..55e18ecd77e 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -475,7 +475,7 @@ enum mem_type static bool deadp (Lisp_Object x) { - return EQ (x, dead_object ()); + return BASE_EQ (x, dead_object ()); } #ifdef GC_MALLOC_CHECK diff --git a/src/buffer.c b/src/buffer.c index a0761f5b59a..7adcd22d88b 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1065,7 +1065,7 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too) eassert (XSYMBOL (sym)->u.s.redirect == SYMBOL_LOCALIZED); /* Need not do anything if some other buffer's binding is now cached. */ - if (EQ (SYMBOL_BLV (XSYMBOL (sym))->where, buffer)) + if (BASE_EQ (SYMBOL_BLV (XSYMBOL (sym))->where, buffer)) { /* Symbol is set up for this buffer's old local value: swap it out! */ @@ -1607,7 +1607,7 @@ This does not change the name of the visited file (if any). */) static bool candidate_buffer (Lisp_Object b, Lisp_Object buffer) { - return (BUFFERP (b) && !EQ (b, buffer) + return (BUFFERP (b) && !BASE_EQ (b, buffer) && BUFFER_LIVE_P (XBUFFER (b)) && !BUFFER_HIDDEN_P (XBUFFER (b))); } @@ -1851,7 +1851,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) since anything can happen within do_yes_or_no_p. */ /* Don't kill the minibuffer now current. */ - if (EQ (buffer, XWINDOW (minibuf_window)->contents)) + if (BASE_EQ (buffer, XWINDOW (minibuf_window)->contents)) return Qnil; /* When we kill an ordinary buffer which shares its buffer text @@ -1895,7 +1895,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) is the sole other buffer give up. */ XSETBUFFER (tem, current_buffer); if (EQ (tem, XWINDOW (minibuf_window)->contents) - && EQ (buffer, Fother_buffer (buffer, Qnil, Qnil))) + && BASE_EQ (buffer, Fother_buffer (buffer, Qnil, Qnil))) return Qnil; /* Now there is no question: we can kill the buffer. */ @@ -2501,23 +2501,23 @@ results, see Info node `(elisp)Swapping Text'. */) { ws = Fcons (w, ws); if (MARKERP (XWINDOW (w)->pointm) - && (EQ (XWINDOW (w)->contents, buf1) - || EQ (XWINDOW (w)->contents, buf2))) + && (BASE_EQ (XWINDOW (w)->contents, buf1) + || BASE_EQ (XWINDOW (w)->contents, buf2))) Fset_marker (XWINDOW (w)->pointm, make_fixnum (BUF_BEGV (XBUFFER (XWINDOW (w)->contents))), XWINDOW (w)->contents); /* Blindly copied from pointm part. */ if (MARKERP (XWINDOW (w)->old_pointm) - && (EQ (XWINDOW (w)->contents, buf1) - || EQ (XWINDOW (w)->contents, buf2))) + && (BASE_EQ (XWINDOW (w)->contents, buf1) + || BASE_EQ (XWINDOW (w)->contents, buf2))) Fset_marker (XWINDOW (w)->old_pointm, make_fixnum (BUF_BEGV (XBUFFER (XWINDOW (w)->contents))), XWINDOW (w)->contents); if (MARKERP (XWINDOW (w)->start) - && (EQ (XWINDOW (w)->contents, buf1) - || EQ (XWINDOW (w)->contents, buf2))) + && (BASE_EQ (XWINDOW (w)->contents, buf1) + || BASE_EQ (XWINDOW (w)->contents, buf2))) Fset_marker (XWINDOW (w)->start, make_fixnum (XBUFFER (XWINDOW (w)->contents)->last_window_start), @@ -2527,10 +2527,11 @@ results, see Info node `(elisp)Swapping Text'. */) } if (current_buffer->text->intervals) - (eassert (EQ (current_buffer->text->intervals->up.obj, buffer)), + (eassert (BASE_EQ (current_buffer->text->intervals->up.obj, buffer)), XSETBUFFER (current_buffer->text->intervals->up.obj, current_buffer)); if (other_buffer->text->intervals) - (eassert (EQ (other_buffer->text->intervals->up.obj, Fcurrent_buffer ())), + (eassert (BASE_EQ (other_buffer->text->intervals->up.obj, + Fcurrent_buffer ())), XSETBUFFER (other_buffer->text->intervals->up.obj, other_buffer)); return Qnil; @@ -3940,9 +3941,9 @@ for the rear of the overlay advance when text is inserted there else CHECK_BUFFER (buffer); - if (MARKERP (beg) && !EQ (Fmarker_buffer (beg), buffer)) + if (MARKERP (beg) && !BASE_EQ (Fmarker_buffer (beg), buffer)) signal_error ("Marker points into wrong buffer", beg); - if (MARKERP (end) && !EQ (Fmarker_buffer (end), buffer)) + if (MARKERP (end) && !BASE_EQ (Fmarker_buffer (end), buffer)) signal_error ("Marker points into wrong buffer", end); CHECK_FIXNUM_COERCE_MARKER (beg); @@ -4060,9 +4061,9 @@ buffer. */) if (NILP (Fbuffer_live_p (buffer))) error ("Attempt to move overlay to a dead buffer"); - if (MARKERP (beg) && !EQ (Fmarker_buffer (beg), buffer)) + if (MARKERP (beg) && !BASE_EQ (Fmarker_buffer (beg), buffer)) signal_error ("Marker points into wrong buffer", beg); - if (MARKERP (end) && !EQ (Fmarker_buffer (end), buffer)) + if (MARKERP (end) && !BASE_EQ (Fmarker_buffer (end), buffer)) signal_error ("Marker points into wrong buffer", end); CHECK_FIXNUM_COERCE_MARKER (beg); diff --git a/src/callint.c b/src/callint.c index 8283c61da67..ffa3b231eb5 100644 --- a/src/callint.c +++ b/src/callint.c @@ -439,7 +439,7 @@ invoke it (via an `interactive' spec that contains, for instance, an && (w = XCAR (w), WINDOWP (w))) { if (MINI_WINDOW_P (XWINDOW (w)) - && ! (minibuf_level > 0 && EQ (w, minibuf_window))) + && ! (minibuf_level > 0 && BASE_EQ (w, minibuf_window))) error ("Attempt to select inactive minibuffer window"); /* If the current buffer wants to clean up, let it. */ @@ -509,7 +509,7 @@ invoke it (via an `interactive' spec that contains, for instance, an case 'b': /* Name of existing buffer. */ args[i] = Fcurrent_buffer (); - if (EQ (selected_window, minibuf_window)) + if (BASE_EQ (selected_window, minibuf_window)) args[i] = Fother_buffer (args[i], Qnil, Qnil); args[i] = Fread_buffer (callint_message, args[i], Qt, Qnil); break; diff --git a/src/coding.c b/src/coding.c index aa32efc3f61..68f3201de80 100644 --- a/src/coding.c +++ b/src/coding.c @@ -8194,7 +8194,7 @@ decode_coding_object (struct coding_system *coding, if (saved_pt >= 0) { /* This is the case of: - (BUFFERP (src_object) && EQ (src_object, dst_object)) + (BUFFERP (src_object) && BASE_EQ (src_object, dst_object)) As we have moved PT while replacing the original buffer contents, we must recover it now. */ set_buffer_internal (XBUFFER (src_object)); @@ -8298,7 +8298,7 @@ encode_coding_object (struct coding_system *coding, attrs = CODING_ID_ATTRS (coding->id); bool same_buffer = false; - if (EQ (src_object, dst_object) && BUFFERP (src_object)) + if (BASE_EQ (src_object, dst_object) && BUFFERP (src_object)) { struct Lisp_Marker *tail; @@ -8379,7 +8379,7 @@ encode_coding_object (struct coding_system *coding, if (BUFFERP (dst_object)) { coding->dst_object = dst_object; - if (EQ (src_object, dst_object)) + if (BASE_EQ (src_object, dst_object)) { coding->dst_pos = from; coding->dst_pos_byte = from_byte; @@ -8434,7 +8434,7 @@ encode_coding_object (struct coding_system *coding, if (saved_pt >= 0) { /* This is the case of: - (BUFFERP (src_object) && EQ (src_object, dst_object)) + (BUFFERP (src_object) && BASE_EQ (src_object, dst_object)) As we have moved PT while replacing the original buffer contents, we must recover it now. */ set_buffer_internal (XBUFFER (src_object)); @@ -9416,7 +9416,7 @@ code_convert_region (Lisp_Object start, Lisp_Object end, setup_coding_system (coding_system, &coding); coding.mode |= CODING_MODE_LAST_BLOCK; - if (BUFFERP (dst_object) && !EQ (dst_object, src_object)) + if (BUFFERP (dst_object) && !BASE_EQ (dst_object, src_object)) { struct buffer *buf = XBUFFER (dst_object); ptrdiff_t buf_pt = BUF_PT (buf); @@ -10785,7 +10785,7 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS...) */) && ((STRINGP (target) && STRINGP (XCAR (elt)) && fast_string_match (XCAR (elt), target) >= 0) - || (FIXNUMP (target) && EQ (target, XCAR (elt))))) + || (FIXNUMP (target) && BASE_EQ (target, XCAR (elt))))) { val = XCDR (elt); /* Here, if VAL is both a valid coding system and a valid diff --git a/src/comp.c b/src/comp.c index c230536ac59..0c78e60fc43 100644 --- a/src/comp.c +++ b/src/comp.c @@ -4397,7 +4397,7 @@ one for the file name and another for its contents, followed by .eln. */) { Lisp_Object match_idx = Fstring_match (XCAR (lds_re_tail), filename, Qnil, Qnil); - if (EQ (match_idx, make_fixnum (0))) + if (BASE_EQ (match_idx, make_fixnum (0))) { filename = Freplace_match (build_string ("//"), Qt, Qt, filename, Qnil); diff --git a/src/conf_post.h b/src/conf_post.h index 5108e44efbd..6ecebf36ab9 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -267,7 +267,7 @@ extern void _DebPrint (const char *fmt, ...); /* Tell regex.c to use a type compatible with Emacs. */ #define RE_TRANSLATE_TYPE Lisp_Object #define RE_TRANSLATE(TBL, C) char_table_translate (TBL, C) -#define RE_TRANSLATE_P(TBL) (!EQ (TBL, make_fixnum (0))) +#define RE_TRANSLATE_P(TBL) (!BASE_EQ (TBL, make_fixnum (0))) #endif /* Tell time_rz.c to use Emacs's getter and setter for TZ. diff --git a/src/data.c b/src/data.c index cf180b16fb2..d665da04da6 100644 --- a/src/data.c +++ b/src/data.c @@ -2330,7 +2330,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) forwarded objects won't work right. */ { Lisp_Object buf; XSETBUFFER (buf, current_buffer); - if (EQ (buf, blv->where)) + if (BASE_EQ (buf, blv->where)) swap_in_global_binding (sym); } @@ -3522,7 +3522,7 @@ In this case, the sign bit is duplicated. */) if (! FIXNUMP (count)) { - if (EQ (value, make_fixnum (0))) + if (BASE_EQ (value, make_fixnum (0))) return value; if (mpz_sgn (*xbignum_val (count)) < 0) { @@ -3567,11 +3567,11 @@ Lisp_Object expt_integer (Lisp_Object x, Lisp_Object y) { /* Special cases for -1 <= x <= 1, which never overflow. */ - if (EQ (x, make_fixnum (1))) + if (BASE_EQ (x, make_fixnum (1))) return x; - if (EQ (x, make_fixnum (0))) - return EQ (x, y) ? make_fixnum (1) : x; - if (EQ (x, make_fixnum (-1))) + if (BASE_EQ (x, make_fixnum (0))) + return BASE_EQ (x, y) ? make_fixnum (1) : x; + if (BASE_EQ (x, make_fixnum (-1))) return ((FIXNUMP (y) ? XFIXNUM (y) & 1 : mpz_odd_p (*xbignum_val (y))) ? x : make_fixnum (1)); diff --git a/src/dired.c b/src/dired.c index cd50012ddc7..e31ad9121c9 100644 --- a/src/dired.c +++ b/src/dired.c @@ -521,9 +521,9 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, name = DECODE_FILE (name); ptrdiff_t name_blen = SBYTES (name), name_len = SCHARS (name); if (completion_ignore_case - && !EQ (Fcompare_strings (name, zero, file_len, file, zero, file_len, - Qt), - Qt)) + && !BASE_EQ (Fcompare_strings (name, zero, file_len, file, zero, + file_len, Qt), + Qt)) continue; switch (dirent_type (dp)) @@ -603,10 +603,12 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, skip = name_len - elt_len; cmp_len = make_fixnum (elt_len); if (skip < 0 - || !EQ (Fcompare_strings (name, make_fixnum (skip), - Qnil, - elt, zero, cmp_len, Qt), - Qt)) + || !BASE_EQ (Fcompare_strings (name, + make_fixnum (skip), + Qnil, + elt, zero, cmp_len, + Qt), + Qt)) continue; } break; @@ -637,10 +639,12 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, skip = name_len - elt_len; cmp_len = make_fixnum (elt_len); if (skip < 0 - || !EQ (Fcompare_strings (name, make_fixnum (skip), - Qnil, - elt, zero, cmp_len, Qt), - Qt)) + || !BASE_EQ (Fcompare_strings (name, + make_fixnum (skip), + Qnil, + elt, zero, cmp_len, + Qt), + Qt)) continue; } break; @@ -699,7 +703,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, = Fcompare_strings (name, zero, make_fixnum (compare), file, zero, make_fixnum (compare), completion_ignore_case ? Qt : Qnil); - if (!EQ (cmp, Qt)) + if (!BASE_EQ (cmp, Qt)) continue; } @@ -722,7 +726,8 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, = Fcompare_strings (bestmatch, zero, make_fixnum (compare), name, zero, make_fixnum (compare), completion_ignore_case ? Qt : Qnil); - ptrdiff_t matchsize = EQ (cmp, Qt) ? compare : eabs (XFIXNUM (cmp)) - 1; + ptrdiff_t matchsize = BASE_EQ (cmp, Qt) + ? compare : eabs (XFIXNUM (cmp)) - 1; if (completion_ignore_case) { @@ -751,13 +756,13 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, file, zero, Qnil, Qnil), - EQ (Qt, cmp)) + BASE_EQ (Qt, cmp)) && (cmp = Fcompare_strings (bestmatch, zero, make_fixnum (SCHARS (file)), file, zero, Qnil, Qnil), - ! EQ (Qt, cmp)))) + ! BASE_EQ (Qt, cmp)))) bestmatch = name; } bestmatchsize = matchsize; diff --git a/src/dispnew.c b/src/dispnew.c index 7a4d9f8710b..3bd2e0e96c3 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -4284,11 +4284,11 @@ set_window_cursor_after_update (struct window *w) /* If we are showing a message instead of the mini-buffer, show the cursor for the message instead. */ && XWINDOW (minibuf_window) == w - && EQ (minibuf_window, echo_area_window) + && BASE_EQ (minibuf_window, echo_area_window) /* These cases apply only to the frame that contains the active mini-buffer window. */ && FRAME_HAS_MINIBUF_P (f) - && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)) + && BASE_EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)) { cx = cy = vpos = hpos = 0; @@ -4948,13 +4948,13 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p, /* If we are showing a message instead of the mini-buffer, show the cursor for the message instead of for the (now hidden) mini-buffer contents. */ - || (EQ (minibuf_window, selected_window) - && EQ (minibuf_window, echo_area_window) + || (BASE_EQ (minibuf_window, selected_window) + && BASE_EQ (minibuf_window, echo_area_window) && !NILP (echo_area_buffer[0]))) /* These cases apply only to the frame that contains the active mini-buffer window. */ && FRAME_HAS_MINIBUF_P (f) - && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)) + && BASE_EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)) { int top = WINDOW_TOP_EDGE_LINE (XWINDOW (FRAME_MINIBUF_WINDOW (f))); int col; @@ -6306,7 +6306,7 @@ pass nil for VARIABLE. */) { if (idx == ASIZE (state)) goto changed; - if (!EQ (AREF (state, idx++), frame)) + if (!BASE_EQ (AREF (state, idx++), frame)) goto changed; if (idx == ASIZE (state)) goto changed; @@ -6321,7 +6321,7 @@ pass nil for VARIABLE. */) continue; if (idx == ASIZE (state)) goto changed; - if (!EQ (AREF (state, idx++), buf)) + if (!BASE_EQ (AREF (state, idx++), buf)) goto changed; if (idx == ASIZE (state)) goto changed; diff --git a/src/doc.c b/src/doc.c index 14db3189f34..34b80d03aa9 100644 --- a/src/doc.c +++ b/src/doc.c @@ -346,7 +346,7 @@ string is passed through `substitute-command-keys'. */) /* If DOC is 0, it's typically because of a dumped file missing from the DOC file (bug in src/Makefile.in). */ - if (EQ (doc, make_fixnum (0))) + if (BASE_EQ (doc, make_fixnum (0))) doc = Qnil; if (FIXNUMP (doc) || CONSP (doc)) { @@ -400,7 +400,7 @@ aren't strings. */) tem = Fget (indirect, prop); } - if (EQ (tem, make_fixnum (0))) + if (BASE_EQ (tem, make_fixnum (0))) tem = Qnil; /* See if we want to look for the string in the DOC file. */ @@ -637,7 +637,7 @@ default_to_grave_quoting_style (void) Lisp_Object dv = DISP_CHAR_VECTOR (XCHAR_TABLE (Vstandard_display_table), LEFT_SINGLE_QUOTATION_MARK); return (VECTORP (dv) && ASIZE (dv) == 1 - && EQ (AREF (dv, 0), make_fixnum ('`'))); + && BASE_EQ (AREF (dv, 0), make_fixnum ('`'))); } DEFUN ("text-quoting-style", Ftext_quoting_style, diff --git a/src/editfns.c b/src/editfns.c index 17f0252969e..84947af5086 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -648,7 +648,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) prev_new = make_fixnum (XFIXNUM (new_pos) - 1); if (NILP (Vinhibit_field_text_motion) - && !EQ (new_pos, old_pos) + && !BASE_EQ (new_pos, old_pos) && (!NILP (Fget_char_property (new_pos, Qfield, Qnil)) || !NILP (Fget_char_property (old_pos, Qfield, Qnil)) /* To recognize field boundaries, we must also look at the @@ -797,7 +797,7 @@ save_excursion_save (union specbinding *pdl) pdl->unwind_excursion.marker = Fpoint_marker (); /* Selected window if current buffer is shown in it, nil otherwise. */ pdl->unwind_excursion.window - = (EQ (XWINDOW (selected_window)->contents, Fcurrent_buffer ()) + = (BASE_EQ (XWINDOW (selected_window)->contents, Fcurrent_buffer ()) ? selected_window : Qnil); } @@ -821,7 +821,7 @@ save_excursion_restore (Lisp_Object marker, Lisp_Object window) /* If buffer was visible in a window, and a different window was selected, and the old selected window is still showing this buffer, restore point in that window. */ - if (WINDOWP (window) && !EQ (window, selected_window)) + if (WINDOWP (window) && !BASE_EQ (window, selected_window)) { /* Set window point if WINDOW is live and shows the current buffer. */ Lisp_Object contents = XWINDOW (window)->contents; @@ -2843,7 +2843,7 @@ otherwise MSGID-PLURAL. */) CHECK_INTEGER (n); /* Placeholder implementation until we get our act together. */ - return EQ (n, make_fixnum (1)) ? msgid : msgid_plural; + return BASE_EQ (n, make_fixnum (1)) ? msgid : msgid_plural; } DEFUN ("message", Fmessage, Smessage, 1, MANY, 0, diff --git a/src/eval.c b/src/eval.c index 1c62b9248eb..346dff8bdcc 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2195,7 +2195,7 @@ this does nothing and returns nil. */) && !AUTOLOADP (XSYMBOL (function)->u.s.function)) return Qnil; - if (!NILP (Vpurify_flag) && EQ (docstring, make_fixnum (0))) + if (!NILP (Vpurify_flag) && BASE_EQ (docstring, make_fixnum (0))) /* `read1' in lread.c has found the docstring starting with "\ and assumed the docstring will be provided by Snarf-documentation, so it passed us 0 instead. But that leads to accidental sharing in purecopy's @@ -2216,7 +2216,7 @@ un_autoload (Lisp_Object oldqueue) while (CONSP (queue)) { Lisp_Object first = XCAR (queue); - if (CONSP (first) && EQ (XCAR (first), make_fixnum (0))) + if (CONSP (first) && BASE_EQ (XCAR (first), make_fixnum (0))) Vfeatures = XCDR (first); else Ffset (first, Fcar (Fcdr (Fget (first, Qfunction_history)))); @@ -3451,7 +3451,7 @@ specbind (Lisp_Object symbol, Lisp_Object value) specpdl_ptr->let.where = Fcurrent_buffer (); eassert (sym->u.s.redirect != SYMBOL_LOCALIZED - || (EQ (SYMBOL_BLV (sym)->where, Fcurrent_buffer ()))); + || (BASE_EQ (SYMBOL_BLV (sym)->where, Fcurrent_buffer ()))); if (sym->u.s.redirect == SYMBOL_LOCALIZED) { diff --git a/src/fileio.c b/src/fileio.c index 39b731bb0b8..10d4b8bc15e 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -708,7 +708,7 @@ This function does not grok magic file names. */) memset (data + prefix_len, 'X', nX); memcpy (data + prefix_len + nX, SSDATA (encoded_suffix), suffix_len); int kind = (NILP (dir_flag) ? GT_FILE - : EQ (dir_flag, make_fixnum (0)) ? GT_NOCREATE + : BASE_EQ (dir_flag, make_fixnum (0)) ? GT_NOCREATE : GT_DIR); int fd = gen_tempname (data, suffix_len, O_BINARY | O_CLOEXEC, kind); bool failed = fd < 0; diff --git a/src/fns.c b/src/fns.c index 6094c00b27c..97af39c4161 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1045,7 +1045,7 @@ string_char_to_byte (Lisp_Object string, ptrdiff_t char_index) if (best_above == best_above_byte) return char_index; - if (EQ (string, string_char_byte_cache_string)) + if (BASE_EQ (string, string_char_byte_cache_string)) { if (string_char_byte_cache_charpos < char_index) { @@ -1105,7 +1105,7 @@ string_byte_to_char (Lisp_Object string, ptrdiff_t byte_index) if (best_above == best_above_byte) return byte_index; - if (EQ (string, string_char_byte_cache_string)) + if (BASE_EQ (string, string_char_byte_cache_string)) { if (string_char_byte_cache_bytepos < byte_index) { @@ -1576,7 +1576,7 @@ DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0, { /* If the tortoise just jumped (which is rare), update TORTOISE_NUM accordingly. */ - if (EQ (tail, li.tortoise)) + if (BASE_EQ (tail, li.tortoise)) tortoise_num = num; saved_tail = XCDR (tail); @@ -2014,7 +2014,7 @@ This function may destructively modify SEQ to produce the value. */) next = XCDR (tail); /* If SEQ contains a cycle, attempting to reverse it in-place will inevitably come back to SEQ. */ - if (EQ (next, seq)) + if (BASE_EQ (next, seq)) circular_list (seq); Fsetcdr (tail, prev); prev = tail; diff --git a/src/indent.c b/src/indent.c index 51f6f414de3..c071b43ab4c 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1861,7 +1861,7 @@ vmotion (ptrdiff_t from, ptrdiff_t from_byte, /* If the window contains this buffer, use it for getting text properties. Otherwise use the current buffer as arg for doing that. */ - if (EQ (w->contents, Fcurrent_buffer ())) + if (BASE_EQ (w->contents, Fcurrent_buffer ())) text_prop_object = window; else text_prop_object = Fcurrent_buffer (); diff --git a/src/inotify.c b/src/inotify.c index e92ad40abcc..16d20e7e925 100644 --- a/src/inotify.c +++ b/src/inotify.c @@ -217,7 +217,7 @@ add_watch (int wd, Lisp_Object filename, /* Assign a watch ID that is not already in use, by looking for a gap in the existing sorted list. */ for (; ! NILP (XCDR (tail)); tail = XCDR (tail), id++) - if (!EQ (XCAR (XCAR (XCDR (tail))), make_fixnum (id))) + if (!BASE_EQ (XCAR (XCAR (XCDR (tail))), make_fixnum (id))) break; if (MOST_POSITIVE_FIXNUM < id) emacs_abort (); diff --git a/src/keyboard.c b/src/keyboard.c index 55d710ed627..60ff8f5ea6a 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1345,7 +1345,7 @@ command_loop_1 (void) if (minibuf_level && !NILP (echo_area_buffer[0]) - && EQ (minibuf_window, echo_area_window) + && BASE_EQ (minibuf_window, echo_area_window) && NUMBERP (Vminibuffer_message_timeout)) { /* Bind inhibit-quit to t so that C-g gets read in @@ -2576,7 +2576,7 @@ read_char (int commandflag, Lisp_Object map, && (input_was_pending || !redisplay_dont_pause))) { input_was_pending = input_pending; - if (help_echo_showing_p && !EQ (selected_window, minibuf_window)) + if (help_echo_showing_p && !BASE_EQ (selected_window, minibuf_window)) redisplay_preserve_echo_area (5); else redisplay (); @@ -2924,7 +2924,7 @@ read_char (int commandflag, Lisp_Object map, goto exit; } - if (EQ (c, make_fixnum (-2))) + if (BASE_EQ (c, make_fixnum (-2))) return c; if (CONSP (c) && EQ (XCAR (c), Qt)) @@ -3249,7 +3249,7 @@ read_char (int commandflag, Lisp_Object map, unbind_to (count, Qnil); redisplay (); - if (EQ (c, make_fixnum (040))) + if (BASE_EQ (c, make_fixnum (040))) { cancel_echoing (); do @@ -9498,7 +9498,7 @@ read_char_minibuf_menu_prompt (int commandflag, if (!FIXNUMP (obj) || XFIXNUM (obj) == -2 || (! EQ (obj, menu_prompt_more_char) && (!FIXNUMP (menu_prompt_more_char) - || ! EQ (obj, make_fixnum (Ctl (XFIXNUM (menu_prompt_more_char))))))) + || ! BASE_EQ (obj, make_fixnum (Ctl (XFIXNUM (menu_prompt_more_char))))))) { if (!NILP (KVAR (current_kboard, defining_kbd_macro))) store_kbd_macro_char (obj); diff --git a/src/lread.c b/src/lread.c index 77831f028ee..a00590e466a 100644 --- a/src/lread.c +++ b/src/lread.c @@ -4855,7 +4855,7 @@ oblookup (Lisp_Object obarray, register const char *ptr, ptrdiff_t size, ptrdiff hash = hash_string (ptr, size_byte) % obsize; bucket = AREF (obarray, hash); oblookup_last_bucket_number = hash; - if (EQ (bucket, make_fixnum (0))) + if (BASE_EQ (bucket, make_fixnum (0))) ; else if (!SYMBOLP (bucket)) /* Like CADR error message. */ diff --git a/src/macfont.m b/src/macfont.m index 4dd55e77469..fe30908f5d6 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -929,7 +929,7 @@ macfont_descriptor_entity (CTFontDescriptorRef desc, Lisp_Object extra, cfnumber_get_font_symbolic_traits_value (num, &sym_traits); CFRelease (dict); } - if (EQ (AREF (entity, FONT_SIZE_INDEX), make_fixnum (0))) + if (BASE_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); @@ -2653,7 +2653,7 @@ macfont_open (struct frame * f, Lisp_Object entity, int pixel_size) macfont_info->cgfont = CTFontCopyGraphicsFont (macfont, NULL); val = assq_no_quit (QCdestination, AREF (entity, FONT_EXTRA_INDEX)); - if (CONSP (val) && EQ (XCDR (val), make_fixnum (1))) + if (CONSP (val) && BASE_EQ (XCDR (val), make_fixnum (1))) macfont_info->screen_font = mac_screen_font_create_with_name (font_name, size); else diff --git a/src/minibuf.c b/src/minibuf.c index 1f77a6cdc18..85d6ec44349 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -427,8 +427,8 @@ No argument or nil as argument means use the current buffer as BUFFER. */) { if (NILP (buffer)) buffer = Fcurrent_buffer (); - return EQ (buffer, (Fcar (Fnthcdr (make_fixnum (minibuf_level), - Vminibuffer_list)))) + return BASE_EQ (buffer, (Fcar (Fnthcdr (make_fixnum (minibuf_level), + Vminibuffer_list)))) ? Qt : Qnil; } @@ -1791,10 +1791,10 @@ or from one of the possible completions. */) if (bestmatchsize != SCHARS (eltstring) || bestmatchsize != matchsize || (completion_ignore_case - && !EQ (Fcompare_strings (old_bestmatch, zero, lcompare, - eltstring, zero, lcompare, - Qnil), - Qt))) + && !BASE_EQ (Fcompare_strings (old_bestmatch, zero, + lcompare, eltstring, zero, + lcompare, Qnil), + Qt))) /* Don't count the same string multiple times. */ matchcount += matchcount <= 1; bestmatchsize = matchsize; @@ -2110,10 +2110,11 @@ the values STRING, PREDICATE and `lambda'. */) if (SYMBOLP (tail)) while (1) { - if (EQ (Fcompare_strings (string, make_fixnum (0), Qnil, - Fsymbol_name (tail), - make_fixnum (0) , Qnil, Qt), - Qt)) + if (BASE_EQ (Fcompare_strings (string, make_fixnum (0), + Qnil, + Fsymbol_name (tail), + make_fixnum (0) , Qnil, Qt), + Qt)) { tem = tail; break; @@ -2144,9 +2145,9 @@ the values STRING, PREDICATE and `lambda'. */) if (BASE_EQ (tem, Qunbound)) continue; Lisp_Object strkey = (SYMBOLP (tem) ? Fsymbol_name (tem) : tem); if (!STRINGP (strkey)) continue; - if (EQ (Fcompare_strings (string, Qnil, Qnil, - strkey, Qnil, Qnil, - completion_ignore_case ? Qt : Qnil), + if (BASE_EQ (Fcompare_strings (string, Qnil, Qnil, + strkey, Qnil, Qnil, + completion_ignore_case ? Qt : Qnil), Qt)) goto found_matching_key; } diff --git a/src/nsfns.m b/src/nsfns.m index 5ab2b2ee35a..16174210669 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -382,7 +382,7 @@ ns_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) /* See if it's changed. */ if (STRINGP (arg)) { - if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) + if (STRINGP (oldval) && BASE_EQ (Fstring_equal (oldval, arg), Qt)) return; } else if (!STRINGP (oldval) && NILP (oldval) == NILP (arg)) diff --git a/src/pdumper.c b/src/pdumper.c index 50ae4f85e7e..af451920eb6 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -1210,8 +1210,8 @@ dump_queue_find_score_of_one_weight_queue (struct dump_queue *dump_queue, static Lisp_Object dump_queue_dequeue (struct dump_queue *dump_queue, dump_off basis) { - eassert (EQ (Fhash_table_count (dump_queue->sequence_numbers), - Fhash_table_count (dump_queue->link_weights))); + eassert (BASE_EQ (Fhash_table_count (dump_queue->sequence_numbers), + Fhash_table_count (dump_queue->link_weights))); eassert (XFIXNUM (Fhash_table_count (dump_queue->sequence_numbers)) <= (dump_tailq_length (&dump_queue->fancy_weight_objects) diff --git a/src/pgtkfns.c b/src/pgtkfns.c index 294bdb37917..4f15ec6ff66 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -613,7 +613,7 @@ pgtk_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) if (STRINGP (arg)) { - if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) + if (STRINGP (oldval) && BASE_EQ (Fstring_equal (oldval, arg), Qt)) return; } else if (!STRINGP (oldval) && NILP (oldval) == NILP (arg)) @@ -643,7 +643,7 @@ pgtk_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) if (STRINGP (arg)) { - if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) + if (STRINGP (oldval) && BASE_EQ (Fstring_equal (oldval, arg), Qt)) return; } else if (!NILP (arg) || NILP (oldval)) diff --git a/src/process.c b/src/process.c index ccfc0bdf547..0cbac172fe4 100644 --- a/src/process.c +++ b/src/process.c @@ -4775,7 +4775,7 @@ corresponding connection was closed. */) /* Can't wait for a process that is dedicated to a different thread. */ - if (!NILP (proc->thread) && !EQ (proc->thread, Fcurrent_thread ())) + if (!NILP (proc->thread) && !BASE_EQ (proc->thread, Fcurrent_thread ())) { Lisp_Object proc_thread_name = XTHREAD (proc->thread)->name; diff --git a/src/textprop.c b/src/textprop.c index c11ee98f020..d69682d3ea3 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -1407,8 +1407,8 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, /* If we want no properties for a whole string, get rid of its intervals. */ if (NILP (properties) && STRINGP (object) - && EQ (start, make_fixnum (0)) - && EQ (end, make_fixnum (SCHARS (object)))) + && BASE_EQ (start, make_fixnum (0)) + && BASE_EQ (end, make_fixnum (SCHARS (object)))) { if (!string_intervals (object)) return Qnil; diff --git a/src/w32fns.c b/src/w32fns.c index 8716b762eb0..b093d3c32ee 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -1463,7 +1463,7 @@ w32_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) return; if (STRINGP (arg) && STRINGP (oldval) - && EQ (Fstring_equal (oldval, arg), Qt)) + && BASE_EQ (Fstring_equal (oldval, arg), Qt)) return; if (SYMBOLP (arg) && SYMBOLP (oldval) && EQ (arg, oldval)) @@ -1486,7 +1486,7 @@ w32_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { if (STRINGP (arg)) { - if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) + if (STRINGP (oldval) && BASE_EQ (Fstring_equal (oldval, arg), Qt)) return; } else if (!NILP (arg) || NILP (oldval)) diff --git a/src/w32select.c b/src/w32select.c index eae1a0bac02..37206118127 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -631,7 +631,7 @@ validate_coding_system (Lisp_Object coding_system) eol_type = Fcoding_system_eol_type (coding_system); /* Already a DOS coding system? */ - if (EQ (eol_type, make_fixnum (1))) + if (BASE_EQ (eol_type, make_fixnum (1))) return coding_system; /* Get EOL_TYPE vector of the base of CODING_SYSTEM. */ diff --git a/src/window.c b/src/window.c index ac8408a9a97..c94e7bde29f 100644 --- a/src/window.c +++ b/src/window.c @@ -2786,7 +2786,7 @@ decode_next_window_args (Lisp_Object *window, Lisp_Object *minibuf, Lisp_Object ? miniwin : Qnil); else if (EQ (*all_frames, Qvisible)) ; - else if (EQ (*all_frames, make_fixnum (0))) + else if (BASE_EQ (*all_frames, make_fixnum (0))) ; else if (FRAMEP (*all_frames)) ; @@ -3083,7 +3083,7 @@ window_loop (enum window_loop type, Lisp_Object obj, bool mini, if (f) frame_arg = Qlambda; - else if (EQ (frames, make_fixnum (0))) + else if (BASE_EQ (frames, make_fixnum (0))) frame_arg = frames; else if (EQ (frames, Qvisible)) frame_arg = frames; @@ -7493,7 +7493,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, ptrdiff_t i) hare = XCDR (hare); tortoise = XCDR (tortoise); - if (EQ (hare, tortoise)) + if (BASE_EQ (hare, tortoise)) /* Reset Vwindow_persistent_parameters to Qnil. */ { Vwindow_persistent_parameters = Qnil; diff --git a/src/xdisp.c b/src/xdisp.c index b02375ab2d8..90809ac3ab7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -832,7 +832,7 @@ void wset_redisplay (struct window *w) { /* Beware: selected_window can be nil during early stages. */ - if (!EQ (make_lisp_ptr (w, Lisp_Vectorlike), selected_window)) + if (!BASE_EQ (make_lisp_ptr (w, Lisp_Vectorlike), selected_window)) redisplay_other_windows (); w->redisplay = true; } diff --git a/src/xfaces.c b/src/xfaces.c index 7395ce157ec..04e5439d9d5 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1584,8 +1584,9 @@ the face font sort order, see `face-font-selection-order'. */) /* If the font was specified in a way different from XLFD (e.g., on MS-Windows), we will have a number there, not 'p'. */ - || EQ (spacing, - make_fixnum (FONT_SPACING_PROPORTIONAL))) + || BASE_EQ (spacing, + make_fixnum + (FONT_SPACING_PROPORTIONAL))) ? Qnil : Qt, Ffont_xlfd_name (font, Qnil), AREF (font, FONT_REGISTRY_INDEX)); @@ -1942,7 +1943,7 @@ resolve_face_name (Lisp_Object face_name, bool signal_p) break; tortoise = Fget (tortoise, Qface_alias); - if (EQ (hare, tortoise)) + if (BASE_EQ (hare, tortoise)) { if (signal_p) circular_list (orig_face); @@ -5176,8 +5177,9 @@ gui_supports_face_attributes_p (struct frame *f, return true; s1 = SYMBOL_NAME (face->font->props[i]); s2 = SYMBOL_NAME (def_face->font->props[i]); - if (! EQ (Fcompare_strings (s1, make_fixnum (0), Qnil, - s2, make_fixnum (0), Qnil, Qt), Qt)) + if (! BASE_EQ (Fcompare_strings (s1, make_fixnum (0), Qnil, + s2, make_fixnum (0), Qnil, Qt), + Qt)) return true; } return false; diff --git a/src/xfns.c b/src/xfns.c index 05023524a7e..4cd03136e6b 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1584,7 +1584,7 @@ x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) if (STRINGP (arg)) { - if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) + if (STRINGP (oldval) && BASE_EQ (Fstring_equal (oldval, arg), Qt)) return; } else if (!STRINGP (oldval) && NILP (oldval) == NILP (arg)) @@ -1616,7 +1616,7 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) if (STRINGP (arg)) { - if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) + if (STRINGP (oldval) && BASE_EQ (Fstring_equal (oldval, arg), Qt)) return; } else if (!NILP (arg) || NILP (oldval)) diff --git a/src/xselect.c b/src/xselect.c index fff79fb99f8..dd82a906af1 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1939,9 +1939,9 @@ clean_local_selection_data (Lisp_Object obj) && INTEGERP (XCAR (obj)) && FIXNUMP (XCDR (obj))) { - if (EQ (XCAR (obj), make_fixnum (0))) + if (BASE_EQ (XCAR (obj), make_fixnum (0))) return XCDR (obj); - if (EQ (XCAR (obj), make_fixnum (-1))) + if (BASE_EQ (XCAR (obj), make_fixnum (-1))) return make_fixnum (- XFIXNUM (XCDR (obj))); } if (VECTORP (obj)) -- 2.39.2