From b94840c6b596057aa972c1b1da49f05f12488a93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Thu, 15 Aug 2024 16:00:47 +0200 Subject: [PATCH] Replace some EQ with BASE_EQ * src/eval.c (FletX, Flet, funcall_lambda) (let_shadows_buffer_binding_p): * src/data.c (set_blv_found, set_internal, default_value) (set_default_internal, Flocal_variable_p): * src/buffer.c (Fkill_buffer): (mouse_face_overlay_overlaps, compare_overlays) (report_overlay_modification): BASE_EQ is safe because we don't actually compare symbols here. (cherry picked from commit 8db72a8d4b77ccdbb68f7361a52d7f2ebe78b656) --- src/buffer.c | 8 ++++---- src/data.c | 12 ++++++------ src/eval.c | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index 6ec40aff646..78f1d977221 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2036,7 +2036,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) /* If the buffer now current is shown in the minibuffer and our buffer is the sole other buffer give up. */ XSETBUFFER (tem, current_buffer); - if (EQ (tem, XWINDOW (minibuf_window)->contents) + if (BASE_EQ (tem, XWINDOW (minibuf_window)->contents) && BASE_EQ (buffer, Fother_buffer (buffer, Qnil, Qnil))) return Qnil; @@ -3175,7 +3175,7 @@ mouse_face_overlay_overlaps (Lisp_Object overlay) { if (node->begin < end && node->end > start && node->begin < node->end - && !EQ (node->data, overlay) + && !BASE_EQ (node->data, overlay) && (tem = Foverlay_get (overlay, Qmouse_face), !NILP (tem))) return true; @@ -3238,7 +3238,7 @@ compare_overlays (const void *v1, const void *v2) return s2->end < s1->end ? -1 : 1; else if (s1->spriority != s2->spriority) return (s1->spriority < s2->spriority ? -1 : 1); - else if (EQ (s1->overlay, s2->overlay)) + else if (BASE_EQ (s1->overlay, s2->overlay)) return 0; else /* Avoid the non-determinism of qsort by choosing an arbitrary ordering @@ -4090,7 +4090,7 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { /* True if this change is an insertion. */ - bool insertion = (after ? XFIXNAT (arg3) == 0 : EQ (start, end)); + bool insertion = (after ? XFIXNAT (arg3) == 0 : BASE_EQ (start, end)); /* We used to run the functions as soon as we found them and only register them in last_overlay_modification_hooks for the purpose of the `after' diff --git a/src/data.c b/src/data.c index d947d200870..6fa543c97cf 100644 --- a/src/data.c +++ b/src/data.c @@ -82,7 +82,7 @@ XOBJFWD (lispfwd a) static void set_blv_found (struct Lisp_Buffer_Local_Value *blv, int found) { - eassert (found == !EQ (blv->defcell, blv->valcell)); + eassert (found == !BASE_EQ (blv->defcell, blv->valcell)); blv->found = found; } @@ -1697,9 +1697,9 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, loaded, or if it's a Lisp_Buffer_Local_Value and the default binding is loaded, the loaded binding may be the wrong one. */ - if (!EQ (blv->where, where) + if (!BASE_EQ (blv->where, where) /* Also unload a global binding (if the var is local_if_set). */ - || (EQ (blv->valcell, blv->defcell))) + || (BASE_EQ (blv->valcell, blv->defcell))) { /* The currently loaded binding is not necessarily valid. We need to unload it, and choose a new binding. */ @@ -1940,7 +1940,7 @@ default_value (Lisp_Object symbol) But the `realvalue' slot may be more up to date, since ordinary setq stores just that slot. So use that. */ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); - if (blv->fwd.fwdptr && EQ (blv->valcell, blv->defcell)) + if (blv->fwd.fwdptr && BASE_EQ (blv->valcell, blv->defcell)) return do_symval_forwarding (blv->fwd); else return XCDR (blv->defcell); @@ -2035,7 +2035,7 @@ set_default_internal (Lisp_Object symbol, Lisp_Object value, XSETCDR (blv->defcell, value); /* If the default binding is now loaded, set the REALVALUE slot too. */ - if (blv->fwd.fwdptr && EQ (blv->defcell, blv->valcell)) + if (blv->fwd.fwdptr && BASE_EQ (blv->defcell, blv->valcell)) store_symval_forwarding (blv->fwd, value, NULL); return; } @@ -2401,7 +2401,7 @@ Also see `buffer-local-boundp'.*/) XSETBUFFER (tmp, buf); XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ - if (EQ (blv->where, tmp)) /* The binding is already loaded. */ + if (BASE_EQ (blv->where, tmp)) /* The binding is already loaded. */ return blv_found (blv) ? Qt : Qnil; else return NILP (assq_no_quit (variable, BVAR (buf, local_var_alist))) diff --git a/src/eval.c b/src/eval.c index 16ece744f42..b4103acd28f 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1026,7 +1026,7 @@ usage: (let* VARLIST BODY...) */) { Lisp_Object newenv = Fcons (Fcons (var, val), Vinternal_interpreter_environment); - if (EQ (Vinternal_interpreter_environment, lexenv)) + if (BASE_EQ (Vinternal_interpreter_environment, lexenv)) /* Save the old lexical environment on the specpdl stack, but only for the first lexical binding, since we'll never need to revert to one of the intermediate ones. */ @@ -1102,7 +1102,7 @@ usage: (let VARLIST BODY...) */) specbind (var, tem); } - if (!EQ (lexenv, Vinternal_interpreter_environment)) + if (!BASE_EQ (lexenv, Vinternal_interpreter_environment)) /* Instantiate a new lexical environment. */ specbind (Qinternal_interpreter_environment, lexenv); @@ -3320,7 +3320,7 @@ funcall_lambda (Lisp_Object fun, ptrdiff_t nargs, Lisp_Object *arg_vector) else if (i < nargs) xsignal2 (Qwrong_number_of_arguments, fun, make_fixnum (nargs)); - if (!EQ (lexenv, Vinternal_interpreter_environment)) + if (!BASE_EQ (lexenv, Vinternal_interpreter_environment)) /* Instantiate a new lexical environment. */ specbind (Qinternal_interpreter_environment, lexenv); @@ -3471,7 +3471,7 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol) eassert (let_bound_symbol->u.s.redirect != SYMBOL_VARALIAS); if (symbol == let_bound_symbol && p->kind != SPECPDL_LET_LOCAL /* bug#62419 */ - && EQ (specpdl_where (p), buf)) + && BASE_EQ (specpdl_where (p), buf)) return 1; } -- 2.39.2