aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2024-02-13 09:54:51 -0800
committerPaul Eggert2024-02-13 11:20:32 -0800
commitefdcd7b8f78ef22c0213ea770a552fb69b789381 (patch)
treed54686c1b24d3187b744fd9bf87d3e96557bdd46
parent08c1863257469b4cb85e97a276ba635d44b22666 (diff)
downloademacs-efdcd7b8f78ef22c0213ea770a552fb69b789381.tar.gz
emacs-efdcd7b8f78ef22c0213ea770a552fb69b789381.zip
Remove BASE2_EQ
* src/lisp.h (lisp_h_BASE2_EQ, BASE2_EQ): Remove. All uses removed. BASE2_EQ was present only for minor optimization and with current gcc -O2, BASE2_EQ does not affect performance, so it’s not worth the hassle.
-rw-r--r--src/lisp.h18
-rw-r--r--src/lread.c4
-rw-r--r--src/timefns.c6
3 files changed, 9 insertions, 19 deletions
diff --git a/src/lisp.h b/src/lisp.h
index b609bef990c..0b676a027eb 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -384,14 +384,11 @@ typedef EMACS_INT Lisp_Word;
384 ((ok) ? (void) 0 : wrong_type_argument (predicate, x)) 384 ((ok) ? (void) 0 : wrong_type_argument (predicate, x))
385#define lisp_h_CONSP(x) TAGGEDP (x, Lisp_Cons) 385#define lisp_h_CONSP(x) TAGGEDP (x, Lisp_Cons)
386#define lisp_h_BASE_EQ(x, y) (XLI (x) == XLI (y)) 386#define lisp_h_BASE_EQ(x, y) (XLI (x) == XLI (y))
387#define lisp_h_BASE2_EQ(x, y) \ 387#define lisp_h_EQ(x, y) \
388 BASE_EQ ((symbols_with_pos_enabled && SYMBOL_WITH_POS_P (x) \ 388 BASE_EQ ((symbols_with_pos_enabled && SYMBOL_WITH_POS_P (x) \
389 ? XSYMBOL_WITH_POS (x)->sym : (x)), \ 389 ? XSYMBOL_WITH_POS (x)->sym : (x)), \
390 y) 390 (symbols_with_pos_enabled && SYMBOL_WITH_POS_P (y) \
391#define lisp_h_EQ(x, y) \ 391 ? XSYMBOL_WITH_POS (y)->sym : (y)))
392 BASE2_EQ (x, \
393 (symbols_with_pos_enabled && SYMBOL_WITH_POS_P (y) \
394 ? XSYMBOL_WITH_POS (y)->sym : (y)))
395 392
396#define lisp_h_FIXNUMP(x) \ 393#define lisp_h_FIXNUMP(x) \
397 (! (((unsigned) (XLI (x) >> (USE_LSB_TAG ? 0 : FIXNUM_BITS)) \ 394 (! (((unsigned) (XLI (x) >> (USE_LSB_TAG ? 0 : FIXNUM_BITS)) \
@@ -461,7 +458,6 @@ typedef EMACS_INT Lisp_Word;
461# define CHECK_TYPE(ok, predicate, x) lisp_h_CHECK_TYPE (ok, predicate, x) 458# define CHECK_TYPE(ok, predicate, x) lisp_h_CHECK_TYPE (ok, predicate, x)
462# define CONSP(x) lisp_h_CONSP (x) 459# define CONSP(x) lisp_h_CONSP (x)
463# define BASE_EQ(x, y) lisp_h_BASE_EQ (x, y) 460# define BASE_EQ(x, y) lisp_h_BASE_EQ (x, y)
464# define BASE2_EQ(x, y) lisp_h_BASE2_EQ (x, y)
465# define FLOATP(x) lisp_h_FLOATP (x) 461# define FLOATP(x) lisp_h_FLOATP (x)
466# define FIXNUMP(x) lisp_h_FIXNUMP (x) 462# define FIXNUMP(x) lisp_h_FIXNUMP (x)
467# define NILP(x) lisp_h_NILP (x) 463# define NILP(x) lisp_h_NILP (x)
@@ -1339,14 +1335,6 @@ INLINE bool
1339 return lisp_h_BASE_EQ (x, y); 1335 return lisp_h_BASE_EQ (x, y);
1340} 1336}
1341 1337
1342/* Return true if X and Y are the same object, reckoning X to be the
1343 same as a bare symbol Y if X is Y with position. */
1344INLINE bool
1345(BASE2_EQ) (Lisp_Object x, Lisp_Object y)
1346{
1347 return lisp_h_BASE2_EQ (x, y);
1348}
1349
1350/* Return true if X and Y are the same object, reckoning a symbol with 1338/* Return true if X and Y are the same object, reckoning a symbol with
1351 position as being the same as the bare symbol. */ 1339 position as being the same as the bare symbol. */
1352INLINE bool 1340INLINE bool
diff --git a/src/lread.c b/src/lread.c
index d339b2f15ae..551bfd735a2 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -5063,10 +5063,12 @@ it defaults to the value of `obarray'. */)
5063 { 5063 {
5064 /* If already a symbol, we don't do shorthand-longhand translation, 5064 /* If already a symbol, we don't do shorthand-longhand translation,
5065 as promised in the docstring. */ 5065 as promised in the docstring. */
5066 Lisp_Object sym = (symbols_with_pos_enabled && SYMBOL_WITH_POS_P (name)
5067 ? XSYMBOL_WITH_POS (name)->sym : name);
5066 string = XSYMBOL (name)->u.s.name; 5068 string = XSYMBOL (name)->u.s.name;
5067 tem 5069 tem
5068 = oblookup (obarray, SSDATA (string), SCHARS (string), SBYTES (string)); 5070 = oblookup (obarray, SSDATA (string), SCHARS (string), SBYTES (string));
5069 return BASE2_EQ (name, tem) ? name : Qnil; 5071 return BASE_EQ (sym, tem) ? name : Qnil;
5070 } 5072 }
5071} 5073}
5072 5074
diff --git a/src/timefns.c b/src/timefns.c
index 1541583b485..fc1edf136cb 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -225,7 +225,7 @@ tzlookup (Lisp_Object zone, bool settz)
225 225
226 if (NILP (zone)) 226 if (NILP (zone))
227 return local_tz; 227 return local_tz;
228 else if (BASE_EQ (zone, make_fixnum (0)) || BASE2_EQ (zone, Qt)) 228 else if (BASE_EQ (zone, make_fixnum (0)) || EQ (zone, Qt))
229 { 229 {
230 zone_string = "UTC0"; 230 zone_string = "UTC0";
231 new_tz = utc_tz; 231 new_tz = utc_tz;
@@ -234,7 +234,7 @@ tzlookup (Lisp_Object zone, bool settz)
234 { 234 {
235 bool plain_integer = FIXNUMP (zone); 235 bool plain_integer = FIXNUMP (zone);
236 236
237 if (BASE2_EQ (zone, Qwall)) 237 if (EQ (zone, Qwall))
238 zone_string = 0; 238 zone_string = 0;
239 else if (STRINGP (zone)) 239 else if (STRINGP (zone))
240 zone_string = SSDATA (ENCODE_SYSTEM (zone)); 240 zone_string = SSDATA (ENCODE_SYSTEM (zone));
@@ -1548,7 +1548,7 @@ usage: (decode-time &optional TIME ZONE FORM) */)
1548 1548
1549 /* Compute SEC from LOCAL_TM.tm_sec and HZ. */ 1549 /* Compute SEC from LOCAL_TM.tm_sec and HZ. */
1550 Lisp_Object hz = lt.hz, sec; 1550 Lisp_Object hz = lt.hz, sec;
1551 if (BASE_EQ (hz, make_fixnum (1)) || !BASE2_EQ (form, Qt)) 1551 if (BASE_EQ (hz, make_fixnum (1)) || !EQ (form, Qt))
1552 sec = make_fixnum (local_tm.tm_sec); 1552 sec = make_fixnum (local_tm.tm_sec);
1553 else 1553 else
1554 { 1554 {