aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2013-09-24 10:43:20 +0400
committerDmitry Antipov2013-09-24 10:43:20 +0400
commitd6d9cbc15cbebfe466756a7a75601173c15287a2 (patch)
tree2f3e5223e8f8d637dc9c3c152929b879748b7918 /src
parentec7bc82f9c63b6ec533f7489e67b1c1b18d08dd5 (diff)
downloademacs-d6d9cbc15cbebfe466756a7a75601173c15287a2.tar.gz
emacs-d6d9cbc15cbebfe466756a7a75601173c15287a2.zip
Use union for the payload of struct Lisp_Vector.
This helps to avoid a few glitches dictated by C's aliasing rules. * lisp.h (struct Lisp_Vector): Use union for next and contents member. Adjust comment. Change related users. * alloc.c (next_in_free_list, set_next_in_free_list): Remove. Related users changed. * buffer.c, bytecode.c, ccl.c, character.h, chartab.c, composite.c: * composite.h, disptab.h, fns.c, fontset.c, indent.c, keyboard.c: * lread.c, msdos.c, process.c, w32menu.c, window.c, xdisp.c: * xfaces.c, xfont.c, xmenu.c: Related users changed.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog13
-rw-r--r--src/alloc.c48
-rw-r--r--src/buffer.c2
-rw-r--r--src/bytecode.c2
-rw-r--r--src/ccl.c8
-rw-r--r--src/character.h2
-rw-r--r--src/chartab.c4
-rw-r--r--src/composite.c2
-rw-r--r--src/composite.h8
-rw-r--r--src/disptab.h2
-rw-r--r--src/fns.c8
-rw-r--r--src/fontset.c2
-rw-r--r--src/indent.c6
-rw-r--r--src/keyboard.c17
-rw-r--r--src/lisp.h23
-rw-r--r--src/lread.c2
-rw-r--r--src/msdos.c2
-rw-r--r--src/process.c28
-rw-r--r--src/w32menu.c2
-rw-r--r--src/window.c2
-rw-r--r--src/xdisp.c10
-rw-r--r--src/xfaces.c30
-rw-r--r--src/xfont.c2
-rw-r--r--src/xmenu.c4
24 files changed, 116 insertions, 113 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 28b4da176ae..a2eb39e7196 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,18 @@
12013-09-24 Dmitry Antipov <dmantipov@yandex.ru> 12013-09-24 Dmitry Antipov <dmantipov@yandex.ru>
2 2
3 Use union for the payload of struct Lisp_Vector.
4 This helps to avoid a few glitches dictated by C's aliasing rules.
5 * lisp.h (struct Lisp_Vector): Use union for next and
6 contents member. Adjust comment. Change related users.
7 * alloc.c (next_in_free_list, set_next_in_free_list): Remove.
8 Related users changed.
9 * buffer.c, bytecode.c, ccl.c, character.h, chartab.c, composite.c:
10 * composite.h, disptab.h, fns.c, fontset.c, indent.c, keyboard.c:
11 * lread.c, msdos.c, process.c, w32menu.c, window.c, xdisp.c:
12 * xfaces.c, xfont.c, xmenu.c: Related users changed.
13
142013-09-24 Dmitry Antipov <dmantipov@yandex.ru>
15
3 Optimize glyph row clearing and copying routines. 16 Optimize glyph row clearing and copying routines.
4 * dispextern.h (struct glyph_row): Change layout of struct 17 * dispextern.h (struct glyph_row): Change layout of struct
5 glyph_row to help copy_row_except_pointers. Adjust comment. 18 glyph_row to help copy_row_except_pointers. Adjust comment.
diff --git a/src/alloc.c b/src/alloc.c
index e380d66cb1b..ca21ba2469b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2647,22 +2647,6 @@ verify (VECTOR_BLOCK_SIZE <= (1 << PSEUDOVECTOR_SIZE_BITS));
2647 2647
2648#define VINDEX(nbytes) (((nbytes) - VBLOCK_BYTES_MIN) / roundup_size) 2648#define VINDEX(nbytes) (((nbytes) - VBLOCK_BYTES_MIN) / roundup_size)
2649 2649
2650/* Get and set the next field in block-allocated vectorlike objects on
2651 the free list. Doing it this way respects C's aliasing rules.
2652 We could instead make 'contents' a union, but that would mean
2653 changes everywhere that the code uses 'contents'. */
2654static struct Lisp_Vector *
2655next_in_free_list (struct Lisp_Vector *v)
2656{
2657 intptr_t i = XLI (v->contents[0]);
2658 return (struct Lisp_Vector *) i;
2659}
2660static void
2661set_next_in_free_list (struct Lisp_Vector *v, struct Lisp_Vector *next)
2662{
2663 v->contents[0] = XIL ((intptr_t) next);
2664}
2665
2666/* Common shortcut to setup vector on a free list. */ 2650/* Common shortcut to setup vector on a free list. */
2667 2651
2668#define SETUP_ON_FREE_LIST(v, nbytes, tmp) \ 2652#define SETUP_ON_FREE_LIST(v, nbytes, tmp) \
@@ -2672,7 +2656,7 @@ set_next_in_free_list (struct Lisp_Vector *v, struct Lisp_Vector *next)
2672 eassert ((nbytes) % roundup_size == 0); \ 2656 eassert ((nbytes) % roundup_size == 0); \
2673 (tmp) = VINDEX (nbytes); \ 2657 (tmp) = VINDEX (nbytes); \
2674 eassert ((tmp) < VECTOR_MAX_FREE_LIST_INDEX); \ 2658 eassert ((tmp) < VECTOR_MAX_FREE_LIST_INDEX); \
2675 set_next_in_free_list (v, vector_free_lists[tmp]); \ 2659 v->u.next = vector_free_lists[tmp]; \
2676 vector_free_lists[tmp] = (v); \ 2660 vector_free_lists[tmp] = (v); \
2677 total_free_vector_slots += (nbytes) / word_size; \ 2661 total_free_vector_slots += (nbytes) / word_size; \
2678 } while (0) 2662 } while (0)
@@ -2769,7 +2753,7 @@ allocate_vector_from_block (size_t nbytes)
2769 if (vector_free_lists[index]) 2753 if (vector_free_lists[index])
2770 { 2754 {
2771 vector = vector_free_lists[index]; 2755 vector = vector_free_lists[index];
2772 vector_free_lists[index] = next_in_free_list (vector); 2756 vector_free_lists[index] = vector->u.next;
2773 total_free_vector_slots -= nbytes / word_size; 2757 total_free_vector_slots -= nbytes / word_size;
2774 return vector; 2758 return vector;
2775 } 2759 }
@@ -2783,7 +2767,7 @@ allocate_vector_from_block (size_t nbytes)
2783 { 2767 {
2784 /* This vector is larger than requested. */ 2768 /* This vector is larger than requested. */
2785 vector = vector_free_lists[index]; 2769 vector = vector_free_lists[index];
2786 vector_free_lists[index] = next_in_free_list (vector); 2770 vector_free_lists[index] = vector->u.next;
2787 total_free_vector_slots -= nbytes / word_size; 2771 total_free_vector_slots -= nbytes / word_size;
2788 2772
2789 /* Excess bytes are used for the smaller vector, 2773 /* Excess bytes are used for the smaller vector,
@@ -2981,7 +2965,7 @@ allocate_vectorlike (ptrdiff_t len)
2981 else 2965 else
2982 { 2966 {
2983 struct large_vector *lv 2967 struct large_vector *lv
2984 = lisp_malloc ((offsetof (struct large_vector, v.contents) 2968 = lisp_malloc ((offsetof (struct large_vector, v.u.contents)
2985 + len * word_size), 2969 + len * word_size),
2986 MEM_TYPE_VECTORLIKE); 2970 MEM_TYPE_VECTORLIKE);
2987 lv->next.vector = large_vectors; 2971 lv->next.vector = large_vectors;
@@ -3035,7 +3019,7 @@ allocate_pseudovector (int memlen, int lisplen, enum pvec_type tag)
3035 3019
3036 /* Only the first lisplen slots will be traced normally by the GC. */ 3020 /* Only the first lisplen slots will be traced normally by the GC. */
3037 for (i = 0; i < lisplen; ++i) 3021 for (i = 0; i < lisplen; ++i)
3038 v->contents[i] = Qnil; 3022 v->u.contents[i] = Qnil;
3039 3023
3040 XSETPVECTYPESIZE (v, tag, lisplen, memlen - lisplen); 3024 XSETPVECTYPESIZE (v, tag, lisplen, memlen - lisplen);
3041 return v; 3025 return v;
@@ -3123,7 +3107,7 @@ See also the function `vector'. */)
3123 p = allocate_vector (XFASTINT (length)); 3107 p = allocate_vector (XFASTINT (length));
3124 sizei = XFASTINT (length); 3108 sizei = XFASTINT (length);
3125 for (i = 0; i < sizei; i++) 3109 for (i = 0; i < sizei; i++)
3126 p->contents[i] = init; 3110 p->u.contents[i] = init;
3127 3111
3128 XSETVECTOR (vector, p); 3112 XSETVECTOR (vector, p);
3129 return vector; 3113 return vector;
@@ -3141,21 +3125,21 @@ usage: (vector &rest OBJECTS) */)
3141 register struct Lisp_Vector *p = XVECTOR (val); 3125 register struct Lisp_Vector *p = XVECTOR (val);
3142 3126
3143 for (i = 0; i < nargs; i++) 3127 for (i = 0; i < nargs; i++)
3144 p->contents[i] = args[i]; 3128 p->u.contents[i] = args[i];
3145 return val; 3129 return val;
3146} 3130}
3147 3131
3148void 3132void
3149make_byte_code (struct Lisp_Vector *v) 3133make_byte_code (struct Lisp_Vector *v)
3150{ 3134{
3151 if (v->header.size > 1 && STRINGP (v->contents[1]) 3135 if (v->header.size > 1 && STRINGP (v->u.contents[1])
3152 && STRING_MULTIBYTE (v->contents[1])) 3136 && STRING_MULTIBYTE (v->u.contents[1]))
3153 /* BYTECODE-STRING must have been produced by Emacs 20.2 or the 3137 /* BYTECODE-STRING must have been produced by Emacs 20.2 or the
3154 earlier because they produced a raw 8-bit string for byte-code 3138 earlier because they produced a raw 8-bit string for byte-code
3155 and now such a byte-code string is loaded as multibyte while 3139 and now such a byte-code string is loaded as multibyte while
3156 raw 8-bit characters converted to multibyte form. Thus, now we 3140 raw 8-bit characters converted to multibyte form. Thus, now we
3157 must convert them back to the original unibyte form. */ 3141 must convert them back to the original unibyte form. */
3158 v->contents[1] = Fstring_as_unibyte (v->contents[1]); 3142 v->u.contents[1] = Fstring_as_unibyte (v->u.contents[1]);
3159 XSETPVECTYPE (v, PVEC_COMPILED); 3143 XSETPVECTYPE (v, PVEC_COMPILED);
3160} 3144}
3161 3145
@@ -3190,7 +3174,7 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT
3190 to be setcar'd). */ 3174 to be setcar'd). */
3191 3175
3192 for (i = 0; i < nargs; i++) 3176 for (i = 0; i < nargs; i++)
3193 p->contents[i] = args[i]; 3177 p->u.contents[i] = args[i];
3194 make_byte_code (p); 3178 make_byte_code (p);
3195 XSETCOMPILED (val, p); 3179 XSETCOMPILED (val, p);
3196 return val; 3180 return val;
@@ -5183,7 +5167,7 @@ Does not copy symbols. Copies strings without text properties. */)
5183 size &= PSEUDOVECTOR_SIZE_MASK; 5167 size &= PSEUDOVECTOR_SIZE_MASK;
5184 vec = XVECTOR (make_pure_vector (size)); 5168 vec = XVECTOR (make_pure_vector (size));
5185 for (i = 0; i < size; i++) 5169 for (i = 0; i < size; i++)
5186 vec->contents[i] = Fpurecopy (AREF (obj, i)); 5170 vec->u.contents[i] = Fpurecopy (AREF (obj, i));
5187 if (COMPILEDP (obj)) 5171 if (COMPILEDP (obj))
5188 { 5172 {
5189 XSETPVECTYPE (vec, PVEC_COMPILED); 5173 XSETPVECTYPE (vec, PVEC_COMPILED);
@@ -5674,7 +5658,7 @@ mark_vectorlike (struct Lisp_Vector *ptr)
5674 The distinction is used e.g. by Lisp_Process which places extra 5658 The distinction is used e.g. by Lisp_Process which places extra
5675 non-Lisp_Object fields at the end of the structure... */ 5659 non-Lisp_Object fields at the end of the structure... */
5676 for (i = 0; i < size; i++) /* ...and then mark its elements. */ 5660 for (i = 0; i < size; i++) /* ...and then mark its elements. */
5677 mark_object (ptr->contents[i]); 5661 mark_object (ptr->u.contents[i]);
5678} 5662}
5679 5663
5680/* Like mark_vectorlike but optimized for char-tables (and 5664/* Like mark_vectorlike but optimized for char-tables (and
@@ -5691,7 +5675,7 @@ mark_char_table (struct Lisp_Vector *ptr)
5691 VECTOR_MARK (ptr); 5675 VECTOR_MARK (ptr);
5692 for (i = 0; i < size; i++) 5676 for (i = 0; i < size; i++)
5693 { 5677 {
5694 Lisp_Object val = ptr->contents[i]; 5678 Lisp_Object val = ptr->u.contents[i];
5695 5679
5696 if (INTEGERP (val) || (SYMBOLP (val) && XSYMBOL (val)->gcmarkbit)) 5680 if (INTEGERP (val) || (SYMBOLP (val) && XSYMBOL (val)->gcmarkbit))
5697 continue; 5681 continue;
@@ -5896,10 +5880,10 @@ mark_object (Lisp_Object arg)
5896 VECTOR_MARK (ptr); 5880 VECTOR_MARK (ptr);
5897 for (i = 0; i < size; i++) 5881 for (i = 0; i < size; i++)
5898 if (i != COMPILED_CONSTANTS) 5882 if (i != COMPILED_CONSTANTS)
5899 mark_object (ptr->contents[i]); 5883 mark_object (ptr->u.contents[i]);
5900 if (size > COMPILED_CONSTANTS) 5884 if (size > COMPILED_CONSTANTS)
5901 { 5885 {
5902 obj = ptr->contents[COMPILED_CONSTANTS]; 5886 obj = ptr->u.contents[COMPILED_CONSTANTS];
5903 goto loop; 5887 goto loop;
5904 } 5888 }
5905 } 5889 }
diff --git a/src/buffer.c b/src/buffer.c
index 815f3926c55..1570f3831ac 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4534,7 +4534,7 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after,
4534 Lisp_Object *copy = alloca (size * sizeof *copy); 4534 Lisp_Object *copy = alloca (size * sizeof *copy);
4535 ptrdiff_t i; 4535 ptrdiff_t i;
4536 4536
4537 memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents, 4537 memcpy (copy, XVECTOR (last_overlay_modification_hooks)->u.contents,
4538 size * word_size); 4538 size * word_size);
4539 gcpro1.var = copy; 4539 gcpro1.var = copy;
4540 gcpro1.nvars = size; 4540 gcpro1.nvars = size;
diff --git a/src/bytecode.c b/src/bytecode.c
index 3ac8b452fbe..23e50826633 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -536,7 +536,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
536#ifdef BYTE_CODE_SAFE 536#ifdef BYTE_CODE_SAFE
537 bytestr_length = SBYTES (bytestr); 537 bytestr_length = SBYTES (bytestr);
538#endif 538#endif
539 vectorp = XVECTOR (vector)->contents; 539 vectorp = XVECTOR (vector)->u.contents;
540 540
541 stack.byte_string = bytestr; 541 stack.byte_string = bytestr;
542 stack.pc = stack.byte_string_start = SDATA (bytestr); 542 stack.pc = stack.byte_string_start = SDATA (bytestr);
diff --git a/src/ccl.c b/src/ccl.c
index 8fec18296a6..d1783c25718 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1094,7 +1094,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size
1094 ccl_prog_stack_struct[stack_idx].ic = ic; 1094 ccl_prog_stack_struct[stack_idx].ic = ic;
1095 ccl_prog_stack_struct[stack_idx].eof_ic = eof_ic; 1095 ccl_prog_stack_struct[stack_idx].eof_ic = eof_ic;
1096 stack_idx++; 1096 stack_idx++;
1097 ccl_prog = XVECTOR (AREF (slot, 1))->contents; 1097 ccl_prog = XVECTOR (AREF (slot, 1))->u.contents;
1098 ic = CCL_HEADER_MAIN; 1098 ic = CCL_HEADER_MAIN;
1099 eof_ic = XFASTINT (ccl_prog[CCL_HEADER_EOF]); 1099 eof_ic = XFASTINT (ccl_prog[CCL_HEADER_EOF]);
1100 } 1100 }
@@ -1936,9 +1936,9 @@ setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog)
1936 return -1; 1936 return -1;
1937 vp = XVECTOR (ccl_prog); 1937 vp = XVECTOR (ccl_prog);
1938 ccl->size = vp->header.size; 1938 ccl->size = vp->header.size;
1939 ccl->prog = vp->contents; 1939 ccl->prog = vp->u.contents;
1940 ccl->eof_ic = XINT (vp->contents[CCL_HEADER_EOF]); 1940 ccl->eof_ic = XINT (vp->u.contents[CCL_HEADER_EOF]);
1941 ccl->buf_magnification = XINT (vp->contents[CCL_HEADER_BUF_MAG]); 1941 ccl->buf_magnification = XINT (vp->u.contents[CCL_HEADER_BUF_MAG]);
1942 if (ccl->idx >= 0) 1942 if (ccl->idx >= 0)
1943 { 1943 {
1944 Lisp_Object slot; 1944 Lisp_Object slot;
diff --git a/src/character.h b/src/character.h
index cb03cb39947..d1b781caa53 100644
--- a/src/character.h
+++ b/src/character.h
@@ -677,7 +677,7 @@ extern Lisp_Object string_escape_byte8 (Lisp_Object);
677 677
678/* Return a translation table of id number ID. */ 678/* Return a translation table of id number ID. */
679#define GET_TRANSLATION_TABLE(id) \ 679#define GET_TRANSLATION_TABLE(id) \
680 (XCDR(XVECTOR(Vtranslation_table_vector)->contents[(id)])) 680 (XCDR (XVECTOR (Vtranslation_table_vector)->u.contents[(id)]))
681 681
682INLINE_HEADER_END 682INLINE_HEADER_END
683 683
diff --git a/src/chartab.c b/src/chartab.c
index b7b9590a538..089c4254da6 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -1258,7 +1258,7 @@ uniprop_encode_value_character (Lisp_Object table, Lisp_Object value)
1258static Lisp_Object 1258static Lisp_Object
1259uniprop_encode_value_run_length (Lisp_Object table, Lisp_Object value) 1259uniprop_encode_value_run_length (Lisp_Object table, Lisp_Object value)
1260{ 1260{
1261 Lisp_Object *value_table = XVECTOR (XCHAR_TABLE (table)->extras[4])->contents; 1261 Lisp_Object *value_table = XVECTOR (XCHAR_TABLE (table)->extras[4])->u.contents;
1262 int i, size = ASIZE (XCHAR_TABLE (table)->extras[4]); 1262 int i, size = ASIZE (XCHAR_TABLE (table)->extras[4]);
1263 1263
1264 for (i = 0; i < size; i++) 1264 for (i = 0; i < size; i++)
@@ -1276,7 +1276,7 @@ uniprop_encode_value_run_length (Lisp_Object table, Lisp_Object value)
1276static Lisp_Object 1276static Lisp_Object
1277uniprop_encode_value_numeric (Lisp_Object table, Lisp_Object value) 1277uniprop_encode_value_numeric (Lisp_Object table, Lisp_Object value)
1278{ 1278{
1279 Lisp_Object *value_table = XVECTOR (XCHAR_TABLE (table)->extras[4])->contents; 1279 Lisp_Object *value_table = XVECTOR (XCHAR_TABLE (table)->extras[4])->u.contents;
1280 int i, size = ASIZE (XCHAR_TABLE (table)->extras[4]); 1280 int i, size = ASIZE (XCHAR_TABLE (table)->extras[4]);
1281 1281
1282 CHECK_NUMBER (value); 1282 CHECK_NUMBER (value);
diff --git a/src/composite.c b/src/composite.c
index 47cac715086..4f125522e38 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -266,7 +266,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars,
266 composition_table = xpalloc (composition_table, &composition_table_size, 266 composition_table = xpalloc (composition_table, &composition_table_size,
267 1, -1, sizeof *composition_table); 267 1, -1, sizeof *composition_table);
268 268
269 key_contents = XVECTOR (key)->contents; 269 key_contents = XVECTOR (key)->u.contents;
270 270
271 /* Check if the contents of COMPONENTS are valid if COMPONENTS is a 271 /* Check if the contents of COMPONENTS are valid if COMPONENTS is a
272 vector or a list. It should be a sequence of: 272 vector or a list. It should be a sequence of:
diff --git a/src/composite.h b/src/composite.h
index 9026d03f7b6..b3ea5cd1ed8 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -88,8 +88,8 @@ composition_registered_p (Lisp_Object prop)
88#define COMPOSITION_GLYPH(cmp, n) \ 88#define COMPOSITION_GLYPH(cmp, n) \
89 XINT (XVECTOR (XVECTOR (XHASH_TABLE (composition_hash_table) \ 89 XINT (XVECTOR (XVECTOR (XHASH_TABLE (composition_hash_table) \
90 ->key_and_value) \ 90 ->key_and_value) \
91 ->contents[cmp->hash_index * 2]) \ 91 ->u.contents[cmp->hash_index * 2]) \
92 ->contents[cmp->method == COMPOSITION_WITH_RULE_ALTCHARS \ 92 ->u.contents[cmp->method == COMPOSITION_WITH_RULE_ALTCHARS \
93 ? (n) * 2 : (n)]) 93 ? (n) * 2 : (n)])
94 94
95/* Return the encoded composition rule to compose the Nth glyph of 95/* Return the encoded composition rule to compose the Nth glyph of
@@ -98,8 +98,8 @@ composition_registered_p (Lisp_Object prop)
98#define COMPOSITION_RULE(cmp, n) \ 98#define COMPOSITION_RULE(cmp, n) \
99 XINT (XVECTOR (XVECTOR (XHASH_TABLE (composition_hash_table) \ 99 XINT (XVECTOR (XVECTOR (XHASH_TABLE (composition_hash_table) \
100 ->key_and_value) \ 100 ->key_and_value) \
101 ->contents[cmp->hash_index * 2]) \ 101 ->u.contents[cmp->hash_index * 2]) \
102 ->contents[(n) * 2 - 1]) 102 ->u.contents[(n) * 2 - 1])
103 103
104/* Decode encoded composition rule RULE_CODE into GREF (global 104/* Decode encoded composition rule RULE_CODE into GREF (global
105 reference point code), NREF (new ref. point code). Don't check RULE_CODE; 105 reference point code), NREF (new ref. point code). Don't check RULE_CODE;
diff --git a/src/disptab.h b/src/disptab.h
index e02bab04bbc..87dc5a22a68 100644
--- a/src/disptab.h
+++ b/src/disptab.h
@@ -59,7 +59,7 @@ extern Lisp_Object Qdisplay_table;
59/* Return the current base (for indexing) of the GLYPH table, 59/* Return the current base (for indexing) of the GLYPH table,
60 or 0 if the table isn't currently valid. */ 60 or 0 if the table isn't currently valid. */
61#define GLYPH_TABLE_BASE \ 61#define GLYPH_TABLE_BASE \
62 ((VECTORP (Vglyph_table)) ? XVECTOR (Vglyph_table)->contents : 0) 62 ((VECTORP (Vglyph_table)) ? XVECTOR (Vglyph_table)->u.contents : 0)
63 63
64/* Given BASE and LEN returned by the two previous macros, 64/* Given BASE and LEN returned by the two previous macros,
65 return nonzero if the GLYPH code G should be output as a single 65 return nonzero if the GLYPH code G should be output as a single
diff --git a/src/fns.c b/src/fns.c
index de90fd731fb..e4618919640 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1604,7 +1604,7 @@ changing the value of a sequence `foo'. */)
1604 1604
1605 for (i = n = 0; i < ASIZE (seq); ++i) 1605 for (i = n = 0; i < ASIZE (seq); ++i)
1606 if (NILP (Fequal (AREF (seq, i), elt))) 1606 if (NILP (Fequal (AREF (seq, i), elt)))
1607 p->contents[n++] = AREF (seq, i); 1607 p->u.contents[n++] = AREF (seq, i);
1608 1608
1609 XSETVECTOR (seq, p); 1609 XSETVECTOR (seq, p);
1610 } 1610 }
@@ -3450,7 +3450,7 @@ larger_vector (Lisp_Object vec, ptrdiff_t incr_min, ptrdiff_t nitems_max)
3450{ 3450{
3451 struct Lisp_Vector *v; 3451 struct Lisp_Vector *v;
3452 ptrdiff_t i, incr, incr_max, old_size, new_size; 3452 ptrdiff_t i, incr, incr_max, old_size, new_size;
3453 ptrdiff_t C_language_max = min (PTRDIFF_MAX, SIZE_MAX) / sizeof *v->contents; 3453 ptrdiff_t C_language_max = min (PTRDIFF_MAX, SIZE_MAX) / sizeof *v->u.contents;
3454 ptrdiff_t n_max = (0 <= nitems_max && nitems_max < C_language_max 3454 ptrdiff_t n_max = (0 <= nitems_max && nitems_max < C_language_max
3455 ? nitems_max : C_language_max); 3455 ? nitems_max : C_language_max);
3456 eassert (VECTORP (vec)); 3456 eassert (VECTORP (vec));
@@ -3462,9 +3462,9 @@ larger_vector (Lisp_Object vec, ptrdiff_t incr_min, ptrdiff_t nitems_max)
3462 memory_full (SIZE_MAX); 3462 memory_full (SIZE_MAX);
3463 new_size = old_size + incr; 3463 new_size = old_size + incr;
3464 v = allocate_vector (new_size); 3464 v = allocate_vector (new_size);
3465 memcpy (v->contents, XVECTOR (vec)->contents, old_size * sizeof *v->contents); 3465 memcpy (v->u.contents, XVECTOR (vec)->u.contents, old_size * sizeof *v->u.contents);
3466 for (i = old_size; i < new_size; ++i) 3466 for (i = old_size; i < new_size; ++i)
3467 v->contents[i] = Qnil; 3467 v->u.contents[i] = Qnil;
3468 XSETVECTOR (vec, v); 3468 XSETVECTOR (vec, v);
3469 return vec; 3469 return vec;
3470} 3470}
diff --git a/src/fontset.c b/src/fontset.c
index 797d51ac0a7..15fdf9f41a0 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -453,7 +453,7 @@ reorder_font_vector (Lisp_Object font_group, struct font *font)
453 } 453 }
454 454
455 if (score_changed) 455 if (score_changed)
456 qsort (XVECTOR (vec)->contents, size, word_size, 456 qsort (XVECTOR (vec)->u.contents, size, word_size,
457 fontset_compare_rfontdef); 457 fontset_compare_rfontdef);
458 XSETCAR (font_group, make_number (charset_ordered_list_tick)); 458 XSETCAR (font_group, make_number (charset_ordered_list_tick));
459} 459}
diff --git a/src/indent.c b/src/indent.c
index 891b42788ed..d956e627ba9 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -118,7 +118,7 @@ disptab_matches_widthtab (struct Lisp_Char_Table *disptab, struct Lisp_Vector *w
118 118
119 for (i = 0; i < 256; i++) 119 for (i = 0; i < 256; i++)
120 if (character_width (i, disptab) 120 if (character_width (i, disptab)
121 != XFASTINT (widthtab->contents[i])) 121 != XFASTINT (widthtab->u.contents[i]))
122 return 0; 122 return 0;
123 123
124 return 1; 124 return 1;
@@ -138,7 +138,7 @@ recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab)
138 eassert (widthtab->header.size == 256); 138 eassert (widthtab->header.size == 256);
139 139
140 for (i = 0; i < 256; i++) 140 for (i = 0; i < 256; i++)
141 XSETFASTINT (widthtab->contents[i], character_width (i, disptab)); 141 XSETFASTINT (widthtab->u.contents[i], character_width (i, disptab));
142} 142}
143 143
144/* Allocate or free the width run cache, as requested by the 144/* Allocate or free the width run cache, as requested by the
@@ -1136,7 +1136,7 @@ compute_motion (ptrdiff_t from, ptrdiff_t frombyte, EMACS_INT fromvpos,
1136 width_run_cache_on_off (); 1136 width_run_cache_on_off ();
1137 if (dp == buffer_display_table ()) 1137 if (dp == buffer_display_table ())
1138 width_table = (VECTORP (BVAR (current_buffer, width_table)) 1138 width_table = (VECTORP (BVAR (current_buffer, width_table))
1139 ? XVECTOR (BVAR (current_buffer, width_table))->contents 1139 ? XVECTOR (BVAR (current_buffer, width_table))->u.contents
1140 : 0); 1140 : 0);
1141 else 1141 else
1142 /* If the window has its own display table, we can't use the width 1142 /* If the window has its own display table, we can't use the width
diff --git a/src/keyboard.c b/src/keyboard.c
index 201b9ec8f5b..05efe7c1312 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4341,7 +4341,7 @@ decode_timer (Lisp_Object timer, struct timespec *result)
4341 4341
4342 if (! (VECTORP (timer) && ASIZE (timer) == 9)) 4342 if (! (VECTORP (timer) && ASIZE (timer) == 9))
4343 return 0; 4343 return 0;
4344 vector = XVECTOR (timer)->contents; 4344 vector = XVECTOR (timer)->u.contents;
4345 if (! NILP (vector[0])) 4345 if (! NILP (vector[0]))
4346 return 0; 4346 return 0;
4347 4347
@@ -7998,7 +7998,7 @@ process_tool_bar_item (Lisp_Object key, Lisp_Object def, Lisp_Object data, void
7998 discard any previously made item. */ 7998 discard any previously made item. */
7999 for (i = 0; i < ntool_bar_items; i += TOOL_BAR_ITEM_NSLOTS) 7999 for (i = 0; i < ntool_bar_items; i += TOOL_BAR_ITEM_NSLOTS)
8000 { 8000 {
8001 Lisp_Object *v = XVECTOR (tool_bar_items_vector)->contents + i; 8001 Lisp_Object *v = XVECTOR (tool_bar_items_vector)->u.contents + i;
8002 8002
8003 if (EQ (key, v[TOOL_BAR_ITEM_KEY])) 8003 if (EQ (key, v[TOOL_BAR_ITEM_KEY]))
8004 { 8004 {
@@ -8322,7 +8322,7 @@ append_tool_bar_item (void)
8322 /* Append entries from tool_bar_item_properties to the end of 8322 /* Append entries from tool_bar_item_properties to the end of
8323 tool_bar_items_vector. */ 8323 tool_bar_items_vector. */
8324 vcopy (tool_bar_items_vector, ntool_bar_items, 8324 vcopy (tool_bar_items_vector, ntool_bar_items,
8325 XVECTOR (tool_bar_item_properties)->contents, TOOL_BAR_ITEM_NSLOTS); 8325 XVECTOR (tool_bar_item_properties)->u.contents, TOOL_BAR_ITEM_NSLOTS);
8326 ntool_bar_items += TOOL_BAR_ITEM_NSLOTS; 8326 ntool_bar_items += TOOL_BAR_ITEM_NSLOTS;
8327} 8327}
8328 8328
@@ -9919,7 +9919,7 @@ DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0,
9919 doc: /* Return vector of last 300 events, not counting those from keyboard macros. */) 9919 doc: /* Return vector of last 300 events, not counting those from keyboard macros. */)
9920 (void) 9920 (void)
9921{ 9921{
9922 Lisp_Object *keys = XVECTOR (recent_keys)->contents; 9922 Lisp_Object *keys = XVECTOR (recent_keys)->u.contents;
9923 Lisp_Object val; 9923 Lisp_Object val;
9924 9924
9925 if (total_keys < NUM_RECENT_KEYS) 9925 if (total_keys < NUM_RECENT_KEYS)
@@ -9945,7 +9945,7 @@ See also `this-command-keys-vector'. */)
9945 (void) 9945 (void)
9946{ 9946{
9947 return make_event_array (this_command_key_count, 9947 return make_event_array (this_command_key_count,
9948 XVECTOR (this_command_keys)->contents); 9948 XVECTOR (this_command_keys)->u.contents);
9949} 9949}
9950 9950
9951DEFUN ("this-command-keys-vector", Fthis_command_keys_vector, Sthis_command_keys_vector, 0, 0, 0, 9951DEFUN ("this-command-keys-vector", Fthis_command_keys_vector, Sthis_command_keys_vector, 0, 0, 0,
@@ -9957,7 +9957,7 @@ See also `this-command-keys'. */)
9957 (void) 9957 (void)
9958{ 9958{
9959 return Fvector (this_command_key_count, 9959 return Fvector (this_command_key_count,
9960 XVECTOR (this_command_keys)->contents); 9960 XVECTOR (this_command_keys)->u.contents);
9961} 9961}
9962 9962
9963DEFUN ("this-single-command-keys", Fthis_single_command_keys, 9963DEFUN ("this-single-command-keys", Fthis_single_command_keys,
@@ -9972,7 +9972,7 @@ The value is always a vector. */)
9972{ 9972{
9973 return Fvector (this_command_key_count 9973 return Fvector (this_command_key_count
9974 - this_single_command_key_start, 9974 - this_single_command_key_start,
9975 (XVECTOR (this_command_keys)->contents 9975 (XVECTOR (this_command_keys)->u.contents
9976 + this_single_command_key_start)); 9976 + this_single_command_key_start));
9977} 9977}
9978 9978
@@ -9986,8 +9986,7 @@ shows the events before all translations (except for input methods).
9986The value is always a vector. */) 9986The value is always a vector. */)
9987 (void) 9987 (void)
9988{ 9988{
9989 return Fvector (raw_keybuf_count, 9989 return Fvector (raw_keybuf_count, XVECTOR (raw_keybuf)->u.contents);
9990 (XVECTOR (raw_keybuf)->contents));
9991} 9990}
9992 9991
9993DEFUN ("reset-this-command-lengths", Freset_this_command_lengths, 9992DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,
diff --git a/src/lisp.h b/src/lisp.h
index f49a2042b1b..63597e86be6 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1136,12 +1136,19 @@ struct vectorlike_header
1136 ptrdiff_t size; 1136 ptrdiff_t size;
1137 }; 1137 };
1138 1138
1139/* Regular vector is just a header plus array of Lisp_Objects. */ 1139/* Regular vector is just a header plus array of Lisp_Objects... */
1140 1140
1141struct Lisp_Vector 1141struct Lisp_Vector
1142 { 1142 {
1143 struct vectorlike_header header; 1143 struct vectorlike_header header;
1144 Lisp_Object contents[FLEXIBLE_ARRAY_MEMBER]; 1144 union {
1145 /* ...but sometimes there is also a pointer internally used in
1146 vector allocation code. Usually you don't want to touch this. */
1147 struct Lisp_Vector *next;
1148
1149 /* We can't use FLEXIBLE_ARRAY_MEMBER here. */
1150 Lisp_Object contents[1];
1151 } u;
1145 }; 1152 };
1146 1153
1147/* A boolvector is a kind of vectorlike, with contents are like a string. */ 1154/* A boolvector is a kind of vectorlike, with contents are like a string. */
@@ -1162,7 +1169,7 @@ struct Lisp_Bool_Vector
1162 1169
1163enum 1170enum
1164 { 1171 {
1165 header_size = offsetof (struct Lisp_Vector, contents), 1172 header_size = offsetof (struct Lisp_Vector, u.contents),
1166 bool_header_size = offsetof (struct Lisp_Bool_Vector, data), 1173 bool_header_size = offsetof (struct Lisp_Bool_Vector, data),
1167 word_size = sizeof (Lisp_Object) 1174 word_size = sizeof (Lisp_Object)
1168 }; 1175 };
@@ -1172,13 +1179,13 @@ enum
1172INLINE Lisp_Object 1179INLINE Lisp_Object
1173AREF (Lisp_Object array, ptrdiff_t idx) 1180AREF (Lisp_Object array, ptrdiff_t idx)
1174{ 1181{
1175 return XVECTOR (array)->contents[idx]; 1182 return XVECTOR (array)->u.contents[idx];
1176} 1183}
1177 1184
1178INLINE Lisp_Object * 1185INLINE Lisp_Object *
1179aref_addr (Lisp_Object array, ptrdiff_t idx) 1186aref_addr (Lisp_Object array, ptrdiff_t idx)
1180{ 1187{
1181 return & XVECTOR (array)->contents[idx]; 1188 return & XVECTOR (array)->u.contents[idx];
1182} 1189}
1183 1190
1184INLINE ptrdiff_t 1191INLINE ptrdiff_t
@@ -1191,7 +1198,7 @@ INLINE void
1191ASET (Lisp_Object array, ptrdiff_t idx, Lisp_Object val) 1198ASET (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
1192{ 1199{
1193 eassert (0 <= idx && idx < ASIZE (array)); 1200 eassert (0 <= idx && idx < ASIZE (array));
1194 XVECTOR (array)->contents[idx] = val; 1201 XVECTOR (array)->u.contents[idx] = val;
1195} 1202}
1196 1203
1197INLINE void 1204INLINE void
@@ -1200,7 +1207,7 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
1200 /* Like ASET, but also can be used in the garbage collector: 1207 /* Like ASET, but also can be used in the garbage collector:
1201 sweep_weak_table calls set_hash_key etc. while the table is marked. */ 1208 sweep_weak_table calls set_hash_key etc. while the table is marked. */
1202 eassert (0 <= idx && idx < (ASIZE (array) & ~ARRAY_MARK_FLAG)); 1209 eassert (0 <= idx && idx < (ASIZE (array) & ~ARRAY_MARK_FLAG));
1203 XVECTOR (array)->contents[idx] = val; 1210 XVECTOR (array)->u.contents[idx] = val;
1204} 1211}
1205 1212
1206/* If a struct is made to look like a vector, this macro returns the length 1213/* If a struct is made to look like a vector, this macro returns the length
@@ -3028,7 +3035,7 @@ INLINE void
3028vcopy (Lisp_Object v, ptrdiff_t offset, Lisp_Object *args, ptrdiff_t count) 3035vcopy (Lisp_Object v, ptrdiff_t offset, Lisp_Object *args, ptrdiff_t count)
3029{ 3036{
3030 eassert (0 <= offset && 0 <= count && offset + count <= ASIZE (v)); 3037 eassert (0 <= offset && 0 <= count && offset + count <= ASIZE (v));
3031 memcpy (XVECTOR (v)->contents + offset, args, count * sizeof *args); 3038 memcpy (XVECTOR (v)->u.contents + offset, args, count * sizeof *args);
3032} 3039}
3033 3040
3034/* Functions to modify hash tables. */ 3041/* Functions to modify hash tables. */
diff --git a/src/lread.c b/src/lread.c
index 9518631ba6d..017dfcb11a5 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3459,7 +3459,7 @@ read_vector (Lisp_Object readcharfun, bool bytecodeflag)
3459 vector = Fmake_vector (len, Qnil); 3459 vector = Fmake_vector (len, Qnil);
3460 3460
3461 size = ASIZE (vector); 3461 size = ASIZE (vector);
3462 ptr = XVECTOR (vector)->contents; 3462 ptr = XVECTOR (vector)->u.contents;
3463 for (i = 0; i < size; i++) 3463 for (i = 0; i < size; i++)
3464 { 3464 {
3465 item = Fcar (tem); 3465 item = Fcar (tem);
diff --git a/src/msdos.c b/src/msdos.c
index 09aedf837d8..aef75120293 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -2394,7 +2394,7 @@ Each input key receives two values in this vector: first the ASCII code,
2394and then the scan code. */) 2394and then the scan code. */)
2395 (void) 2395 (void)
2396{ 2396{
2397 Lisp_Object val, *keys = XVECTOR (recent_doskeys)->contents; 2397 Lisp_Object val, *keys = XVECTOR (recent_doskeys)->u.contents;
2398 2398
2399 if (total_doskeys < NUM_RECENT_DOSKEYS) 2399 if (total_doskeys < NUM_RECENT_DOSKEYS)
2400 return Fvector (total_doskeys, keys); 2400 return Fvector (total_doskeys, keys);
diff --git a/src/process.c b/src/process.c
index 94f59942a61..fcaa7894779 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1333,15 +1333,15 @@ Returns nil if format of ADDRESS is invalid. */)
1333 1333
1334 for (i = 0; i < nargs; i++) 1334 for (i = 0; i < nargs; i++)
1335 { 1335 {
1336 if (! RANGED_INTEGERP (0, p->contents[i], 65535)) 1336 if (! RANGED_INTEGERP (0, p->u.contents[i], 65535))
1337 return Qnil; 1337 return Qnil;
1338 1338
1339 if (nargs <= 5 /* IPv4 */ 1339 if (nargs <= 5 /* IPv4 */
1340 && i < 4 /* host, not port */ 1340 && i < 4 /* host, not port */
1341 && XINT (p->contents[i]) > 255) 1341 && XINT (p->u.contents[i]) > 255)
1342 return Qnil; 1342 return Qnil;
1343 1343
1344 args[i+1] = p->contents[i]; 1344 args[i+1] = p->u.contents[i];
1345 } 1345 }
1346 1346
1347 return Fformat (nargs+1, args); 1347 return Fformat (nargs+1, args);
@@ -1980,7 +1980,7 @@ conv_sockaddr_to_lisp (struct sockaddr *sa, int len)
1980 len = sizeof (sin->sin_addr) + 1; 1980 len = sizeof (sin->sin_addr) + 1;
1981 address = Fmake_vector (make_number (len), Qnil); 1981 address = Fmake_vector (make_number (len), Qnil);
1982 p = XVECTOR (address); 1982 p = XVECTOR (address);
1983 p->contents[--len] = make_number (ntohs (sin->sin_port)); 1983 p->u.contents[--len] = make_number (ntohs (sin->sin_port));
1984 cp = (unsigned char *) &sin->sin_addr; 1984 cp = (unsigned char *) &sin->sin_addr;
1985 break; 1985 break;
1986 } 1986 }
@@ -1992,9 +1992,9 @@ conv_sockaddr_to_lisp (struct sockaddr *sa, int len)
1992 len = sizeof (sin6->sin6_addr)/2 + 1; 1992 len = sizeof (sin6->sin6_addr)/2 + 1;
1993 address = Fmake_vector (make_number (len), Qnil); 1993 address = Fmake_vector (make_number (len), Qnil);
1994 p = XVECTOR (address); 1994 p = XVECTOR (address);
1995 p->contents[--len] = make_number (ntohs (sin6->sin6_port)); 1995 p->u.contents[--len] = make_number (ntohs (sin6->sin6_port));
1996 for (i = 0; i < len; i++) 1996 for (i = 0; i < len; i++)
1997 p->contents[i] = make_number (ntohs (ip6[i])); 1997 p->u.contents[i] = make_number (ntohs (ip6[i]));
1998 return address; 1998 return address;
1999 } 1999 }
2000#endif 2000#endif
@@ -2019,7 +2019,7 @@ conv_sockaddr_to_lisp (struct sockaddr *sa, int len)
2019 2019
2020 i = 0; 2020 i = 0;
2021 while (i < len) 2021 while (i < len)
2022 p->contents[i++] = make_number (*cp++); 2022 p->u.contents[i++] = make_number (*cp++);
2023 2023
2024 return address; 2024 return address;
2025} 2025}
@@ -2090,7 +2090,7 @@ conv_lisp_to_sockaddr (int family, Lisp_Object address, struct sockaddr *sa, int
2090 { 2090 {
2091 struct sockaddr_in *sin = (struct sockaddr_in *) sa; 2091 struct sockaddr_in *sin = (struct sockaddr_in *) sa;
2092 len = sizeof (sin->sin_addr) + 1; 2092 len = sizeof (sin->sin_addr) + 1;
2093 hostport = XINT (p->contents[--len]); 2093 hostport = XINT (p->u.contents[--len]);
2094 sin->sin_port = htons (hostport); 2094 sin->sin_port = htons (hostport);
2095 cp = (unsigned char *)&sin->sin_addr; 2095 cp = (unsigned char *)&sin->sin_addr;
2096 sa->sa_family = family; 2096 sa->sa_family = family;
@@ -2101,12 +2101,12 @@ conv_lisp_to_sockaddr (int family, Lisp_Object address, struct sockaddr *sa, int
2101 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; 2101 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa;
2102 uint16_t *ip6 = (uint16_t *)&sin6->sin6_addr; 2102 uint16_t *ip6 = (uint16_t *)&sin6->sin6_addr;
2103 len = sizeof (sin6->sin6_addr) + 1; 2103 len = sizeof (sin6->sin6_addr) + 1;
2104 hostport = XINT (p->contents[--len]); 2104 hostport = XINT (p->u.contents[--len]);
2105 sin6->sin6_port = htons (hostport); 2105 sin6->sin6_port = htons (hostport);
2106 for (i = 0; i < len; i++) 2106 for (i = 0; i < len; i++)
2107 if (INTEGERP (p->contents[i])) 2107 if (INTEGERP (p->u.contents[i]))
2108 { 2108 {
2109 int j = XFASTINT (p->contents[i]) & 0xffff; 2109 int j = XFASTINT (p->u.contents[i]) & 0xffff;
2110 ip6[i] = ntohs (j); 2110 ip6[i] = ntohs (j);
2111 } 2111 }
2112 sa->sa_family = family; 2112 sa->sa_family = family;
@@ -2137,8 +2137,8 @@ conv_lisp_to_sockaddr (int family, Lisp_Object address, struct sockaddr *sa, int
2137 } 2137 }
2138 2138
2139 for (i = 0; i < len; i++) 2139 for (i = 0; i < len; i++)
2140 if (INTEGERP (p->contents[i])) 2140 if (INTEGERP (p->u.contents[i]))
2141 *cp++ = XFASTINT (p->contents[i]) & 0xff; 2141 *cp++ = XFASTINT (p->u.contents[i]) & 0xff;
2142} 2142}
2143 2143
2144#ifdef DATAGRAM_SOCKETS 2144#ifdef DATAGRAM_SOCKETS
@@ -3729,7 +3729,7 @@ FLAGS is the current flags of the interface. */)
3729 3729
3730 any = 1; 3730 any = 1;
3731 for (n = 0; n < 6; n++) 3731 for (n = 0; n < 6; n++)
3732 p->contents[n] = make_number (((unsigned char *)&rq.ifr_hwaddr.sa_data[0])[n]); 3732 p->u.contents[n] = make_number (((unsigned char *)&rq.ifr_hwaddr.sa_data[0])[n]);
3733 elt = Fcons (make_number (rq.ifr_hwaddr.sa_family), hwaddr); 3733 elt = Fcons (make_number (rq.ifr_hwaddr.sa_family), hwaddr);
3734 } 3734 }
3735#elif defined (HAVE_GETIFADDRS) && defined (LLADDR) 3735#elif defined (HAVE_GETIFADDRS) && defined (LLADDR)
diff --git a/src/w32menu.c b/src/w32menu.c
index 7435a09b627..b52aae55499 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -421,7 +421,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
421 421
422 /* Save the frame's previous menu bar contents data. */ 422 /* Save the frame's previous menu bar contents data. */
423 if (previous_menu_items_used) 423 if (previous_menu_items_used)
424 memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents, 424 memcpy (previous_items, XVECTOR (f->menu_bar_vector)->u.contents,
425 previous_menu_items_used * word_size); 425 previous_menu_items_used * word_size);
426 426
427 /* Fill in menu_items with the current menu bar contents. 427 /* Fill in menu_items with the current menu bar contents.
diff --git a/src/window.c b/src/window.c
index 7081df7de89..cca15122522 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5401,7 +5401,7 @@ struct saved_window
5401}; 5401};
5402 5402
5403#define SAVED_WINDOW_N(swv,n) \ 5403#define SAVED_WINDOW_N(swv,n) \
5404 ((struct saved_window *) (XVECTOR ((swv)->contents[(n)]))) 5404 ((struct saved_window *) (XVECTOR ((swv)->u.contents[(n)])))
5405 5405
5406DEFUN ("window-configuration-p", Fwindow_configuration_p, Swindow_configuration_p, 1, 1, 0, 5406DEFUN ("window-configuration-p", Fwindow_configuration_p, Swindow_configuration_p, 1, 1, 0,
5407 doc: /* Return t if OBJECT is a window-configuration object. */) 5407 doc: /* Return t if OBJECT is a window-configuration object. */)
diff --git a/src/xdisp.c b/src/xdisp.c
index 6d19531aab6..0dc34dfbab0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4473,8 +4473,8 @@ setup_for_ellipsis (struct it *it, int len)
4473 if (it->dp && VECTORP (DISP_INVIS_VECTOR (it->dp))) 4473 if (it->dp && VECTORP (DISP_INVIS_VECTOR (it->dp)))
4474 { 4474 {
4475 struct Lisp_Vector *v = XVECTOR (DISP_INVIS_VECTOR (it->dp)); 4475 struct Lisp_Vector *v = XVECTOR (DISP_INVIS_VECTOR (it->dp));
4476 it->dpvec = v->contents; 4476 it->dpvec = v->u.contents;
4477 it->dpend = v->contents + v->header.size; 4477 it->dpend = v->u.contents + v->header.size;
4478 } 4478 }
4479 else 4479 else
4480 { 4480 {
@@ -6778,8 +6778,8 @@ get_next_display_element (struct it *it)
6778 if (v->header.size) 6778 if (v->header.size)
6779 { 6779 {
6780 it->dpvec_char_len = it->len; 6780 it->dpvec_char_len = it->len;
6781 it->dpvec = v->contents; 6781 it->dpvec = v->u.contents;
6782 it->dpend = v->contents + v->header.size; 6782 it->dpend = v->u.contents + v->header.size;
6783 it->current.dpvec_index = 0; 6783 it->current.dpvec_index = 0;
6784 it->dpvec_face_id = -1; 6784 it->dpvec_face_id = -1;
6785 it->saved_face_id = it->face_id; 6785 it->saved_face_id = it->face_id;
@@ -27555,7 +27555,7 @@ on_hot_spot_p (Lisp_Object hot_spot, int x, int y)
27555 if (VECTORP (XCDR (hot_spot))) 27555 if (VECTORP (XCDR (hot_spot)))
27556 { 27556 {
27557 struct Lisp_Vector *v = XVECTOR (XCDR (hot_spot)); 27557 struct Lisp_Vector *v = XVECTOR (XCDR (hot_spot));
27558 Lisp_Object *poly = v->contents; 27558 Lisp_Object *poly = v->u.contents;
27559 ptrdiff_t n = v->header.size; 27559 ptrdiff_t n = v->header.size;
27560 ptrdiff_t i; 27560 ptrdiff_t i;
27561 int inside = 0; 27561 int inside = 0;
diff --git a/src/xfaces.c b/src/xfaces.c
index 335018dfee2..8d78a28eab1 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1565,7 +1565,7 @@ the face font sort order. */)
1565 vec = Fvconcat (ndrivers, drivers); 1565 vec = Fvconcat (ndrivers, drivers);
1566 nfonts = ASIZE (vec); 1566 nfonts = ASIZE (vec);
1567 1567
1568 qsort (XVECTOR (vec)->contents, nfonts, word_size, 1568 qsort (XVECTOR (vec)->u.contents, nfonts, word_size,
1569 compare_fonts_by_sort_order); 1569 compare_fonts_by_sort_order);
1570 1570
1571 result = Qnil; 1571 result = Qnil;
@@ -1830,7 +1830,7 @@ check_lface (Lisp_Object lface)
1830 if (!NILP (lface)) 1830 if (!NILP (lface))
1831 { 1831 {
1832 eassert (LFACEP (lface)); 1832 eassert (LFACEP (lface));
1833 check_lface_attrs (XVECTOR (lface)->contents); 1833 check_lface_attrs (XVECTOR (lface)->u.contents);
1834 } 1834 }
1835} 1835}
1836 1836
@@ -2007,7 +2007,7 @@ get_lface_attributes_no_remap (struct frame *f, Lisp_Object face_name,
2007 lface = lface_from_face_name_no_resolve (f, face_name, signal_p); 2007 lface = lface_from_face_name_no_resolve (f, face_name, signal_p);
2008 2008
2009 if (! NILP (lface)) 2009 if (! NILP (lface))
2010 memcpy (attrs, XVECTOR (lface)->contents, 2010 memcpy (attrs, XVECTOR (lface)->u.contents,
2011 LFACE_VECTOR_SIZE * sizeof *attrs); 2011 LFACE_VECTOR_SIZE * sizeof *attrs);
2012 2012
2013 return !NILP (lface); 2013 return !NILP (lface);
@@ -2690,7 +2690,7 @@ The value is TO. */)
2690 copy = Finternal_make_lisp_face (to, new_frame); 2690 copy = Finternal_make_lisp_face (to, new_frame);
2691 } 2691 }
2692 2692
2693 vcopy (copy, 0, XVECTOR (lface)->contents, LFACE_VECTOR_SIZE); 2693 vcopy (copy, 0, XVECTOR (lface)->u.contents, LFACE_VECTOR_SIZE);
2694 2694
2695 /* Changing a named face means that all realized faces depending on 2695 /* Changing a named face means that all realized faces depending on
2696 that face are invalid. Since we cannot tell which realized faces 2696 that face are invalid. Since we cannot tell which realized faces
@@ -3093,7 +3093,7 @@ FRAME 0 means change the face on all frames, and change the default
3093 f = XFRAME (frame); 3093 f = XFRAME (frame);
3094 if (! FONT_OBJECT_P (value)) 3094 if (! FONT_OBJECT_P (value))
3095 { 3095 {
3096 Lisp_Object *attrs = XVECTOR (lface)->contents; 3096 Lisp_Object *attrs = XVECTOR (lface)->u.contents;
3097 Lisp_Object font_object; 3097 Lisp_Object font_object;
3098 3098
3099 font_object = font_load_for_lface (f, attrs, value); 3099 font_object = font_load_for_lface (f, attrs, value);
@@ -3161,7 +3161,7 @@ FRAME 0 means change the face on all frames, and change the default
3161 the font to nil so that the font selector doesn't think that 3161 the font to nil so that the font selector doesn't think that
3162 the attribute is mandatory. Also, clear the average 3162 the attribute is mandatory. Also, clear the average
3163 width. */ 3163 width. */
3164 font_clear_prop (XVECTOR (lface)->contents, prop_index); 3164 font_clear_prop (XVECTOR (lface)->u.contents, prop_index);
3165 } 3165 }
3166 3166
3167 /* Changing a named face means that all realized faces depending on 3167 /* Changing a named face means that all realized faces depending on
@@ -3191,7 +3191,7 @@ FRAME 0 means change the face on all frames, and change the default
3191 reflected in changed `font' frame parameters. */ 3191 reflected in changed `font' frame parameters. */
3192 if (FRAMEP (frame) 3192 if (FRAMEP (frame)
3193 && (prop_index || EQ (attr, QCfont)) 3193 && (prop_index || EQ (attr, QCfont))
3194 && lface_fully_specified_p (XVECTOR (lface)->contents)) 3194 && lface_fully_specified_p (XVECTOR (lface)->u.contents))
3195 set_font_frame_param (frame, lface); 3195 set_font_frame_param (frame, lface);
3196 else 3196 else
3197#endif /* HAVE_WINDOW_SYSTEM */ 3197#endif /* HAVE_WINDOW_SYSTEM */
@@ -3371,7 +3371,7 @@ set_font_frame_param (Lisp_Object frame, Lisp_Object lface)
3371 { 3371 {
3372 if (FONT_SPEC_P (font)) 3372 if (FONT_SPEC_P (font))
3373 { 3373 {
3374 font = font_load_for_lface (f, XVECTOR (lface)->contents, font); 3374 font = font_load_for_lface (f, XVECTOR (lface)->u.contents, font);
3375 if (NILP (font)) 3375 if (NILP (font))
3376 return; 3376 return;
3377 ASET (lface, LFACE_FONT_INDEX, font); 3377 ASET (lface, LFACE_FONT_INDEX, font);
@@ -3728,8 +3728,8 @@ Default face attributes override any local face attributes. */)
3728 the local frame is defined from default specs in `face-defface-spec' 3728 the local frame is defined from default specs in `face-defface-spec'
3729 and those should be overridden by global settings. Hence the strange 3729 and those should be overridden by global settings. Hence the strange
3730 "global before local" priority. */ 3730 "global before local" priority. */
3731 lvec = XVECTOR (local_lface)->contents; 3731 lvec = XVECTOR (local_lface)->u.contents;
3732 gvec = XVECTOR (global_lface)->contents; 3732 gvec = XVECTOR (global_lface)->u.contents;
3733 for (i = 1; i < LFACE_VECTOR_SIZE; ++i) 3733 for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
3734 if (IGNORE_DEFFACE_P (gvec[i])) 3734 if (IGNORE_DEFFACE_P (gvec[i]))
3735 ASET (local_lface, i, Qunspecified); 3735 ASET (local_lface, i, Qunspecified);
@@ -3913,8 +3913,8 @@ If FRAME is omitted or nil, use the selected frame. */)
3913 3913
3914 lface1 = lface_from_face_name (f, face1, 1); 3914 lface1 = lface_from_face_name (f, face1, 1);
3915 lface2 = lface_from_face_name (f, face2, 1); 3915 lface2 = lface_from_face_name (f, face2, 1);
3916 equal_p = lface_equal_p (XVECTOR (lface1)->contents, 3916 equal_p = lface_equal_p (XVECTOR (lface1)->u.contents,
3917 XVECTOR (lface2)->contents); 3917 XVECTOR (lface2)->u.contents);
3918 return equal_p ? Qt : Qnil; 3918 return equal_p ? Qt : Qnil;
3919} 3919}
3920 3920
@@ -4651,7 +4651,7 @@ DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector,
4651 Lisp_Object lface; 4651 Lisp_Object lface;
4652 lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE), 4652 lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE),
4653 Qunspecified); 4653 Qunspecified);
4654 merge_face_ref (XFRAME (selected_frame), plist, XVECTOR (lface)->contents, 4654 merge_face_ref (XFRAME (selected_frame), plist, XVECTOR (lface)->u.contents,
4655 1, 0); 4655 1, 0);
4656 return lface; 4656 return lface;
4657} 4657}
@@ -5331,9 +5331,9 @@ realize_default_face (struct frame *f)
5331 ASET (lface, LFACE_STIPPLE_INDEX, Qnil); 5331 ASET (lface, LFACE_STIPPLE_INDEX, Qnil);
5332 5332
5333 /* Realize the face; it must be fully-specified now. */ 5333 /* Realize the face; it must be fully-specified now. */
5334 eassert (lface_fully_specified_p (XVECTOR (lface)->contents)); 5334 eassert (lface_fully_specified_p (XVECTOR (lface)->u.contents));
5335 check_lface (lface); 5335 check_lface (lface);
5336 memcpy (attrs, XVECTOR (lface)->contents, sizeof attrs); 5336 memcpy (attrs, XVECTOR (lface)->u.contents, sizeof attrs);
5337 face = realize_face (c, attrs, DEFAULT_FACE_ID); 5337 face = realize_face (c, attrs, DEFAULT_FACE_ID);
5338 5338
5339#ifdef HAVE_WINDOW_SYSTEM 5339#ifdef HAVE_WINDOW_SYSTEM
diff --git a/src/xfont.c b/src/xfont.c
index 6a675482ed9..c5b8db3830c 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -384,7 +384,7 @@ xfont_list_pattern (Display *display, const char *pattern,
384 if (num_fonts > 0) 384 if (num_fonts > 0)
385 { 385 {
386 char **indices = alloca (sizeof (char *) * num_fonts); 386 char **indices = alloca (sizeof (char *) * num_fonts);
387 Lisp_Object *props = XVECTOR (xfont_scratch_props)->contents; 387 Lisp_Object *props = XVECTOR (xfont_scratch_props)->u.contents;
388 Lisp_Object scripts = Qnil; 388 Lisp_Object scripts = Qnil;
389 389
390 for (i = 0; i < ASIZE (xfont_scratch_props); i++) 390 for (i = 0; i < ASIZE (xfont_scratch_props); i++)
diff --git a/src/xmenu.c b/src/xmenu.c
index 1535b00a47f..ad8380a3c3e 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -990,7 +990,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
990 990
991 /* Save the frame's previous menu bar contents data. */ 991 /* Save the frame's previous menu bar contents data. */
992 if (previous_menu_items_used) 992 if (previous_menu_items_used)
993 memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents, 993 memcpy (previous_items, XVECTOR (f->menu_bar_vector)->u.contents,
994 previous_menu_items_used * word_size); 994 previous_menu_items_used * word_size);
995 995
996 /* Fill in menu_items with the current menu bar contents. 996 /* Fill in menu_items with the current menu bar contents.
@@ -2187,7 +2187,7 @@ menu_help_callback (char const *help_string, int pane, int item)
2187 Lisp_Object pane_name; 2187 Lisp_Object pane_name;
2188 Lisp_Object menu_object; 2188 Lisp_Object menu_object;
2189 2189
2190 first_item = XVECTOR (menu_items)->contents; 2190 first_item = XVECTOR (menu_items)->u.contents;
2191 if (EQ (first_item[0], Qt)) 2191 if (EQ (first_item[0], Qt))
2192 pane_name = first_item[MENU_ITEMS_PANE_NAME]; 2192 pane_name = first_item[MENU_ITEMS_PANE_NAME];
2193 else if (EQ (first_item[0], Qquote)) 2193 else if (EQ (first_item[0], Qquote))