diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2012-08-20 12:07:38 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2012-08-20 12:07:38 +0400 |
commit | e83064befad4b03bae2f873ece63c050f2c4ca22 (patch) | |
tree | bf2882b2b653b07da53a33d393c5667715e8bd4a /src/lisp.h | |
parent | 3d300447843086aa7ae4df85dd0a97f27b0b885a (diff) | |
download | emacs-e83064befad4b03bae2f873ece63c050f2c4ca22.tar.gz |
Inline setter functions for hash table members.
* lisp.h (set_hash_key, set_hash_value, set_hash_next)
(set_hash_hash, set_hash_index): Rename with _slot suffix.
(set_hash_key_and_value, set_hash_index, set_hash_next)
(set_hash_hash): New functions.
* charset.c, fns.c: Adjust users.
Diffstat (limited to 'src/lisp.h')
-rw-r--r-- | src/lisp.h | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/lisp.h b/src/lisp.h index f08e7af8959..3a6eb72d020 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2345,31 +2345,55 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val) } LISP_INLINE void -set_hash_key (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_key_and_value (struct Lisp_Hash_Table *h, Lisp_Object key_and_value) +{ + h->key_and_value = key_and_value; +} + +LISP_INLINE void +set_hash_key_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->key_and_value, 2 * idx, val); } LISP_INLINE void -set_hash_value (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_value_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->key_and_value, 2 * idx + 1, val); } LISP_INLINE void -set_hash_next (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_next (struct Lisp_Hash_Table *h, Lisp_Object next) +{ + h->next = next; +} + +LISP_INLINE void +set_hash_next_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->next, idx, val); } LISP_INLINE void -set_hash_hash (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_hash (struct Lisp_Hash_Table *h, Lisp_Object hash) +{ + h->hash = hash; +} + +LISP_INLINE void +set_hash_hash_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->hash, idx, val); } LISP_INLINE void -set_hash_index (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_index (struct Lisp_Hash_Table *h, Lisp_Object index) +{ + h->index = index; +} + +LISP_INLINE void +set_hash_index_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->index, idx, val); } |