diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-11-29 13:12:24 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-11-29 13:12:55 -0800 |
commit | 36dbdedefa2372870313e219164ff9b3b7712e9e (patch) | |
tree | eae45d92207a19bc0c1d21fab029030ffdaae302 | |
parent | 9221b77c9962cc5a4cb7310b54b5b3c2b1faa469 (diff) | |
download | emacs-36dbdedefa2372870313e219164ff9b3b7712e9e.tar.gz |
Pacify Sun C 5.14
* src/lisp.h (enum Lisp_Save_Type): Put SAVE_UNUSED,
SAVED_INTEGER, SAVE_FUNCPOINTER, SAVE_POINTER, and SAVE_OBJECT
into this enum rather than into an anonymous enum. This avoids
diagnostics from Sun C 5.14 and is a bit clearer anyway.
-rw-r--r-- | src/lisp.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/lisp.h b/src/lisp.h index b4ddad1b2a6..6fbedd3b1f5 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2112,18 +2112,8 @@ struct Lisp_Overlay Lisp_Object plist; }; -/* Types of data which may be saved in a Lisp_Save_Value. */ - -enum - { - SAVE_UNUSED, - SAVE_INTEGER, - SAVE_FUNCPOINTER, - SAVE_POINTER, - SAVE_OBJECT - }; - -/* Number of bits needed to store one of the above values. */ +/* Number of bits needed to store one of the values + SAVE_UNUSED..SAVE_OBJECT. */ enum { SAVE_SLOT_BITS = 3 }; /* Number of slots in a save value where save_type is nonzero. */ @@ -2133,8 +2123,15 @@ enum { SAVE_VALUE_SLOTS = 4 }; enum { SAVE_TYPE_BITS = SAVE_VALUE_SLOTS * SAVE_SLOT_BITS + 1 }; +/* Types of data which may be saved in a Lisp_Save_Value. */ + enum Lisp_Save_Type { + SAVE_UNUSED, + SAVE_INTEGER, + SAVE_FUNCPOINTER, + SAVE_POINTER, + SAVE_OBJECT, SAVE_TYPE_INT_INT = SAVE_INTEGER + (SAVE_INTEGER << SAVE_SLOT_BITS), SAVE_TYPE_INT_INT_INT = (SAVE_INTEGER + (SAVE_TYPE_INT_INT << SAVE_SLOT_BITS)), @@ -2152,6 +2149,12 @@ enum Lisp_Save_Type SAVE_TYPE_MEMORY = SAVE_TYPE_PTR_INT + (1 << (SAVE_TYPE_BITS - 1)) }; +/* SAVE_SLOT_BITS must be large enough to represent these values. */ +verify (((SAVE_UNUSED | SAVE_INTEGER | SAVE_FUNCPOINTER + | SAVE_POINTER | SAVE_OBJECT) + >> SAVE_SLOT_BITS) + == 0); + /* Special object used to hold a different values for later use. This is mostly used to package C integers and pointers to call |