diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2013-11-03 22:09:03 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2013-11-03 22:09:03 -0800 |
commit | 91f2d272895257f23596075a0cc42e6e5f4e490f (patch) | |
tree | 5bcf0c44acc54bd56eef8394e50ff7d4cc24d5b3 /src/xfaces.c | |
parent | 0a749fa0e64fc88bcd1772253774d7e44ecfe8ce (diff) | |
download | emacs-91f2d272895257f23596075a0cc42e6e5f4e490f.tar.gz |
Port to stricter C99 platforms.
Especially, C99 prohibits nesting a struct X inside struct Y if
struct X has a flexible array member.
Also, merge from gnulib, incorporating:
2013-11-03 intprops: port to Oracle Studio c99
* lib/intprops.h: Update from gnulib.
* src/alloc.c (struct sdata): New type.
(sdata): Implement in terms of struct sdata.
Remove u member; all uses replaced by next_vector, set_next_vector.
(SDATA_SELECTOR, SDATA_DATA, SDATA_DATA_OFFSET): Adjust to sdata change.
(SDATA_DATA_OFFSET): Now a constant, not a macro.
(struct sblock): Rename first_data member to data, which is now
a flexible array member. All uses changed.
(next_vector, set_next_vector, large_vector_vec): New functions.
(vector_alignment): New constant.
(roundup_size): Make it a multiple of ALIGNOF_STRUCT_LISP_VECTOR, too.
(struct large-vector): Now merely a NEXT member, since the old approach
ran afoul of stricter C99. All uses changed to use
large_vector_vec or large_vector_offset.
(large_vector_offset): New constant.
* src/dispnew.c: Include tparam.h, for tgetent.
Do not include term.h; no longer needed.
* src/gnutls.c (Fgnutls_boot): Don't continue after calling a _Noreturn.
* src/lisp.h (ENUM_BF) [__SUNPRO_C && __STDC__]: Use unsigned int.
(struct Lisp_Vector): Use a flexible array member for contents,
instead of a union with a member that is an array of size 1.
All uses changed.
(ALIGNOF_STRUCT_LISP_VECTOR): New constant, to make up for the
fact that the struct no longer contains a union.
(struct Lisp_Misc_Any, struct Lisp_Marker, struct Lisp_Overlay)
(struct Lisp_Save_Value, struct Lisp_Free):
Use unsigned, not int, for spacers, to avoid c99 warning.
(union specbinding): Use unsigned, not bool, for bitfield, as
bool is not portable to pre-C99 hosts.
Diffstat (limited to 'src/xfaces.c')
-rw-r--r-- | src/xfaces.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 7b88659e11d..6845e5c3c65 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1569,7 +1569,7 @@ the face font sort order. */) vec = Fvconcat (ndrivers, drivers); nfonts = ASIZE (vec); - qsort (XVECTOR (vec)->u.contents, nfonts, word_size, + qsort (XVECTOR (vec)->contents, nfonts, word_size, compare_fonts_by_sort_order); result = Qnil; @@ -1839,7 +1839,7 @@ check_lface (Lisp_Object lface) if (!NILP (lface)) { eassert (LFACEP (lface)); - check_lface_attrs (XVECTOR (lface)->u.contents); + check_lface_attrs (XVECTOR (lface)->contents); } } @@ -2016,7 +2016,7 @@ get_lface_attributes_no_remap (struct frame *f, Lisp_Object face_name, lface = lface_from_face_name_no_resolve (f, face_name, signal_p); if (! NILP (lface)) - memcpy (attrs, XVECTOR (lface)->u.contents, + memcpy (attrs, XVECTOR (lface)->contents, LFACE_VECTOR_SIZE * sizeof *attrs); return !NILP (lface); @@ -2706,7 +2706,7 @@ The value is TO. */) copy = Finternal_make_lisp_face (to, new_frame); } - vcopy (copy, 0, XVECTOR (lface)->u.contents, LFACE_VECTOR_SIZE); + vcopy (copy, 0, XVECTOR (lface)->contents, LFACE_VECTOR_SIZE); /* Changing a named face means that all realized faces depending on that face are invalid. Since we cannot tell which realized faces @@ -3126,7 +3126,7 @@ FRAME 0 means change the face on all frames, and change the default f = XFRAME (frame); if (! FONT_OBJECT_P (value)) { - Lisp_Object *attrs = XVECTOR (lface)->u.contents; + Lisp_Object *attrs = XVECTOR (lface)->contents; Lisp_Object font_object; font_object = font_load_for_lface (f, attrs, value); @@ -3194,7 +3194,7 @@ FRAME 0 means change the face on all frames, and change the default the font to nil so that the font selector doesn't think that the attribute is mandatory. Also, clear the average width. */ - font_clear_prop (XVECTOR (lface)->u.contents, prop_index); + font_clear_prop (XVECTOR (lface)->contents, prop_index); } /* Changing a named face means that all realized faces depending on @@ -3224,7 +3224,7 @@ FRAME 0 means change the face on all frames, and change the default reflected in changed `font' frame parameters. */ if (FRAMEP (frame) && (prop_index || EQ (attr, QCfont)) - && lface_fully_specified_p (XVECTOR (lface)->u.contents)) + && lface_fully_specified_p (XVECTOR (lface)->contents)) set_font_frame_param (frame, lface); else #endif /* HAVE_WINDOW_SYSTEM */ @@ -3404,7 +3404,7 @@ set_font_frame_param (Lisp_Object frame, Lisp_Object lface) { if (FONT_SPEC_P (font)) { - font = font_load_for_lface (f, XVECTOR (lface)->u.contents, font); + font = font_load_for_lface (f, XVECTOR (lface)->contents, font); if (NILP (font)) return; ASET (lface, LFACE_FONT_INDEX, font); @@ -3763,8 +3763,8 @@ Default face attributes override any local face attributes. */) the local frame is defined from default specs in `face-defface-spec' and those should be overridden by global settings. Hence the strange "global before local" priority. */ - lvec = XVECTOR (local_lface)->u.contents; - gvec = XVECTOR (global_lface)->u.contents; + lvec = XVECTOR (local_lface)->contents; + gvec = XVECTOR (global_lface)->contents; for (i = 1; i < LFACE_VECTOR_SIZE; ++i) if (IGNORE_DEFFACE_P (gvec[i])) ASET (local_lface, i, Qunspecified); @@ -3948,8 +3948,8 @@ If FRAME is omitted or nil, use the selected frame. */) lface1 = lface_from_face_name (f, face1, 1); lface2 = lface_from_face_name (f, face2, 1); - equal_p = lface_equal_p (XVECTOR (lface1)->u.contents, - XVECTOR (lface2)->u.contents); + equal_p = lface_equal_p (XVECTOR (lface1)->contents, + XVECTOR (lface2)->contents); return equal_p ? Qt : Qnil; } @@ -4691,7 +4691,7 @@ DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector, Lisp_Object lface; lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE), Qunspecified); - merge_face_ref (XFRAME (selected_frame), plist, XVECTOR (lface)->u.contents, + merge_face_ref (XFRAME (selected_frame), plist, XVECTOR (lface)->contents, 1, 0); return lface; } @@ -5377,9 +5377,9 @@ realize_default_face (struct frame *f) ASET (lface, LFACE_STIPPLE_INDEX, Qnil); /* Realize the face; it must be fully-specified now. */ - eassert (lface_fully_specified_p (XVECTOR (lface)->u.contents)); + eassert (lface_fully_specified_p (XVECTOR (lface)->contents)); check_lface (lface); - memcpy (attrs, XVECTOR (lface)->u.contents, sizeof attrs); + memcpy (attrs, XVECTOR (lface)->contents, sizeof attrs); face = realize_face (c, attrs, DEFAULT_FACE_ID); #ifdef HAVE_WINDOW_SYSTEM |