* readelf.c (process_file_header): Handle e_phnum extension.
[deliverable/binutils-gdb.git] / binutils / resbin.c
index 7c8f5019641bb5fc84c1a495428938056021e164..1db98d0668ea86a24d3cd147977ed167c4d6ee85 100644 (file)
@@ -1,5 +1,5 @@
 /* resbin.c -- manipulate the Windows binary resource format.
-   Copyright 1997, 1998, 1999, 2002, 2003, 2007
+   Copyright 1997, 1998, 1999, 2002, 2003, 2005, 2006, 2007, 2009
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
    Rewritten by Kai Tietz, Onevision.
@@ -8,7 +8,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -21,6 +21,7 @@
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
+
 /* This file contains functions to convert between the binary resource
    format and the internal structures that we want to use.  The same
    binary resource format is used in both res and COFF files.  */
@@ -226,7 +227,7 @@ bin_to_res_menu (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length)
 {
   rc_res_resource *r;
   rc_menu *m;
-  rc_uint_type version, read;
+  rc_uint_type version, got;
 
   r = (rc_res_resource *) res_alloc (sizeof *r);
   r->type = RES_TYPE_MENU;
@@ -244,7 +245,7 @@ bin_to_res_menu (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length)
       if (length < 4)
        toosmall (_("menu header"));
       m->help = 0;
-      m->items = bin_to_res_menuitems (wrbfd, data + 4, length - 4, &read);
+      m->items = bin_to_res_menuitems (wrbfd, data + 4, length - 4, &got);
     }
   else if (version == 1)
     {
@@ -257,7 +258,7 @@ bin_to_res_menu (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length)
       if (offset + 4 >= length)
        toosmall (_("menuex offset"));
       m->items = bin_to_res_menuexitems (wrbfd, data + 4 + offset,
-                                        length - (4 + offset), &read);
+                                        length - (4 + offset), &got);
     }
   else
     fatal (_("unsupported menu version %d"), (int) version);
@@ -269,14 +270,14 @@ bin_to_res_menu (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length)
 
 static rc_menuitem *
 bin_to_res_menuitems (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length,
-                     rc_uint_type *read)
+                     rc_uint_type *got)
 {
   rc_menuitem *first, **pp;
 
   first = NULL;
   pp = &first;
 
-  *read = 0;
+  *got = 0;
 
   while (length > 0)
     {
@@ -333,7 +334,7 @@ bin_to_res_menuitems (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type len
 
       data += itemlen;
       length -= itemlen;
-      *read += itemlen;
+      *got += itemlen;
 
       if ((flags & MENUITEM_ENDMENU) != 0)
        return first;
@@ -346,14 +347,14 @@ bin_to_res_menuitems (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type len
 
 static rc_menuitem *
 bin_to_res_menuexitems (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length,
-                       rc_uint_type *read)
+                       rc_uint_type *got)
 {
   rc_menuitem *first, **pp;
 
   first = NULL;
   pp = &first;
 
-  *read = 0;
+  *got = 0;
 
   while (length > 0)
     {
@@ -407,7 +408,7 @@ bin_to_res_menuexitems (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type l
 
       data += itemlen;
       length -= itemlen;
-      *read += itemlen;
+      *got += itemlen;
 
       if ((flags & 0x80) != 0)
        return first;
This page took 0.02464 seconds and 4 git commands to generate.