emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master df5024d 2/6: Rename ‘pure’ to ‘purecopy’


From: Paul Eggert
Subject: [Emacs-diffs] master df5024d 2/6: Rename ‘pure’ to ‘purecopy’
Date: Sat, 20 Jul 2019 23:13:53 -0400 (EDT)

branch: master
commit df5024dbaef5e1f7e39a2a8268523f9fc1af3118
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Rename ‘pure’ to ‘purecopy’
    
    * src/lisp.h (struct Lisp_Hash_Table): Rename ‘pure’ member to
    ‘purecopy’, as the old name was quite confusing (it did not
    mean the hash table was pure).  All uses changed.
---
 src/alloc.c   |  6 +++---
 src/fns.c     | 10 +++++-----
 src/lisp.h    |  2 +-
 src/pdumper.c |  2 +-
 src/print.c   |  4 ++--
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/alloc.c b/src/alloc.c
index 7a0611d..8649d4e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5329,7 +5329,7 @@ static struct Lisp_Hash_Table *
 purecopy_hash_table (struct Lisp_Hash_Table *table)
 {
   eassert (NILP (table->weak));
-  eassert (table->pure);
+  eassert (table->purecopy);
 
   struct Lisp_Hash_Table *pure = pure_alloc (sizeof *pure, Lisp_Vectorlike);
   struct hash_table_test pure_test = table->test;
@@ -5346,7 +5346,7 @@ purecopy_hash_table (struct Lisp_Hash_Table *table)
   pure->index = purecopy (table->index);
   pure->count = table->count;
   pure->next_free = table->next_free;
-  pure->pure = table->pure;
+  pure->purecopy = table->purecopy;
   pure->rehash_threshold = table->rehash_threshold;
   pure->rehash_size = table->rehash_size;
   pure->key_and_value = purecopy (table->key_and_value);
@@ -5410,7 +5410,7 @@ purecopy (Lisp_Object obj)
       /* Do not purify hash tables which haven't been defined with
          :purecopy as non-nil or are weak - they aren't guaranteed to
          not change.  */
-      if (!NILP (table->weak) || !table->pure)
+      if (!NILP (table->weak) || !table->purecopy)
         {
           /* Instead, add the hash table to the list of pinned objects,
              so that it will be marked during GC.  */
diff --git a/src/fns.c b/src/fns.c
index 4c99d97..d4f6842 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -4055,7 +4055,7 @@ allocate_hash_table (void)
 Lisp_Object
 make_hash_table (struct hash_table_test test, EMACS_INT size,
                 float rehash_size, float rehash_threshold,
-                Lisp_Object weak, bool pure)
+                Lisp_Object weak, bool purecopy)
 {
   struct Lisp_Hash_Table *h;
   Lisp_Object table;
@@ -4094,7 +4094,7 @@ make_hash_table (struct hash_table_test test, EMACS_INT 
size,
   h->next = make_vector (size, make_fixnum (-1));
   h->index = make_vector (index_size, make_fixnum (-1));
   h->next_weak = NULL;
-  h->pure = pure;
+  h->purecopy = purecopy;
 
   /* Set up the free list.  */
   for (i = 0; i < size - 1; ++i)
@@ -4748,7 +4748,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS)  */)
   (ptrdiff_t nargs, Lisp_Object *args)
 {
   Lisp_Object test, weak;
-  bool pure;
+  bool purecopy;
   struct hash_table_test testdesc;
   ptrdiff_t i;
   USE_SAFE_ALLOCA;
@@ -4784,7 +4784,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS)  */)
 
   /* See if there's a `:purecopy PURECOPY' argument.  */
   i = get_key_arg (QCpurecopy, nargs, args, used);
-  pure = i && !NILP (args[i]);
+  purecopy = i && !NILP (args[i]);
   /* See if there's a `:size SIZE' argument.  */
   i = get_key_arg (QCsize, nargs, args, used);
   Lisp_Object size_arg = i ? args[i] : Qnil;
@@ -4835,7 +4835,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS)  */)
 
   SAFE_FREE ();
   return make_hash_table (testdesc, size, rehash_size, rehash_threshold, weak,
-                          pure);
+                         purecopy);
 }
 
 
diff --git a/src/lisp.h b/src/lisp.h
index 13014c8..8f60963 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2287,7 +2287,7 @@ struct Lisp_Hash_Table
 
   /* True if the table can be purecopied.  The table cannot be
      changed afterwards.  */
-  bool pure;
+  bool purecopy;
 
   /* Resize hash table when number of entries / table size is >= this
      ratio.  */
diff --git a/src/pdumper.c b/src/pdumper.c
index 03c00bf..206a196 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2741,7 +2741,7 @@ dump_hash_table (struct dump_context *ctx,
      them as close to the hash table as possible.  */
   DUMP_FIELD_COPY (out, hash, count);
   DUMP_FIELD_COPY (out, hash, next_free);
-  DUMP_FIELD_COPY (out, hash, pure);
+  DUMP_FIELD_COPY (out, hash, purecopy);
   DUMP_FIELD_COPY (out, hash, rehash_threshold);
   DUMP_FIELD_COPY (out, hash, rehash_size);
   dump_field_lv (ctx, out, hash, &hash->key_and_value, WEIGHT_STRONG);
diff --git a/src/print.c b/src/print.c
index 6623244..cb34090 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1575,10 +1575,10 @@ print_vectorlike (Lisp_Object obj, Lisp_Object 
printcharfun, bool escapeflag,
        print_object (Fhash_table_rehash_threshold (obj),
                      printcharfun, escapeflag);
 
-       if (h->pure)
+       if (h->purecopy)
          {
            print_c_string (" purecopy ", printcharfun);
-           print_object (h->pure ? Qt : Qnil, printcharfun, escapeflag);
+           print_object (h->purecopy ? Qt : Qnil, printcharfun, escapeflag);
          }
 
        print_c_string (" data ", printcharfun);



reply via email to

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