summaryrefslogtreecommitdiff
path: root/binutils/dlltool.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2009-10-18 23:11:35 +0000
committerAlan Modra <amodra@bigpond.net.au>2009-10-18 23:11:35 +0000
commitc1b989dea9b43ea959e9f9cd34f276d1214e5a3c (patch)
treeca73b9f4a88322c348fa3601086f8e5c46dd599d /binutils/dlltool.c
parent8f239317769776a830d92104a459caf443f2ff5f (diff)
downloadbinutils-redhat-c1b989dea9b43ea959e9f9cd34f276d1214e5a3c.tar.gz
PR binutils/10792
* dlltool.c (dll_name_list_append): Declare variable at start of block. (dll_name_list_count, dll_name-list_print): Likewise.
Diffstat (limited to 'binutils/dlltool.c')
-rw-r--r--binutils/dlltool.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index 759961e3d9..585c780708 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -3192,13 +3192,15 @@ gen_lib_file (int delay)
static void
dll_name_list_append (dll_name_list_type * list, bfd_byte * data)
{
+ dll_name_list_node_type * entry;
+
/* Error checking. */
if (! list || ! list->tail)
return;
/* Allocate new node. */
- dll_name_list_node_type * entry =
- (dll_name_list_node_type *) xmalloc (sizeof (dll_name_list_node_type));
+ entry = ((dll_name_list_node_type *)
+ xmalloc (sizeof (dll_name_list_node_type)));
/* Initialize its values. */
entry->dllname = xstrdup ((char *) data);
@@ -3214,12 +3216,14 @@ dll_name_list_append (dll_name_list_type * list, bfd_byte * data)
static int
dll_name_list_count (dll_name_list_type * list)
{
+ dll_name_list_node_type * p;
+ int count = 0;
+
/* Error checking. */
if (! list || ! list->head)
return 0;
- int count = 0;
- dll_name_list_node_type * p = list->head;
+ p = list->head;
while (p && p->next)
{
@@ -3234,11 +3238,13 @@ dll_name_list_count (dll_name_list_type * list)
static void
dll_name_list_print (dll_name_list_type * list)
{
+ dll_name_list_node_type * p;
+
/* Error checking. */
if (! list || ! list->head)
return;
- dll_name_list_node_type * p = list->head;
+ p = list->head;
while (p && p->next && p->next->dllname && *(p->next->dllname))
{