summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-11-03 22:09:03 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2013-11-03 22:09:03 -0800
commit91f2d272895257f23596075a0cc42e6e5f4e490f (patch)
tree5bcf0c44acc54bd56eef8394e50ff7d4cc24d5b3 /src/indent.c
parent0a749fa0e64fc88bcd1772253774d7e44ecfe8ce (diff)
downloademacs-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/indent.c')
-rw-r--r--src/indent.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/indent.c b/src/indent.c
index d956e627ba9..891b42788ed 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
for (i = 0; i < 256; i++)
if (character_width (i, disptab)
- != XFASTINT (widthtab->u.contents[i]))
+ != XFASTINT (widthtab->contents[i]))
return 0;
return 1;
@@ -138,7 +138,7 @@ recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab)
eassert (widthtab->header.size == 256);
for (i = 0; i < 256; i++)
- XSETFASTINT (widthtab->u.contents[i], character_width (i, disptab));
+ XSETFASTINT (widthtab->contents[i], character_width (i, disptab));
}
/* 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,
width_run_cache_on_off ();
if (dp == buffer_display_table ())
width_table = (VECTORP (BVAR (current_buffer, width_table))
- ? XVECTOR (BVAR (current_buffer, width_table))->u.contents
+ ? XVECTOR (BVAR (current_buffer, width_table))->contents
: 0);
else
/* If the window has its own display table, we can't use the width