diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-19 16:28:31 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-19 16:28:31 +0000 |
commit | b54ed23c1b4dc393230ba445e7db31c48445e670 (patch) | |
tree | 9d3ab676b0aee602d1b50e5636f3aef072c535f4 /gcc/c-decl.c | |
parent | 6dd460aba278d91963eb9518e6751565cb3be54d (diff) | |
download | gcc-b54ed23c1b4dc393230ba445e7db31c48445e670.tar.gz |
* c-decl.c (add_flexible_array_elts_to_size): Simplify vector accesses.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109966 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 8320acaf651..d3bf14290c8 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3076,14 +3076,12 @@ set_array_declarator_inner (struct c_declarator *decl, static void add_flexible_array_elts_to_size (tree decl, tree init) { - unsigned int size; tree elt, type; - size = VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init)); - if (size == 0) + if (VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (init))) return; - elt = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (init), size - 1)->value; + elt = VEC_last (constructor_elt, CONSTRUCTOR_ELTS (init))->value; type = TREE_TYPE (elt); if (TREE_CODE (type) == ARRAY_TYPE && TYPE_SIZE (type) == NULL_TREE |