PR binutils/10792

* dlltool.c (dll_name_list_append): Declare variable at start
	of block.
	(dll_name_list_count, dll_name-list_print): Likewise.
This commit is contained in:
Alan Modra 2009-10-18 23:11:35 +00:00
parent fb2cd69a79
commit dabf22219e
2 changed files with 18 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2009-10-19 Jerker Bäck <jerker.back@gmail.com>
PR binutils/10792
* dlltool.c (dll_name_list_append): Declare variable at start
of block.
(dll_name_list_count, dll_name-list_print): Likewise.
2009-10-16 Doug Evans <dje@sebabeach.org> 2009-10-16 Doug Evans <dje@sebabeach.org>
* MAINTAINERS: Add myself as m32r maintainer. * MAINTAINERS: Add myself as m32r maintainer.

View File

@ -3192,13 +3192,15 @@ gen_lib_file (int delay)
static void static void
dll_name_list_append (dll_name_list_type * list, bfd_byte * data) dll_name_list_append (dll_name_list_type * list, bfd_byte * data)
{ {
dll_name_list_node_type * entry;
/* Error checking. */ /* Error checking. */
if (! list || ! list->tail) if (! list || ! list->tail)
return; return;
/* Allocate new node. */ /* Allocate new node. */
dll_name_list_node_type * entry = entry = ((dll_name_list_node_type *)
(dll_name_list_node_type *) xmalloc (sizeof (dll_name_list_node_type)); xmalloc (sizeof (dll_name_list_node_type)));
/* Initialize its values. */ /* Initialize its values. */
entry->dllname = xstrdup ((char *) data); entry->dllname = xstrdup ((char *) data);
@ -3214,12 +3216,14 @@ dll_name_list_append (dll_name_list_type * list, bfd_byte * data)
static int static int
dll_name_list_count (dll_name_list_type * list) dll_name_list_count (dll_name_list_type * list)
{ {
dll_name_list_node_type * p;
int count = 0;
/* Error checking. */ /* Error checking. */
if (! list || ! list->head) if (! list || ! list->head)
return 0; return 0;
int count = 0; p = list->head;
dll_name_list_node_type * p = list->head;
while (p && p->next) while (p && p->next)
{ {
@ -3234,11 +3238,13 @@ dll_name_list_count (dll_name_list_type * list)
static void static void
dll_name_list_print (dll_name_list_type * list) dll_name_list_print (dll_name_list_type * list)
{ {
dll_name_list_node_type * p;
/* Error checking. */ /* Error checking. */
if (! list || ! list->head) if (! list || ! list->head)
return; return;
dll_name_list_node_type * p = list->head; p = list->head;
while (p && p->next && p->next->dllname && *(p->next->dllname)) while (p && p->next && p->next->dllname && *(p->next->dllname))
{ {