emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pkg 0e5323c908 16/76: Remove Lisp_Symbol::interned


From: Gerd Moellmann
Subject: pkg 0e5323c908 16/76: Remove Lisp_Symbol::interned
Date: Fri, 21 Oct 2022 00:16:10 -0400 (EDT)

branch: pkg
commit 0e5323c908cadf96bba6390a70025ad734da4c0f
Author: Gerd Möllmann <gerd@gnu.org>
Commit: Gerd Möllmann <gerd@gnu.org>

    Remove Lisp_Symbol::interned
---
 src/alloc.c   |  1 -
 src/lisp.h    | 29 -----------------------------
 src/lread.c   |  4 ----
 src/pdumper.c |  1 -
 src/print.c   |  4 ++--
 5 files changed, 2 insertions(+), 37 deletions(-)

diff --git a/src/alloc.c b/src/alloc.c
index 034d82e3ea..ba5629c9c9 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3628,7 +3628,6 @@ init_symbol (Lisp_Object val, Lisp_Object name)
   set_symbol_package (val, Qnil);
   set_symbol_next (val, NULL);
   p->u.s.gcmarkbit = false;
-  p->u.s.interned = SYMBOL_UNINTERNED;
   p->u.s.trapped_write = SYMBOL_UNTRAPPED_WRITE;
   p->u.s.declared_special = false;
   p->u.s.pinned = false;
diff --git a/src/lisp.h b/src/lisp.h
index c5ce309306..ab99535663 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -808,15 +808,6 @@ INLINE void
    help static checking.  */
 typedef struct { void const *fwdptr; } lispfwd;
 
-/* Interned state of a symbol.  */
-
-enum symbol_interned
-{
-  SYMBOL_UNINTERNED = 0,
-  SYMBOL_INTERNED = 1,
-  SYMBOL_INTERNED_IN_INITIAL_OBARRAY = 2
-};
-
 enum symbol_redirect
 {
   SYMBOL_PLAINVAL  = 4,
@@ -852,10 +843,6 @@ struct Lisp_Symbol
         2 : trap the write, call watcher functions.  */
       ENUM_BF (symbol_trapped_write) trapped_write : 2;
 
-      /* Interned state of the symbol.  This is an enumerator from
-        enum symbol_interned.  */
-      unsigned interned : 2;
-
       /* True means that this variable has been explicitly declared
         special (with `defvar' etc), and shouldn't be lexically bound.  */
       bool_bf declared_special : 1;
@@ -2411,22 +2398,6 @@ SYMBOL_EXTERNAL_P (Lisp_Object sym)
   return XSYMBOL (sym)->u.s.external;
 }
 
-/* Value is true if SYM is an interned symbol.  */
-
-INLINE bool
-SYMBOL_INTERNED_P (Lisp_Object sym)
-{
-  return XSYMBOL (sym)->u.s.interned != SYMBOL_UNINTERNED;
-}
-
-/* Value is true if SYM is interned in initial_obarray.  */
-
-INLINE bool
-SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (Lisp_Object sym)
-{
-  return XSYMBOL (sym)->u.s.interned == SYMBOL_INTERNED_IN_INITIAL_OBARRAY;
-}
-
 /* Value is non-zero if symbol cannot be changed through a simple set,
    i.e. it's a constant (e.g. nil, t, :keywords), or it has some
    watching functions.  */
diff --git a/src/lread.c b/src/lread.c
index f847879ebc..365e47d146 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4758,10 +4758,6 @@ intern_sym (Lisp_Object sym, Lisp_Object obarray, 
Lisp_Object index)
 {
   Lisp_Object *ptr;
 
-  XSYMBOL (sym)->u.s.interned = (EQ (obarray, initial_obarray)
-                                ? SYMBOL_INTERNED_IN_INITIAL_OBARRAY
-                                : SYMBOL_INTERNED);
-
   if (SREF (SYMBOL_NAME (sym), 0) == ':' && EQ (obarray, initial_obarray))
     {
       make_symbol_constant (sym);
diff --git a/src/pdumper.c b/src/pdumper.c
index d7102b4298..fdbdf1db10 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2447,7 +2447,6 @@ dump_symbol (struct dump_context *ctx,
   eassert (symbol->u.s.gcmarkbit == 0);
   DUMP_FIELD_COPY (&out, symbol, u.s.redirect);
   DUMP_FIELD_COPY (&out, symbol, u.s.trapped_write);
-  DUMP_FIELD_COPY (&out, symbol, u.s.interned);
   DUMP_FIELD_COPY (&out, symbol, u.s.declared_special);
   DUMP_FIELD_COPY (&out, symbol, u.s.pinned);
   DUMP_FIELD_COPY (&out, symbol, u.s.external);
diff --git a/src/print.c b/src/print.c
index 4ddc2c155c..8f1f33c4d5 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1310,7 +1310,7 @@ print (Lisp_Object obj, Lisp_Object printcharfun, bool 
escapeflag)
           || RECORDP (obj)))                              \
    || (! NILP (Vprint_gensym)                             \
        && SYMBOLP (obj)                                           \
-       && !SYMBOL_INTERNED_P (obj)))
+       && NILP (SYMBOL_PACKAGE (obj))))
 
 /* The print preprocess stack, used to traverse data structures.  */
 
@@ -1412,7 +1412,7 @@ print_preprocess (Lisp_Object obj)
                 the lisp function byte-compile-output-docform.  */
              || (!NILP (Vprint_continuous_numbering)
                  && SYMBOLP (obj)
-                 && !SYMBOL_INTERNED_P (obj)))
+                 && NILP (SYMBOL_PACKAGE (obj))))
            { /* OBJ appears more than once.  Let's remember that.  */
              if (!FIXNUMP (num))
                {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]