summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-04-25 12:40:22 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-04-25 12:40:22 -0700
commitb102ceb110a9cd38f5c589c1869747b1e1c792cb (patch)
tree458a66a2672f2f68a9de09539cbf273edf2bf870
parent179dade40292e5bdccdd4ab88748a06a94307570 (diff)
downloademacs-b102ceb110a9cd38f5c589c1869747b1e1c792cb.tar.gz
* 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.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/buffer.h2
-rw-r--r--src/font.h6
-rw-r--r--src/frame.h2
-rw-r--r--src/lisp.h21
-rw-r--r--src/process.h2
-rw-r--r--src/termhooks.h2
-rw-r--r--src/window.c4
-rw-r--r--src/window.h2
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 @@
2011-04-25 Paul Eggert <eggert@cs.ucla.edu>
+ * 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.
+
lisp.h: Fix a problem with aliasing and vector headers.
GCC 4.6.0 optimizes based on type-based alias analysis. For
example, if b is of type struct buffer * and v of type struct
@@ -33,6 +38,7 @@
object, to help avoid aliasing.
(PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
(SUBRP): Likewise, since Lisp_Subr is a special case.
+
* lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
(struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
(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
collect killed buffers properly.
Note that vectors and most pseudovectors are all on one chain,
but buffers are on a separate chain of their own. */
- struct vector_header header;
+ struct vectorlike_header header;
/* This structure holds the coordinates of the buffer contents
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;
struct font_spec
{
- struct vector_header header;
+ struct vectorlike_header header;
Lisp_Object props[FONT_SPEC_MAX];
};
@@ -262,7 +262,7 @@ struct font_spec
struct font_entity
{
- struct vector_header header;
+ struct vectorlike_header header;
Lisp_Object props[FONT_ENTITY_MAX];
};
@@ -275,7 +275,7 @@ struct font_entity
struct font
{
- struct vector_header header;
+ struct vectorlike_header header;
/* All Lisp_Object components must come first.
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;
struct frame
{
- struct vector_header header;
+ struct vectorlike_header header;
/* All Lisp_Object components must come first.
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);
/* Extract the size field of a vector or vector-like object. */
#define XVECTOR_SIZE(a) (XVECTOR (a)->header.size + 0)
-#define XVECTOR_HEADER_SIZE(a) (((struct vector_header *) XPNTR (a))->size + 0)
+#define XVECTORLIKE_HEADER_SIZE(a) \
+ (((struct vectorlike_header *) XPNTR (a))->size + 0)
/* Misc types. */
@@ -612,7 +613,7 @@ extern Lisp_Object make_number (EMACS_INT);
#define XSETPVECTYPESIZE(v, code, sizeval) \
((v)->header.size = PSEUDOVECTOR_FLAG | (code) | (sizeval))
#define XSETPSEUDOVECTOR(a, b, code) \
- XSETTYPED_PSEUDOVECTOR(a, b, XVECTOR_HEADER_SIZE (a), code)
+ XSETTYPED_PSEUDOVECTOR(a, b, XVECTORLIKE_HEADER_SIZE (a), code)
#define XSETTYPED_PSEUDOVECTOR(a, b, size, code) \
(XSETVECTOR (a, b), \
eassert ((size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \
@@ -793,7 +794,7 @@ struct Lisp_String
/* Header of vector-like objects. This type documents the constraints on
layout of vectors and pseudovectors, and helps optimizing compilers not get
fooled by Emacs's type punning. */
-struct vector_header
+struct vectorlike_header
{
EMACS_UINT size;
union {
@@ -804,7 +805,7 @@ struct vector_header
struct Lisp_Vector
{
- struct vector_header header;
+ struct vectorlike_header header;
Lisp_Object contents[1];
};
@@ -909,7 +910,7 @@ struct Lisp_Char_Table
pseudovector type information. It holds the size, too.
The size counts the defalt, parent, purpose, ascii,
contents, and extras slots. */
- struct vector_header header;
+ struct vectorlike_header header;
/* This holds a default value,
which is used whenever the value for a specific character is nil. */
@@ -938,7 +939,7 @@ struct Lisp_Sub_Char_Table
{
/* HEADER.SIZE is the vector's size field, which also holds the
pseudovector type information. It holds the size, too. */
- struct vector_header header;
+ struct vectorlike_header header;
/* Depth of this sub char-table. It should be 1, 2, or 3. A sub
char-table of depth 1 contains 16 elements, and each element
@@ -959,7 +960,7 @@ struct Lisp_Bool_Vector
{
/* HEADER.SIZE is the vector's size field. It doesn't have the real size,
just the subtype information. */
- struct vector_header header;
+ struct vectorlike_header header;
/* This is the size in bits. */
EMACS_UINT size;
/* This contains the actual bits, packed into bytes. */
@@ -972,7 +973,7 @@ struct Lisp_Bool_Vector
This type is treated in most respects as a pseudovector,
but since we never dynamically allocate or free them,
- we don't need a struct vector_header and its 'next' field. */
+ we don't need a struct vectorlike_header and its 'next' field. */
struct Lisp_Subr
{
@@ -1120,7 +1121,7 @@ struct Lisp_Symbol
struct Lisp_Hash_Table
{
/* This is for Lisp; the hash table code does not refer to it. */
- struct vector_header header;
+ struct vectorlike_header header;
/* Function used to compare keys. */
Lisp_Object test;
@@ -1652,7 +1653,7 @@ typedef struct {
/* True if object X is a pseudovector whose code is CODE. */
#define PSEUDOVECTORP(x, code) \
- TYPED_PSEUDOVECTORP(x, vector_header, code)
+ TYPED_PSEUDOVECTORP(x, vectorlike_header, code)
/* True if object X, with internal type struct T *, is a pseudovector whose
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/>. */
struct Lisp_Process
{
- struct vector_header header;
+ struct vectorlike_header header;
/* Name of subprocess terminal. */
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;
struct terminal
{
/* This is for Lisp; the terminal code does not refer to it. */
- struct vector_header header;
+ struct vectorlike_header header;
/* Parameter alist of this terminal. */
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. */)
struct save_window_data
{
- struct vector_header header;
+ struct vectorlike_header header;
Lisp_Object selected_frame;
Lisp_Object current_window;
Lisp_Object current_buffer;
@@ -5816,7 +5816,7 @@ struct save_window_data
/* This is saved as a Lisp_Vector */
struct saved_window
{
- struct vector_header header;
+ struct vectorlike_header header;
Lisp_Object window;
Lisp_Object buffer, start, pointm, mark;
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
struct window
{
/* This is for Lisp; the terminal code does not refer to it. */
- struct vector_header header;
+ struct vectorlike_header header;
/* The frame this window is on. */
Lisp_Object frame;