From 6068cf00cddcd9f81a1390e7b4b8ecb02e285696 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Sun, 14 Jul 2024 10:45:50 +0000 Subject: [PATCH] Turn union vectorlike_header into struct vectorlike_header This makes it feasible to add GC header members to this struct; keeping it as a union and merely turning its contents into a struct would have been misleading and required more difficult changes. * src/lisp.h (struct vectorlike_header): New type. Adjust comments. (union vectorlike_header): Remove. (PSEUDOVECTORP): (XSETPVECTYPESIZE): (struct Lisp_Vector): (PSEUDOVECTOR_TYPEP): (struct Lisp_Bool_Vector): (struct Lisp_Char_Table): (struct Lisp_Sub_Char_Table): (struct Lisp_Subr): (struct Lisp_Obarray): (struct Lisp_Weak_Hash_Table): (struct Lisp_Hash_Table): (struct Lisp_Marker): (struct Lisp_Overlay) (struct Lisp_Misc_Ptr): (struct Lisp_Sqlite): (struct Lisp_User_Ptr): (struct Lisp_Finalizer): (vectorlike_nbytes): * src/alloc.c (pseudovector_nbytes): (vectorlike_nbytes): (vectorlike_marked_p): (set_vectorlike_marked): (mark_vectorlike): * src/androidterm.h (struct scroll_bar): * src/bignum.h (struct Lisp_Bignum): * src/buffer.h (struct buffer): * src/comp.c (helper_PSEUDOVECTOR_TYPEP_XUNTAG): * src/comp.h (struct Lisp_Native_Comp_Unit): * src/emacs-module.c (struct Lisp_Module_Function): * src/emacs-module.h.in (struct module_global_reference): * src/font.h (struct font_spec, struct font_entity) (struct font): * src/frame.h (struct frame): * src/haikuterm.h (struct scroll_bar): Adjust * src/pdumper.c (_dump_object_start_pseudovector): (START_DUMP_PVEC): (finish_dump_pvec): (dump_pseudovector_lisp_fields): (dump_vectorlike_generic): (fill_pseudovec): (dump_nilled_pseudovec): * src/pgtkterm.h (struct scroll_bar): * src/process.h (struct Lisp_Process): * src/termhooks.h (struct terminal): * src/thread.h (struct thread_state): (struct Lisp_Mutex): (struct Lisp_CondVar): * src/treesit.h (struct Lisp_TS_Parser) (struct Lisp_TS_Node): (struct Lisp_TS_Query): * src/w32term.h (struct scroll_bar): * src/window.c (make_parent_window): (struct save_window_data): (struct saved_window): * src/window.h (struct window): * src/xterm.h (struct scroll_bar): * src/xwidget.h (struct xwidget): (struct xwidget_view): Replace `union vectorlike_header' by `struct vectorlike_header' throughout. * doc/lispref/internals.texi: Fix references. --- doc/lispref/internals.texi | 4 +-- src/alloc.c | 14 +++++----- src/androidterm.h | 2 +- src/bignum.h | 2 +- src/buffer.h | 2 +- src/comp.c | 2 +- src/comp.h | 2 +- src/emacs-module.c | 2 +- src/emacs-module.h.in | 2 +- src/font.h | 6 ++--- src/frame.h | 2 +- src/haikuterm.h | 2 +- src/lisp.h | 52 ++++++++++++++++++-------------------- src/pdumper.c | 20 +++++++-------- src/pgtkterm.h | 2 +- src/process.h | 2 +- src/termhooks.h | 2 +- src/thread.h | 6 ++--- src/treesit.h | 6 ++--- src/w32term.h | 2 +- src/window.c | 8 +++--- src/window.h | 2 +- src/xterm.h | 2 +- src/xwidget.h | 4 +-- 24 files changed, 74 insertions(+), 76 deletions(-) diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index a5480a9bf8a..01d9b72a33b 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -334,7 +334,7 @@ of 8k bytes, and small vectors are packed into blocks of 4k bytes). @cindex storage of vector-like Lisp objects Beyond the basic vector, a lot of objects like markers, overlays and buffers are managed as if they were vectors. The corresponding C data -structures include the @code{union vectorlike_header} field whose +structures include the @code{struct vectorlike_header} field whose @code{size} member contains the subtype enumerated by @code{enum pvec_type} and an information about how many @code{Lisp_Object} fields this structure contains and what the size of the rest data is. This information is @@ -2366,7 +2366,7 @@ Some of the fields of @code{struct buffer} are: @table @code @item header -A header of type @code{union vectorlike_header} is common to all +A header of type @code{struct vectorlike_header} is common to all vectorlike objects. @item own_text diff --git a/src/alloc.c b/src/alloc.c index 61bb95731a8..52c58c382f3 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -471,8 +471,8 @@ static void compact_small_strings (void); static void free_large_strings (void); static bool vector_marked_p (struct Lisp_Vector const *); -static bool vectorlike_marked_p (union vectorlike_header const *); -static void set_vectorlike_marked (union vectorlike_header *); +static bool vectorlike_marked_p (struct vectorlike_header const *); +static void set_vectorlike_marked (struct vectorlike_header *); static bool interval_marked_p (INTERVAL); static void set_interval_marked (INTERVAL); #endif @@ -3298,7 +3298,7 @@ init_vectors (void) /* Memory footprint in bytes of a pseudovector other than a bool-vector. */ static ptrdiff_t -pseudovector_nbytes (const union vectorlike_header *hdr) +pseudovector_nbytes (const struct vectorlike_header *hdr) { eassert (!PSEUDOVECTOR_TYPEP (hdr, PVEC_BOOL_VECTOR)); ptrdiff_t nwords = ((hdr->size & PSEUDOVECTOR_SIZE_MASK) @@ -3386,7 +3386,7 @@ allocate_vector_from_block (ptrdiff_t nbytes) #endif // nto HAVE_MPS ptrdiff_t -vectorlike_nbytes (const union vectorlike_header *hdr) +vectorlike_nbytes (const struct vectorlike_header *hdr) { ptrdiff_t size = hdr->size & ~ARRAY_MARK_FLAG; ptrdiff_t nwords; @@ -4431,13 +4431,13 @@ set_vector_marked (struct Lisp_Vector *v) } static bool -vectorlike_marked_p (const union vectorlike_header *header) +vectorlike_marked_p (const struct vectorlike_header *header) { return vector_marked_p ((const struct Lisp_Vector *) header); } static void -set_vectorlike_marked (union vectorlike_header *header) +set_vectorlike_marked (struct vectorlike_header *header) { set_vector_marked ((struct Lisp_Vector *) header); } @@ -7136,7 +7136,7 @@ ptrdiff_t mark_object_loop_halt EXTERNALLY_VISIBLE; #ifndef HAVE_MPS static void -mark_vectorlike (union vectorlike_header *header) +mark_vectorlike (struct vectorlike_header *header) { struct Lisp_Vector *ptr = (struct Lisp_Vector *) header; ptrdiff_t size = ptr->header.size; diff --git a/src/androidterm.h b/src/androidterm.h index c8f1ab655a9..f9418a73d18 100644 --- a/src/androidterm.h +++ b/src/androidterm.h @@ -338,7 +338,7 @@ enum struct scroll_bar { /* These fields are shared by all vectors. */ - union vectorlike_header header; + struct vectorlike_header header; /* The window we're a scroll bar for. */ Lisp_Object window; diff --git a/src/bignum.h b/src/bignum.h index 2749f8370d0..353efd74c50 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -32,7 +32,7 @@ enum { GMP_NUMB_BITS = TYPE_WIDTH (mp_limb_t) }; struct Lisp_Bignum { - union vectorlike_header header; + struct vectorlike_header header; mpz_t value; } GCALIGNED_STRUCT; diff --git a/src/buffer.h b/src/buffer.h index 7c1f743db9d..1e1a65e339d 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -308,7 +308,7 @@ enum { UNKNOWN_MODTIME_NSECS = -2 }; struct buffer { - union vectorlike_header header; + struct vectorlike_header header; /* The name of this buffer. */ Lisp_Object name_; diff --git a/src/comp.c b/src/comp.c index a2f7b384f4f..ff33944becd 100644 --- a/src/comp.c +++ b/src/comp.c @@ -5084,7 +5084,7 @@ static bool helper_PSEUDOVECTOR_TYPEP_XUNTAG (Lisp_Object a, enum pvec_type code) { return PSEUDOVECTOR_TYPEP (XUNTAG (a, Lisp_Vectorlike, - union vectorlike_header), + struct vectorlike_header), code); } diff --git a/src/comp.h b/src/comp.h index f560cf6954b..e1e176f5c56 100644 --- a/src/comp.h +++ b/src/comp.h @@ -29,7 +29,7 @@ struct igc_root_list; struct Lisp_Native_Comp_Unit { - union vectorlike_header header; + struct vectorlike_header header; /* The original eln file loaded. In the pdumper file this is stored as a cons cell of 2 alternative file names: the car is the filename relative to the directory of an installed binary, the diff --git a/src/emacs-module.c b/src/emacs-module.c index eb23e7243de..732bf536fc7 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c @@ -534,7 +534,7 @@ module_non_local_exit_throw (emacs_env *env, emacs_value tag, emacs_value value) struct Lisp_Module_Function { - union vectorlike_header header; + struct vectorlike_header header; /* Fields traced by GC; these must come first. */ Lisp_Object documentation, interactive_form, command_modes; diff --git a/src/emacs-module.h.in b/src/emacs-module.h.in index 070b18fada1..59d1f115f4a 100644 --- a/src/emacs-module.h.in +++ b/src/emacs-module.h.in @@ -230,7 +230,7 @@ struct emacs_value_tag { Lisp_Object v; }; struct module_global_reference { /* Pseudovector header, must come first. */ - union vectorlike_header header; + struct vectorlike_header header; /* Holds the emacs_value for the object. The Lisp_Object stored therein must be the same as the hash key. */ diff --git a/src/font.h b/src/font.h index 8ee1940be0a..24d867bcc37 100644 --- a/src/font.h +++ b/src/font.h @@ -250,7 +250,7 @@ enum font_property_index struct font_spec { - union vectorlike_header header; + struct vectorlike_header header; Lisp_Object props[FONT_SPEC_MAX]; }; @@ -258,7 +258,7 @@ struct font_spec struct font_entity { - union vectorlike_header header; + struct vectorlike_header header; Lisp_Object props[FONT_ENTITY_MAX]; #if defined HAVE_ANDROID && !defined ANDROID_STUBIFY @@ -276,7 +276,7 @@ struct font_entity struct font { - union vectorlike_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 94ff6bf12b9..3abf08f6292 100644 --- a/src/frame.h +++ b/src/frame.h @@ -144,7 +144,7 @@ struct text_conversion_state struct frame { - union vectorlike_header header; + struct vectorlike_header header; /* All Lisp_Object components must come first. That ensures they are all aligned normally. */ diff --git a/src/haikuterm.h b/src/haikuterm.h index 75c4bf0d6ef..e350ab3cb6c 100644 --- a/src/haikuterm.h +++ b/src/haikuterm.h @@ -237,7 +237,7 @@ extern frame_parm_handler haiku_frame_parm_handlers[]; struct scroll_bar { /* These fields are shared by all vectors. */ - union vectorlike_header header; + struct vectorlike_header header; /* The window we're a scroll bar for. */ Lisp_Object window; diff --git a/src/lisp.h b/src/lisp.h index 40ffa6d5aeb..2f986cb899e 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -495,7 +495,7 @@ typedef EMACS_INT Lisp_Word; 01........ ........10 fixnum signed integer of FIXNUM_BITS 110....... .......011 cons pointer to struct Lisp_Cons 100....... .......100 string pointer to struct Lisp_String - 101....... .......101 vectorlike pointer to union vectorlike_header + 101....... .......101 vectorlike pointer to struct vectorlike_header 111....... .......111 float pointer to struct Lisp_Float */ enum Lisp_Type { @@ -960,13 +960,11 @@ typedef EMACS_UINT Lisp_Word_tag; /* Header of vector-like objects. This documents the layout constraints on vectors and pseudovectors (objects of PVEC_xxx subtype). It also prevents compilers from being fooled by Emacs's type punning: XSETPSEUDOVECTOR - and PSEUDOVECTORP cast their pointers to union vectorlike_header *, + and PSEUDOVECTORP cast their pointers to struct vectorlike_header *, because when two such pointers potentially alias, a compiler won't incorrectly reorder loads and stores to their size fields. See - Bug#8546. This union formerly contained more members, and there's - no compelling reason to change it to a struct merely because the - number of members has been reduced to one. */ -union vectorlike_header + Bug#8546. */ +struct vectorlike_header { /* The `size' header word, W bits wide, has one of two forms discriminated by the second-highest bit (PSEUDOVECTOR_FLAG): @@ -1002,7 +1000,7 @@ union vectorlike_header struct Lisp_Symbol_With_Pos { - union vectorlike_header header; + struct vectorlike_header header; Lisp_Object sym; /* A symbol */ Lisp_Object pos; /* A fixnum */ } GCALIGNED_STRUCT; @@ -1104,7 +1102,7 @@ INLINE bool PSEUDOVECTORP (Lisp_Object a, int code) { return (lisp_h_VECTORLIKEP (a) - && ((XUNTAG (a, Lisp_Vectorlike, union vectorlike_header)->size + && ((XUNTAG (a, Lisp_Vectorlike, struct vectorlike_header)->size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) == (PSEUDOVECTOR_FLAG | (code << PSEUDOVECTOR_AREA_BITS)))); } @@ -1418,11 +1416,11 @@ dead_object (void) #define XSETPVECTYPESIZE(v, code, lispsize, restsize) \ ((v)->header.size = PVECHEADERSIZE (code, lispsize, restsize)) -/* The cast to union vectorlike_header * avoids aliasing issues. */ +/* The cast to struct vectorlike_header * avoids aliasing issues. */ #define XSETPSEUDOVECTOR(a, b, code) \ XSETTYPED_PSEUDOVECTOR (a, b, \ (XUNTAG (a, Lisp_Vectorlike, \ - union vectorlike_header) \ + struct vectorlike_header) \ ->size), \ code) #define XSETTYPED_PSEUDOVECTOR(a, b, size, code) \ @@ -1781,7 +1779,7 @@ string_immovable_p (Lisp_Object str) struct Lisp_Vector { - union vectorlike_header header; + struct vectorlike_header header; Lisp_Object contents[FLEXIBLE_ARRAY_MEMBER]; } GCALIGNED_STRUCT; @@ -1847,7 +1845,7 @@ PSEUDOVECTOR_TYPE (const struct Lisp_Vector *v) /* Can't be used with PVEC_NORMAL_VECTOR. */ INLINE bool -PSEUDOVECTOR_TYPEP (const union vectorlike_header *a, enum pvec_type code) +PSEUDOVECTOR_TYPEP (const struct vectorlike_header *a, enum pvec_type code) { /* We don't use PSEUDOVECTOR_TYPE here so as to avoid a shift * operation when `code' is known. */ @@ -1861,7 +1859,7 @@ struct Lisp_Bool_Vector { /* HEADER.SIZE is the vector's size field. It doesn't have the real size, just the subtype information. */ - union vectorlike_header header; + struct vectorlike_header header; /* This is the size in bits. */ EMACS_INT size; /* The actual bits, packed into bytes. @@ -1875,7 +1873,7 @@ struct Lisp_Bool_Vector and offsets, mostly of vectorlike objects. The garbage collector assumes that the initial part of any struct - that starts with a union vectorlike_header followed by N + that starts with a struct vectorlike_header followed by N Lisp_Objects (some possibly in arrays and/or a trailing flexible array) will be laid out like a struct Lisp_Vector with N Lisp_Objects. This assumption is true in practice on known Emacs @@ -2102,7 +2100,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. */ - union vectorlike_header header; + struct vectorlike_header header; /* This holds the default value, which is used whenever the value for a specific character is nil. */ @@ -2146,7 +2144,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. */ - union vectorlike_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 @@ -2221,7 +2219,7 @@ CHAR_TABLE_SET (Lisp_Object ct, int idx, Lisp_Object val) struct Lisp_Subr { - union vectorlike_header header; + struct vectorlike_header header; union { Lisp_Object (*a0) (void); Lisp_Object (*a1) (Lisp_Object); @@ -2441,7 +2439,7 @@ INLINE int struct Lisp_Obarray { - union vectorlike_header header; + struct vectorlike_header header; /* Array of 2**size_bits values, each being either a (bare) symbol or the fixnum 0. The symbols for each bucket are chained via @@ -2653,7 +2651,7 @@ struct Lisp_Weak_Hash_Table_Weak_Part struct Lisp_Weak_Hash_Table { - union vectorlike_header header; + struct vectorlike_header header; struct Lisp_Weak_Hash_Table_Strong_Part *strong; struct Lisp_Weak_Hash_Table_Weak_Part *weak; @@ -2662,7 +2660,7 @@ struct Lisp_Weak_Hash_Table struct Lisp_Hash_Table { - union vectorlike_header header; + struct vectorlike_header header; /* Hash table internal structure: @@ -3020,7 +3018,7 @@ knuth_hash (hash_hash_t hash, unsigned bits) struct Lisp_Marker { - union vectorlike_header header; + struct vectorlike_header header; /* This is the buffer that the marker points into, or 0 if it points nowhere. Note: a chain of markers can contain markers pointing into different @@ -3079,7 +3077,7 @@ struct Lisp_Overlay - end buffer position (field of the itree node) - insertion types of both ends (fields of the itree node). */ { - union vectorlike_header header; + struct vectorlike_header header; Lisp_Object plist; struct buffer *buffer; /* eassert (live buffer || NULL). */ struct itree_node *interval; @@ -3087,7 +3085,7 @@ struct Lisp_Overlay struct Lisp_Misc_Ptr { - union vectorlike_header header; + struct vectorlike_header header; void *pointer; } GCALIGNED_STRUCT; @@ -3132,7 +3130,7 @@ xmint_pointer (Lisp_Object a) struct Lisp_Sqlite { - union vectorlike_header header; + struct vectorlike_header header; void *db; void *stmt; char *name; @@ -3143,7 +3141,7 @@ struct Lisp_Sqlite struct Lisp_User_Ptr { - union vectorlike_header header; + struct vectorlike_header header; void (*finalizer) (void *); void *p; } GCALIGNED_STRUCT; @@ -3151,7 +3149,7 @@ struct Lisp_User_Ptr /* A finalizer sentinel. */ struct Lisp_Finalizer { - union vectorlike_header header; + struct vectorlike_header header; /* Call FUNCTION when the finalizer becomes unreachable, even if FUNCTION contains a reference to the finalizer; i.e., call @@ -4835,7 +4833,7 @@ extern Lisp_Object make_string (const char *, ptrdiff_t); extern Lisp_Object make_formatted_string (char *, const char *, ...) ATTRIBUTE_FORMAT_PRINTF (2, 3); extern Lisp_Object make_unibyte_string (const char *, ptrdiff_t); -extern ptrdiff_t vectorlike_nbytes (const union vectorlike_header *hdr); +extern ptrdiff_t vectorlike_nbytes (const struct vectorlike_header *hdr); INLINE ptrdiff_t vector_nbytes (const struct Lisp_Vector *v) diff --git a/src/pdumper.c b/src/pdumper.c index 26addfe3852..2a670ca6a12 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2064,8 +2064,8 @@ dump_field_emacs_ptr (struct dump_context *ctx, static void _dump_object_start_pseudovector (struct dump_context *ctx, - union vectorlike_header *out_hdr, - const union vectorlike_header *in_hdr) + struct vectorlike_header *out_hdr, + const struct vectorlike_header *in_hdr) { eassert (in_hdr->size & PSEUDOVECTOR_FLAG); ptrdiff_t vec_size = vectorlike_nbytes (in_hdr); @@ -2075,21 +2075,21 @@ _dump_object_start_pseudovector (struct dump_context *ctx, /* Need a macro for alloca. */ #define START_DUMP_PVEC(ctx, hdr, type, out) \ - const union vectorlike_header *_in_hdr = (hdr); \ + const struct vectorlike_header *_in_hdr = (hdr); \ type *out = alloca (vectorlike_nbytes (_in_hdr)); \ _dump_object_start_pseudovector (ctx, &out->header, _in_hdr) static dump_off finish_dump_pvec (struct dump_context *ctx, - union vectorlike_header *out_hdr) + struct vectorlike_header *out_hdr) { return dump_object_finish (ctx, out_hdr, vectorlike_nbytes (out_hdr)); } static void dump_pseudovector_lisp_fields (struct dump_context *ctx, - union vectorlike_header *out_hdr, - const union vectorlike_header *in_hdr) + struct vectorlike_header *out_hdr, + const struct vectorlike_header *in_hdr) { const struct Lisp_Vector *in = (const struct Lisp_Vector *) in_hdr; struct Lisp_Vector *out = (struct Lisp_Vector *) out_hdr; @@ -2562,7 +2562,7 @@ dump_symbol (struct dump_context *ctx, static dump_off dump_vectorlike_generic (struct dump_context *ctx, - const union vectorlike_header *header) + const struct vectorlike_header *header) { #if CHECK_STRUCTS && !defined (HASH_vectorlike_header_785E52047B) # error "vectorlike_header changed. See CHECK_STRUCTS comment in config.h." @@ -2615,7 +2615,7 @@ dump_vectorlike_generic (struct dump_context *ctx, } else { - union vectorlike_header out; + struct vectorlike_header out; prefix_start_offset = dump_object_start (ctx, header, IGC_OBJ_VECTOR, &out, sizeof (out)); DUMP_FIELD_COPY (&out, header, size); offset = dump_object_finish_1 (ctx, &out, sizeof (out)); @@ -3107,7 +3107,7 @@ dump_native_comp_unit (struct dump_context *ctx, #endif static void -fill_pseudovec (union vectorlike_header *header, Lisp_Object item) +fill_pseudovec (struct vectorlike_header *header, Lisp_Object item) { struct Lisp_Vector *v = (struct Lisp_Vector *) header; eassert (v->header.size & PSEUDOVECTOR_FLAG); @@ -3118,7 +3118,7 @@ fill_pseudovec (union vectorlike_header *header, Lisp_Object item) static dump_off dump_nilled_pseudovec (struct dump_context *ctx, - const union vectorlike_header *in) + const struct vectorlike_header *in) { START_DUMP_PVEC (ctx, in, struct Lisp_Vector, out); fill_pseudovec (&out->header, Qnil); diff --git a/src/pgtkterm.h b/src/pgtkterm.h index 90ca2aa22d4..6049e437657 100644 --- a/src/pgtkterm.h +++ b/src/pgtkterm.h @@ -93,7 +93,7 @@ struct pgtk_touch_point struct scroll_bar { /* These fields are shared by all vectors. */ - union vectorlike_header header; + struct vectorlike_header header; /* The window we're a scroll bar for. */ Lisp_Object window; diff --git a/src/process.h b/src/process.h index 1d59a658d95..ebc07b23fa7 100644 --- a/src/process.h +++ b/src/process.h @@ -41,7 +41,7 @@ enum { PROCESS_OPEN_FDS = 6 }; struct Lisp_Process { - union vectorlike_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 ff09b81c602..c90dc9833f1 100644 --- a/src/termhooks.h +++ b/src/termhooks.h @@ -469,7 +469,7 @@ extern struct tty_display_info *gpm_tty; struct terminal { /* This is for Lisp; the terminal code does not refer to it. */ - union vectorlike_header header; + struct vectorlike_header header; /* Parameter alist of this terminal. */ Lisp_Object param_alist; diff --git a/src/thread.h b/src/thread.h index fa350849146..4a668965b88 100644 --- a/src/thread.h +++ b/src/thread.h @@ -62,7 +62,7 @@ struct bc_thread_state { struct thread_state { - union vectorlike_header header; + struct vectorlike_header header; /* The buffer in which the last search was performed, or Qt if the last search was done in a string; @@ -260,7 +260,7 @@ typedef struct /* A mutex as a lisp object. */ struct Lisp_Mutex { - union vectorlike_header header; + struct vectorlike_header header; /* The name of the mutex, or nil. */ Lisp_Object name; @@ -291,7 +291,7 @@ XMUTEX (Lisp_Object a) /* A condition variable as a lisp object. */ struct Lisp_CondVar { - union vectorlike_header header; + struct vectorlike_header header; /* The associated mutex. */ Lisp_Object mutex; diff --git a/src/treesit.h b/src/treesit.h index d3c6aa4c250..f43ce02b4cb 100644 --- a/src/treesit.h +++ b/src/treesit.h @@ -33,7 +33,7 @@ INLINE_HEADER_BEGIN and other goodies for convenience. */ struct Lisp_TS_Parser { - union vectorlike_header header; + struct vectorlike_header header; /* A symbol representing the language this parser uses. See the manual for more explanation. */ Lisp_Object language_symbol; @@ -87,7 +87,7 @@ struct Lisp_TS_Parser /* A wrapper around a tree-sitter node. */ struct Lisp_TS_Node { - union vectorlike_header header; + struct vectorlike_header header; /* This prevents gc from collecting the tree before the node is done with it. TSNode contains a pointer to the tree it belongs to, and the parser object, when collected by gc, will free that @@ -114,7 +114,7 @@ struct Lisp_TS_Node building, so that breaks the build. */ struct Lisp_TS_Query { - union vectorlike_header header; + struct vectorlike_header header; /* Language symbol for the query. */ Lisp_Object language; /* Source lisp (sexp or string) query. */ diff --git a/src/w32term.h b/src/w32term.h index 47be542f570..2a39d957c0f 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -485,7 +485,7 @@ extern struct w32_output w32term_display; struct scroll_bar { /* This field is shared by all vectors. */ - union vectorlike_header header; + struct vectorlike_header header; /* The window we're a scroll bar for. */ Lisp_Object window; diff --git a/src/window.c b/src/window.c index 70472749e74..1f25724e348 100644 --- a/src/window.c +++ b/src/window.c @@ -4392,8 +4392,8 @@ make_parent_window (Lisp_Object window, bool horflag) o = XWINDOW (window); p = allocate_window (); - memcpy ((char *) p + sizeof (union vectorlike_header), - (char *) o + sizeof (union vectorlike_header), + memcpy ((char *) p + sizeof (struct vectorlike_header), + (char *) o + sizeof (struct vectorlike_header), word_size * VECSIZE (struct window)); /* P's buffer slot may change from nil to a buffer... */ adjust_window_count (p, 1); @@ -7061,7 +7061,7 @@ from the top of the window. */) struct save_window_data { - union vectorlike_header header; + struct vectorlike_header header; Lisp_Object selected_frame; Lisp_Object current_window; Lisp_Object f_current_buffer; @@ -7090,7 +7090,7 @@ struct save_window_data /* This is saved as a Lisp_Vector. */ struct saved_window { - union vectorlike_header header; + struct vectorlike_header header; Lisp_Object window, buffer, start, pointm, old_pointm; Lisp_Object pixel_left, pixel_top, pixel_height, pixel_width; diff --git a/src/window.h b/src/window.h index 86932181252..7a1b99c801d 100644 --- a/src/window.h +++ b/src/window.h @@ -100,7 +100,7 @@ struct cursor_pos struct window { /* This is for Lisp; the terminal code does not refer to it. */ - union vectorlike_header header; + struct vectorlike_header header; /* The frame this window is on. */ Lisp_Object frame; diff --git a/src/xterm.h b/src/xterm.h index 8d5c9917749..69e917a535e 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1549,7 +1549,7 @@ extern void x_mark_frame_dirty (struct frame *f); struct scroll_bar { /* These fields are shared by all vectors. */ - union vectorlike_header header; + struct vectorlike_header header; /* The window we're a scroll bar for. */ Lisp_Object window; diff --git a/src/xwidget.h b/src/xwidget.h index 34cae383abf..ef3e3742ea4 100644 --- a/src/xwidget.h +++ b/src/xwidget.h @@ -49,7 +49,7 @@ struct window; struct xwidget { - union vectorlike_header header; + struct vectorlike_header header; /* Auxiliary data. */ Lisp_Object plist; @@ -101,7 +101,7 @@ struct xwidget struct xwidget_view { - union vectorlike_header header; + struct vectorlike_header header; Lisp_Object model; Lisp_Object w; /* Here ends the lisp part. "w" is the marker field. */