summaryrefslogtreecommitdiff
path: root/src/lisp.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-04-08 15:33:22 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-04-08 15:33:59 -0700
commit6b0d58be9f6caa2fc4125ed98294e1937ee56d2a (patch)
tree1e347a21685939c2a69710cc588cdc78f974406c /src/lisp.h
parenta4aa94d0cdffb45723786aa798174e942d509774 (diff)
downloademacs-6b0d58be9f6caa2fc4125ed98294e1937ee56d2a.tar.gz
Minor improvements for hash function primitives
* src/fns.c (hashfn_eql): Define in terms of hashfn_equal and hashfn_eq rather than reaching inside them. (hashtest_eq, hashtest_eql, hashtest_equal): Now constants with initializers. (syms_of_fns): Omit no-longer-needed initialization. * src/lisp.h (LISPSYM_INITIALLY): New macro. (DEFINE_LISP_SYMBOL): Use it.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 170da67c61c..d111a78f3e0 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -721,12 +721,16 @@ struct Lisp_Symbol
except the former expands to an integer constant expression. */
#define XLI_BUILTIN_LISPSYM(iname) TAG_SYMOFFSET ((iname) * sizeof *lispsym)
+/* LISPSYM_INITIALLY (Qfoo) is equivalent to Qfoo except it is
+ designed for use as an initializer, even for a constant initializer. */
+#define LISPSYM_INITIALLY(name) LISP_INITIALLY (XLI_BUILTIN_LISPSYM (i##name))
+
/* Declare extern constants for Lisp symbols. These can be helpful
when using a debugger like GDB, on older platforms where the debug
format does not represent C macros. */
#define DEFINE_LISP_SYMBOL(name) \
DEFINE_GDB_SYMBOL_BEGIN (Lisp_Object, name) \
- DEFINE_GDB_SYMBOL_END (LISP_INITIALLY (XLI_BUILTIN_LISPSYM (i##name)))
+ DEFINE_GDB_SYMBOL_END (LISPSYM_INITIALLY (name))
/* By default, define macros for Qt, etc., as this leads to a bit
better performance in the core Emacs interpreter. A plugin can
@@ -3441,7 +3445,7 @@ ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, EMACS_UINT *);
ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,
EMACS_UINT);
void hash_remove_from_table (struct Lisp_Hash_Table *, Lisp_Object);
-extern struct hash_table_test hashtest_eq, hashtest_eql, hashtest_equal;
+extern struct hash_table_test const hashtest_eq, hashtest_eql, hashtest_equal;
extern void validate_subarray (Lisp_Object, Lisp_Object, Lisp_Object,
ptrdiff_t, ptrdiff_t *, ptrdiff_t *);
extern Lisp_Object substring_both (Lisp_Object, ptrdiff_t, ptrdiff_t,