diff options
| author | Paul Eggert | 2011-04-25 12:40:22 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-25 12:40:22 -0700 |
| commit | b102ceb110a9cd38f5c589c1869747b1e1c792cb (patch) | |
| tree | 458a66a2672f2f68a9de09539cbf273edf2bf870 /src | |
| parent | 179dade40292e5bdccdd4ab88748a06a94307570 (diff) | |
| download | emacs-b102ceb110a9cd38f5c589c1869747b1e1c792cb.tar.gz emacs-b102ceb110a9cd38f5c589c1869747b1e1c792cb.zip | |
* lisp.h: Say "vectorlike header" rather than "vector header.
(struct vectorlike_header): Rename from struct vector_header.
(XVECTORLIKE_HEADER_SIZE): Renamed from XVECTOR_HEADER_SIZE.
All uses changed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/buffer.h | 2 | ||||
| -rw-r--r-- | src/font.h | 6 | ||||
| -rw-r--r-- | src/frame.h | 2 | ||||
| -rw-r--r-- | src/lisp.h | 21 | ||||
| -rw-r--r-- | src/process.h | 2 | ||||
| -rw-r--r-- | src/termhooks.h | 2 | ||||
| -rw-r--r-- | src/window.c | 4 | ||||
| -rw-r--r-- | src/window.h | 2 |
9 files changed, 27 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e1548e9a094..e55010fdc9e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2011-04-25 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-04-25 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * lisp.h: Say "vectorlike header" rather than "vector header. | ||
| 4 | (struct vectorlike_header): Rename from struct vector_header. | ||
| 5 | (XVECTORLIKE_HEADER_SIZE): Renamed from XVECTOR_HEADER_SIZE. | ||
| 6 | All uses changed. | ||
| 7 | |||
| 3 | lisp.h: Fix a problem with aliasing and vector headers. | 8 | lisp.h: Fix a problem with aliasing and vector headers. |
| 4 | GCC 4.6.0 optimizes based on type-based alias analysis. For | 9 | GCC 4.6.0 optimizes based on type-based alias analysis. For |
| 5 | example, if b is of type struct buffer * and v of type struct | 10 | example, if b is of type struct buffer * and v of type struct |
| @@ -33,6 +38,7 @@ | |||
| 33 | object, to help avoid aliasing. | 38 | object, to help avoid aliasing. |
| 34 | (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP. | 39 | (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP. |
| 35 | (SUBRP): Likewise, since Lisp_Subr is a special case. | 40 | (SUBRP): Likewise, since Lisp_Subr is a special case. |
| 41 | |||
| 36 | * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table): | 42 | * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table): |
| 37 | (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector): | 43 | (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector): |
| 38 | (struct Lisp_Hash_Table): Combine first two members into a single | 44 | (struct Lisp_Hash_Table): Combine first two members into a single |
diff --git a/src/buffer.h b/src/buffer.h index 51b318218cc..2f33065cd1a 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -505,7 +505,7 @@ struct buffer | |||
| 505 | collect killed buffers properly. | 505 | collect killed buffers properly. |
| 506 | Note that vectors and most pseudovectors are all on one chain, | 506 | Note that vectors and most pseudovectors are all on one chain, |
| 507 | but buffers are on a separate chain of their own. */ | 507 | but buffers are on a separate chain of their own. */ |
| 508 | struct vector_header header; | 508 | struct vectorlike_header header; |
| 509 | 509 | ||
| 510 | /* This structure holds the coordinates of the buffer contents | 510 | /* This structure holds the coordinates of the buffer contents |
| 511 | in ordinary buffers. In indirect buffers, this is not used. */ | 511 | in ordinary buffers. In indirect buffers, this is not used. */ |
diff --git a/src/font.h b/src/font.h index b9ac80f2cda..4b3ceed1dd3 100644 --- a/src/font.h +++ b/src/font.h | |||
| @@ -254,7 +254,7 @@ extern Lisp_Object Qja, Qko; | |||
| 254 | 254 | ||
| 255 | struct font_spec | 255 | struct font_spec |
| 256 | { | 256 | { |
| 257 | struct vector_header header; | 257 | struct vectorlike_header header; |
| 258 | Lisp_Object props[FONT_SPEC_MAX]; | 258 | Lisp_Object props[FONT_SPEC_MAX]; |
| 259 | }; | 259 | }; |
| 260 | 260 | ||
| @@ -262,7 +262,7 @@ struct font_spec | |||
| 262 | 262 | ||
| 263 | struct font_entity | 263 | struct font_entity |
| 264 | { | 264 | { |
| 265 | struct vector_header header; | 265 | struct vectorlike_header header; |
| 266 | Lisp_Object props[FONT_ENTITY_MAX]; | 266 | Lisp_Object props[FONT_ENTITY_MAX]; |
| 267 | }; | 267 | }; |
| 268 | 268 | ||
| @@ -275,7 +275,7 @@ struct font_entity | |||
| 275 | 275 | ||
| 276 | struct font | 276 | struct font |
| 277 | { | 277 | { |
| 278 | struct vector_header header; | 278 | struct vectorlike_header header; |
| 279 | 279 | ||
| 280 | /* All Lisp_Object components must come first. | 280 | /* All Lisp_Object components must come first. |
| 281 | That ensures they are all aligned normally. */ | 281 | That ensures they are all aligned normally. */ |
diff --git a/src/frame.h b/src/frame.h index b1300484a7e..e73370340f1 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -82,7 +82,7 @@ struct font_driver_list; | |||
| 82 | 82 | ||
| 83 | struct frame | 83 | struct frame |
| 84 | { | 84 | { |
| 85 | struct vector_header header; | 85 | struct vectorlike_header header; |
| 86 | 86 | ||
| 87 | /* All Lisp_Object components must come first. | 87 | /* All Lisp_Object components must come first. |
| 88 | That ensures they are all aligned normally. */ | 88 | That ensures they are all aligned normally. */ |
diff --git a/src/lisp.h b/src/lisp.h index e717e7c5cdb..fbfc91a46fe 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -557,7 +557,8 @@ extern Lisp_Object make_number (EMACS_INT); | |||
| 557 | /* Extract the size field of a vector or vector-like object. */ | 557 | /* Extract the size field of a vector or vector-like object. */ |
| 558 | 558 | ||
| 559 | #define XVECTOR_SIZE(a) (XVECTOR (a)->header.size + 0) | 559 | #define XVECTOR_SIZE(a) (XVECTOR (a)->header.size + 0) |
| 560 | #define XVECTOR_HEADER_SIZE(a) (((struct vector_header *) XPNTR (a))->size + 0) | 560 | #define XVECTORLIKE_HEADER_SIZE(a) \ |
| 561 | (((struct vectorlike_header *) XPNTR (a))->size + 0) | ||
| 561 | 562 | ||
| 562 | /* Misc types. */ | 563 | /* Misc types. */ |
| 563 | 564 | ||
| @@ -612,7 +613,7 @@ extern Lisp_Object make_number (EMACS_INT); | |||
| 612 | #define XSETPVECTYPESIZE(v, code, sizeval) \ | 613 | #define XSETPVECTYPESIZE(v, code, sizeval) \ |
| 613 | ((v)->header.size = PSEUDOVECTOR_FLAG | (code) | (sizeval)) | 614 | ((v)->header.size = PSEUDOVECTOR_FLAG | (code) | (sizeval)) |
| 614 | #define XSETPSEUDOVECTOR(a, b, code) \ | 615 | #define XSETPSEUDOVECTOR(a, b, code) \ |
| 615 | XSETTYPED_PSEUDOVECTOR(a, b, XVECTOR_HEADER_SIZE (a), code) | 616 | XSETTYPED_PSEUDOVECTOR(a, b, XVECTORLIKE_HEADER_SIZE (a), code) |
| 616 | #define XSETTYPED_PSEUDOVECTOR(a, b, size, code) \ | 617 | #define XSETTYPED_PSEUDOVECTOR(a, b, size, code) \ |
| 617 | (XSETVECTOR (a, b), \ | 618 | (XSETVECTOR (a, b), \ |
| 618 | eassert ((size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \ | 619 | eassert ((size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \ |
| @@ -793,7 +794,7 @@ struct Lisp_String | |||
| 793 | /* Header of vector-like objects. This type documents the constraints on | 794 | /* Header of vector-like objects. This type documents the constraints on |
| 794 | layout of vectors and pseudovectors, and helps optimizing compilers not get | 795 | layout of vectors and pseudovectors, and helps optimizing compilers not get |
| 795 | fooled by Emacs's type punning. */ | 796 | fooled by Emacs's type punning. */ |
| 796 | struct vector_header | 797 | struct vectorlike_header |
| 797 | { | 798 | { |
| 798 | EMACS_UINT size; | 799 | EMACS_UINT size; |
| 799 | union { | 800 | union { |
| @@ -804,7 +805,7 @@ struct vector_header | |||
| 804 | 805 | ||
| 805 | struct Lisp_Vector | 806 | struct Lisp_Vector |
| 806 | { | 807 | { |
| 807 | struct vector_header header; | 808 | struct vectorlike_header header; |
| 808 | Lisp_Object contents[1]; | 809 | Lisp_Object contents[1]; |
| 809 | }; | 810 | }; |
| 810 | 811 | ||
| @@ -909,7 +910,7 @@ struct Lisp_Char_Table | |||
| 909 | pseudovector type information. It holds the size, too. | 910 | pseudovector type information. It holds the size, too. |
| 910 | The size counts the defalt, parent, purpose, ascii, | 911 | The size counts the defalt, parent, purpose, ascii, |
| 911 | contents, and extras slots. */ | 912 | contents, and extras slots. */ |
| 912 | struct vector_header header; | 913 | struct vectorlike_header header; |
| 913 | 914 | ||
| 914 | /* This holds a default value, | 915 | /* This holds a default value, |
| 915 | which is used whenever the value for a specific character is nil. */ | 916 | which is used whenever the value for a specific character is nil. */ |
| @@ -938,7 +939,7 @@ struct Lisp_Sub_Char_Table | |||
| 938 | { | 939 | { |
| 939 | /* HEADER.SIZE is the vector's size field, which also holds the | 940 | /* HEADER.SIZE is the vector's size field, which also holds the |
| 940 | pseudovector type information. It holds the size, too. */ | 941 | pseudovector type information. It holds the size, too. */ |
| 941 | struct vector_header header; | 942 | struct vectorlike_header header; |
| 942 | 943 | ||
| 943 | /* Depth of this sub char-table. It should be 1, 2, or 3. A sub | 944 | /* Depth of this sub char-table. It should be 1, 2, or 3. A sub |
| 944 | char-table of depth 1 contains 16 elements, and each element | 945 | char-table of depth 1 contains 16 elements, and each element |
| @@ -959,7 +960,7 @@ struct Lisp_Bool_Vector | |||
| 959 | { | 960 | { |
| 960 | /* HEADER.SIZE is the vector's size field. It doesn't have the real size, | 961 | /* HEADER.SIZE is the vector's size field. It doesn't have the real size, |
| 961 | just the subtype information. */ | 962 | just the subtype information. */ |
| 962 | struct vector_header header; | 963 | struct vectorlike_header header; |
| 963 | /* This is the size in bits. */ | 964 | /* This is the size in bits. */ |
| 964 | EMACS_UINT size; | 965 | EMACS_UINT size; |
| 965 | /* This contains the actual bits, packed into bytes. */ | 966 | /* This contains the actual bits, packed into bytes. */ |
| @@ -972,7 +973,7 @@ struct Lisp_Bool_Vector | |||
| 972 | 973 | ||
| 973 | This type is treated in most respects as a pseudovector, | 974 | This type is treated in most respects as a pseudovector, |
| 974 | but since we never dynamically allocate or free them, | 975 | but since we never dynamically allocate or free them, |
| 975 | we don't need a struct vector_header and its 'next' field. */ | 976 | we don't need a struct vectorlike_header and its 'next' field. */ |
| 976 | 977 | ||
| 977 | struct Lisp_Subr | 978 | struct Lisp_Subr |
| 978 | { | 979 | { |
| @@ -1120,7 +1121,7 @@ struct Lisp_Symbol | |||
| 1120 | struct Lisp_Hash_Table | 1121 | struct Lisp_Hash_Table |
| 1121 | { | 1122 | { |
| 1122 | /* This is for Lisp; the hash table code does not refer to it. */ | 1123 | /* This is for Lisp; the hash table code does not refer to it. */ |
| 1123 | struct vector_header header; | 1124 | struct vectorlike_header header; |
| 1124 | 1125 | ||
| 1125 | /* Function used to compare keys. */ | 1126 | /* Function used to compare keys. */ |
| 1126 | Lisp_Object test; | 1127 | Lisp_Object test; |
| @@ -1652,7 +1653,7 @@ typedef struct { | |||
| 1652 | 1653 | ||
| 1653 | /* True if object X is a pseudovector whose code is CODE. */ | 1654 | /* True if object X is a pseudovector whose code is CODE. */ |
| 1654 | #define PSEUDOVECTORP(x, code) \ | 1655 | #define PSEUDOVECTORP(x, code) \ |
| 1655 | TYPED_PSEUDOVECTORP(x, vector_header, code) | 1656 | TYPED_PSEUDOVECTORP(x, vectorlike_header, code) |
| 1656 | 1657 | ||
| 1657 | /* True if object X, with internal type struct T *, is a pseudovector whose | 1658 | /* True if object X, with internal type struct T *, is a pseudovector whose |
| 1658 | code is CODE. */ | 1659 | code is CODE. */ |
diff --git a/src/process.h b/src/process.h index 2fca7327a0c..4866a8c1022 100644 --- a/src/process.h +++ b/src/process.h | |||
| @@ -34,7 +34,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 34 | 34 | ||
| 35 | struct Lisp_Process | 35 | struct Lisp_Process |
| 36 | { | 36 | { |
| 37 | struct vector_header header; | 37 | struct vectorlike_header header; |
| 38 | 38 | ||
| 39 | /* Name of subprocess terminal. */ | 39 | /* Name of subprocess terminal. */ |
| 40 | Lisp_Object tty_name; | 40 | Lisp_Object tty_name; |
diff --git a/src/termhooks.h b/src/termhooks.h index 97dd87b4949..3a49b49aede 100644 --- a/src/termhooks.h +++ b/src/termhooks.h | |||
| @@ -323,7 +323,7 @@ struct w32_display_info; | |||
| 323 | struct terminal | 323 | struct terminal |
| 324 | { | 324 | { |
| 325 | /* This is for Lisp; the terminal code does not refer to it. */ | 325 | /* This is for Lisp; the terminal code does not refer to it. */ |
| 326 | struct vector_header header; | 326 | struct vectorlike_header header; |
| 327 | 327 | ||
| 328 | /* Parameter alist of this terminal. */ | 328 | /* Parameter alist of this terminal. */ |
| 329 | Lisp_Object param_alist; | 329 | Lisp_Object param_alist; |
diff --git a/src/window.c b/src/window.c index 92c7c57e213..b56ed84bc61 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -5794,7 +5794,7 @@ zero means top of window, negative means relative to bottom of window. */) | |||
| 5794 | 5794 | ||
| 5795 | struct save_window_data | 5795 | struct save_window_data |
| 5796 | { | 5796 | { |
| 5797 | struct vector_header header; | 5797 | struct vectorlike_header header; |
| 5798 | Lisp_Object selected_frame; | 5798 | Lisp_Object selected_frame; |
| 5799 | Lisp_Object current_window; | 5799 | Lisp_Object current_window; |
| 5800 | Lisp_Object current_buffer; | 5800 | Lisp_Object current_buffer; |
| @@ -5816,7 +5816,7 @@ struct save_window_data | |||
| 5816 | /* This is saved as a Lisp_Vector */ | 5816 | /* This is saved as a Lisp_Vector */ |
| 5817 | struct saved_window | 5817 | struct saved_window |
| 5818 | { | 5818 | { |
| 5819 | struct vector_header header; | 5819 | struct vectorlike_header header; |
| 5820 | Lisp_Object window; | 5820 | Lisp_Object window; |
| 5821 | Lisp_Object buffer, start, pointm, mark; | 5821 | Lisp_Object buffer, start, pointm, mark; |
| 5822 | Lisp_Object left_col, top_line, total_cols, total_lines; | 5822 | Lisp_Object left_col, top_line, total_cols, total_lines; |
diff --git a/src/window.h b/src/window.h index bdbe0e71cc7..b1f6560445e 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -89,7 +89,7 @@ struct cursor_pos | |||
| 89 | struct window | 89 | struct window |
| 90 | { | 90 | { |
| 91 | /* This is for Lisp; the terminal code does not refer to it. */ | 91 | /* This is for Lisp; the terminal code does not refer to it. */ |
| 92 | struct vector_header header; | 92 | struct vectorlike_header header; |
| 93 | 93 | ||
| 94 | /* The frame this window is on. */ | 94 | /* The frame this window is on. */ |
| 95 | Lisp_Object frame; | 95 | Lisp_Object frame; |