* ldlang.c: When traversing lang_statement_union_type lists,

consistently use "header.next" rather than "next".
	* mpw-eppcmac.c: Likewise.
	* emultempl/beos.em: Likewise.
	* emultempl/hppaelf.em: Likewise.
	* emultempl/pe.em: Likewise.
	* ldlang.h (union lang_statement_union): Remove "next" field.
This commit is contained in:
Alan Modra 2001-08-20 02:14:50 +00:00
parent c0c330a70f
commit bba1a0c062
6 changed files with 27 additions and 28 deletions

View File

@ -554,7 +554,7 @@ sort_sections_1 (startptr, next_after, count, sort_func)
vec = ((lang_statement_union_type **) vec = ((lang_statement_union_type **)
xmalloc (count * sizeof (lang_statement_union_type *))); xmalloc (count * sizeof (lang_statement_union_type *)));
for (p = *startptr, i = 0; i < count; i++, p = p->next) for (p = *startptr, i = 0; i < count; i++, p = p->header.next)
vec[i] = p; vec[i] = p;
qsort (vec, count, sizeof (vec[0]), sort_func); qsort (vec, count, sizeof (vec[0]), sort_func);
@ -587,7 +587,7 @@ static void
sort_sections (s) sort_sections (s)
lang_statement_union_type *s; lang_statement_union_type *s;
{ {
for (; s ; s = s->next) for (; s ; s = s->header.next)
switch (s->header.type) switch (s->header.type)
{ {
case lang_output_section_statement_enum: case lang_output_section_statement_enum:
@ -625,7 +625,7 @@ sort_sections (s)
for (end = start, count = 0; for (end = start, count = 0;
end && (end->header.type end && (end->header.type
== lang_input_section_enum); == lang_input_section_enum);
end = end->next) end = end->header.next)
count++; count++;
p = sort_sections_1 (p, end, count, p = sort_sections_1 (p, end, count,
@ -652,7 +652,7 @@ sort_sections (s)
lang_statement_union_type *end; lang_statement_union_type *end;
int count; int count;
for (end = *p, count = 0; end; end = end->next) for (end = *p, count = 0; end; end = end->header.next)
{ {
if (end->header.type != lang_input_section_enum) if (end->header.type != lang_input_section_enum)
abort (); abort ();
@ -772,7 +772,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
ps[0] = '\$'; ps[0] = '\$';
ps[1] = 0; ps[1] = 0;
for (l = os->children.head; l; l = l->next) for (l = os->children.head; l; l = l->header.next)
if (l->header.type == lang_wild_statement_enum) if (l->header.type == lang_wild_statement_enum)
{ {
struct wildcard_list *sec; struct wildcard_list *sec;

View File

@ -106,7 +106,7 @@ hook_in_stub (info, lp)
lang_statement_union_type *l; lang_statement_union_type *l;
boolean ret; boolean ret;
for (; (l = *lp) != NULL; lp = &l->next) for (; (l = *lp) != NULL; lp = &l->header.next)
{ {
switch (l->header.type) switch (l->header.type)
{ {

View File

@ -1703,7 +1703,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
sections. */ sections. */
found_dollar = false; found_dollar = false;
for ( ; *pl != NULL; pl = &(*pl)->next) for ( ; *pl != NULL; pl = &(*pl)->header.next)
{ {
lang_input_section_type *ls; lang_input_section_type *ls;
const char *lname; const char *lname;
@ -1730,7 +1730,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
if (add_child.head != NULL) if (add_child.head != NULL)
{ {
add_child.head->next = *pl; add_child.head->header.next = *pl;
*pl = add_child.head; *pl = add_child.head;
} }
} }

View File

@ -377,7 +377,7 @@ lang_for_each_statement_worker (func, s)
void (*func) PARAMS ((lang_statement_union_type *)); void (*func) PARAMS ((lang_statement_union_type *));
lang_statement_union_type *s; lang_statement_union_type *s;
{ {
for (; s != (lang_statement_union_type *) NULL; s = s->next) for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
{ {
func (s); func (s);
@ -1259,7 +1259,7 @@ wild_sort (wild, sec, file, section)
return NULL; return NULL;
section_name = bfd_get_section_name (file->the_bfd, section); section_name = bfd_get_section_name (file->the_bfd, section);
for (l = wild->children.head; l != NULL; l = l->next) for (l = wild->children.head; l != NULL; l = l->header.next)
{ {
lang_input_section_type *ls; lang_input_section_type *ls;
@ -1389,14 +1389,14 @@ output_section_callback (ptr, sec, section, file, output)
be NULL. */ be NULL. */
if (list.head != NULL) if (list.head != NULL)
{ {
ASSERT (list.head->next == NULL); ASSERT (list.head->header.next == NULL);
for (pp = &ptr->children.head; for (pp = &ptr->children.head;
*pp != before; *pp != before;
pp = &(*pp)->next) pp = &(*pp)->header.next)
ASSERT (*pp != NULL); ASSERT (*pp != NULL);
list.head->next = *pp; list.head->header.next = *pp;
*pp = list.head; *pp = list.head;
} }
} }
@ -1906,7 +1906,7 @@ open_input_bfds (s, force)
lang_statement_union_type *s; lang_statement_union_type *s;
boolean force; boolean force;
{ {
for (; s != (lang_statement_union_type *) NULL; s = s->next) for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
{ {
switch (s->header.type) switch (s->header.type)
{ {
@ -1967,8 +1967,8 @@ open_input_bfds (s, force)
if (add.head != NULL) if (add.head != NULL)
{ {
*add.tail = s->next; *add.tail = s->header.next;
s->next = add.head; s->header.next = add.head;
} }
} }
break; break;
@ -2062,7 +2062,7 @@ map_input_to_output_sections (s, target, output_section_statement)
const char *target; const char *target;
lang_output_section_statement_type *output_section_statement; lang_output_section_statement_type *output_section_statement;
{ {
for (; s != (lang_statement_union_type *) NULL; s = s->next) for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
{ {
switch (s->header.type) switch (s->header.type)
{ {
@ -2513,7 +2513,7 @@ print_statement_list (s, os)
while (s != NULL) while (s != NULL)
{ {
print_statement (s, os); print_statement (s, os);
s = s->next; s = s->header.next;
} }
} }
@ -2619,7 +2619,7 @@ dprint_statement (s, n)
while (s && --n >= 0) while (s && --n >= 0)
{ {
print_statement (s, abs_output_section); print_statement (s, abs_output_section);
s = s->next; s = s->header.next;
} }
} }
@ -2832,7 +2832,7 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
ldfile_output_machine); ldfile_output_machine);
/* Size up the sections from their constituent parts. */ /* Size up the sections from their constituent parts. */
for (; s != (lang_statement_union_type *) NULL; s = s->next) for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
{ {
switch (s->header.type) switch (s->header.type)
{ {
@ -2855,7 +2855,7 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
asection *input; asection *input;
if (os->children.head == NULL if (os->children.head == NULL
|| os->children.head->next != NULL || os->children.head->header.next != NULL
|| os->children.head->header.type != lang_input_section_enum) || os->children.head->header.type != lang_input_section_enum)
einfo (_("%P%X: Internal error on COFF shared library section %s\n"), einfo (_("%P%X: Internal error on COFF shared library section %s\n"),
os->name); os->name);
@ -3197,7 +3197,7 @@ lang_do_assignments (s, output_section_statement, fill, dot)
unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine); ldfile_output_machine);
for (; s != (lang_statement_union_type *) NULL; s = s->next) for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
{ {
switch (s->header.type) switch (s->header.type)
{ {
@ -4006,7 +4006,7 @@ static void
lang_gc_sections_1 (s) lang_gc_sections_1 (s)
lang_statement_union_type *s; lang_statement_union_type *s;
{ {
for (; s != (lang_statement_union_type *) NULL; s = s->next) for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
{ {
switch (s->header.type) switch (s->header.type)
{ {

View File

@ -290,7 +290,6 @@ typedef struct {
typedef union lang_statement_union { typedef union lang_statement_union {
lang_statement_header_type header; lang_statement_header_type header;
union lang_statement_union *next;
lang_wild_statement_type wild_statement; lang_wild_statement_type wild_statement;
lang_data_statement_type data_statement; lang_data_statement_type data_statement;
lang_reloc_statement_type reloc_statement; lang_reloc_statement_type reloc_statement;

View File

@ -572,13 +572,13 @@ gldppcmacos_before_allocation ()
if (os == NULL) if (os == NULL)
einfo (_("%P%F: can't find output section %s\n"), einfo (_("%P%F: can't find output section %s\n"),
sec->output_section->name); sec->output_section->name);
for (pls = &os->children.head; *pls != NULL; pls = &(*pls)->next) for (pls = &os->children.head; *pls != NULL; pls = &(*pls)->header.next)
{ {
if ((*pls)->header.type == lang_input_section_enum if ((*pls)->header.type == lang_input_section_enum
&& (*pls)->input_section.section == sec) && (*pls)->input_section.section == sec)
{ {
is = (lang_input_section_type *) *pls; is = (lang_input_section_type *) *pls;
*pls = (*pls)->next; *pls = (*pls)->header.next;
break; break;
} }
if ((*pls)->header.type == lang_wild_statement_enum) if ((*pls)->header.type == lang_wild_statement_enum)
@ -587,13 +587,13 @@ gldppcmacos_before_allocation ()
for (pwls = &(*pls)->wild_statement.children.head; for (pwls = &(*pls)->wild_statement.children.head;
*pwls != NULL; *pwls != NULL;
pwls = &(*pwls)->next) pwls = &(*pwls)->header.next)
{ {
if ((*pwls)->header.type == lang_input_section_enum if ((*pwls)->header.type == lang_input_section_enum
&& (*pwls)->input_section.section == sec) && (*pwls)->input_section.section == sec)
{ {
is = (lang_input_section_type *) *pwls; is = (lang_input_section_type *) *pwls;
*pwls = (*pwls)->next; *pwls = (*pwls)->header.next;
break; break;
} }
} }