>From df5024dbaef5e1f7e39a2a8268523f9fc1af3118 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 20 Jul 2019 19:40:03 -0700 Subject: [PATCH 2/6] =?UTF-8?q?Rename=20=E2=80=98pure=E2=80=99=20to=20?= =?UTF-8?q?=E2=80=98purecopy=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 7a0611dd3e..8649d4e0f4 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5329,7 +5329,7 @@ make_pure_vector (ptrdiff_t len) 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 4c99d974bd..d4f6842f27 100644 --- a/src/fns.c +++ b/src/fns.c @@ -4055,7 +4055,7 @@ #define INDEX_SIZE_BOUND \ 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 @@ DEFUN ("make-hash-table", Fmake_hash_table, Smake_hash_table, 0, MANY, 0, (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 @@ DEFUN ("make-hash-table", Fmake_hash_table, Smake_hash_table, 0, MANY, 0, /* 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 @@ DEFUN ("make-hash-table", Fmake_hash_table, Smake_hash_table, 0, MANY, 0, 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 13014c82dc..8f60963eb7 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2287,7 +2287,7 @@ #define DEFSYM(sym, name) /* empty */ /* 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 03c00bf27b..206a196890 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 6623244c59..cb34090514 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); -- 2.17.1