From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22411 invoked by alias); 16 Apr 2007 09:22:03 -0000 Received: (qmail 22077 invoked by uid 22791); 16 Apr 2007 09:21:52 -0000 X-Spam-Check-By: sourceware.org Received: from outdoor.onevision.de (HELO outdoor.onevision.de) (212.77.172.51) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 16 Apr 2007 10:21:34 +0100 Received: from sanders.onevision.de (moonrace [212.77.172.62]) by outdoor.onevision.de (8.13.7/8.13.7/ROSCH/DDB) with ESMTP id l3G9Kw3O020590; Mon, 16 Apr 2007 11:21:03 +0200 In-Reply-To: <20070413144106.GA28469@lucon.org> To: "H. J. Lu" Cc: binutils@sources.redhat.com Subject: Re: PATCH: windres MIME-Version: 1.0 X-Mailer: Lotus Notes Release 7.0.1 January 17, 2006 Message-ID: From: Kai Tietz Date: Mon, 16 Apr 2007 10:05:00 -0000 Content-Type: multipart/mixed; boundary="=_mixed 0033582EC12572BF_=" X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00206.txt.bz2 --=_mixed 0033582EC12572BF_= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 Content-length: 2774 IkguIEouIEx1IiA8aGpsQGx1Y29uLm9yZz4gd3JvdGUgb24gMTMuMDQuMjAw NyAxNjo0MTowNjoNCg0KPiA+IE5pZ2h0bWFyZXMsIC4uLiA4fCBJIGJlZ3Vu IHRvIG1vZGlmeSBzdHJ1Y3R1cmUgdXNpbmcgY2hhcmFjdGVyIGFycmF5cyAN Ci4uLiANCj4gPiBJIGNvbWUgdG8gdGhlIHBvaW50LCB0aGF0IHRoaXMgbWVh bnMgZm9yIGJpZyBwYXJ0cyBvZiB3aW5kcmVzIGJldHRlciBhIA0KDQo+ID4g Y29tcGxldGUgcmV3cml0ZS4gU3RydWN0dXJlcyB3aXRoIGludGVybmFsL2V4 dGVybmFsIHNjb3BlIGFuZCBkYXRhIA0KPiA+IG1vZGlmaWNhdGlvbnMgYXJl IHJlYWxseSB3aXJlZC4NCj4gPiBNYXkgd2Ugc2hvdWxkIGZpcnN0IHVzZSBt eSBsYXN0IHBhdGNoLCBzbyB0aGF0IHRoZSBwcm9ibGVtIGlzIHNvbHZlZCwg DQphbmQgDQo+ID4gdGhlbiBJIHdpbGwgYmVnaW4gdG8gcmVvcmdhbml6ZSB0 aGUgd2luZHJlcyB0b29sIHRvIGJlIGhvc3QgDQppZGVwZW5kZW50LiBCeSAN Cj4gPiB0aGlzIEkgY2FuIGFkZCBzb21lIG1pc3NpbmcgcmVzb3VyY2UgdHlw ZXMgdG8gaXQuDQo+ID4gDQo+ID4gV2hhdCBkbyB5b3UgdGhpbmsgYWJvdXQg bXkgc3VnZ2VzdGlvbiB0byBjb250aW51ZSA/DQo+ID4gDQo+IA0KPiBUaGF0 IGlzIGZpbmUgd2l0aCBtZS4gSWYgeW91IGRvIHRoaXMsIHlvdSBkb24ndCBu ZWVkIHRvIGhhbmRsZQ0KPiBlbmRpYW4gYW5kIGp1c3QgcmVwbGFjZSBsb25n IHdpdGggaW50IHNpbmNlIHlvdSB3aWxsIHJld3JpdGUgaXQNCj4gbGF0ZXIg YW55d2F5Lg0KDQpUaGlzIGlzIHRoZSBwYXRjaCBjaGFuZ2luZyB0aGUgd2lu ZHJlcyBzb3VyY2UgdXNpbmcgaW50IGluc3RlYWQgb2YgbG9uZy4gSSANCmJv b3RzdHJhcCBpdCBvbiBjeWd3aW4gMzIgYW5kIGZvciB4ODZfNjQtbWluZ3cu DQpUaGlzIHBhdGNoIGRvZXMgbm90IHNvbHZlIHRoZSBlbmRpYW4gcHJvYmxl bSwgcmVhc29uZWQgYnkgdGhlIHVzZSBvZiANCmZ3cml0ZS9mcmVhZC4NCkNo YW5nZUxvZyBmb3IgYmludXRpbHMvOg0KDQoyMDA3LTA0LTE2ICBLYWkgVGll dHogIDxLYWkuVGlldHpAb25ldmlzaW9uLmNvbT4NCg0KICAgICAgICAqIHJj bGV4Lmw6IFJlcGxhY2UgbG9uZyBieSBpbnQgdXNhZ2UuDQogICAgICAgICog cmNwYXJzZS55OiBMaWtld2lzZS4NCiAgICAgICAgKiByZXNiaW4uYzogTGlr ZXdpc2UuDQogICAgICAgICogcmVzY29mZi5jOiBMaWtld2lzZS4NCiAgICAg ICAgKiByZXNyYy5jOiBMaWtld2lzZS4NCiAgICAgICAgKiByZXNyZXMuYzog TGlrZXdpc2UuDQogICAgICAgICogd2luZHJlcy5oOiBMaWtld2lzZS4NCiAg ICAgICAgKiB3aW5kcmVzLmM6IExpa2V3aXNlLg0KICAgICAgICAobWFpbik6 IEFkZCBhc3NlcnQgaWYgc2l6ZW9mIGludCBoYXMgbm90IDQgYnl0ZQ0KICAg ICAgICBzaXplLg0KDQoNClJlZ2FyZHMsDQogaS5BLiBLYWkgVGlldHoNCg0K DQoNCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLQ0KICBPbmVWaXNpb24gU29mdHdhcmUgRW50d2lja2x1bmdzIEdtYkgg JiBDby4gS0cNCiAgRHIuLUxlby1SaXR0ZXItU3RyYcOfZSA5IC0gOTMwNDkg UmVnZW5zYnVyZw0KICBUZWw6ICs0OS4oMCk5NDEuNzgwMDQuMCAtIEZheDog KzQ5LigwKTk0MS43ODAwNC40ODkgLSB3d3cuT25lVmlzaW9uLmNvbQ0KICBD b21tZXJ6YmFuayBSZWdlbnNidXJnIC0gQkxaIDc1MCA0MDAgNjIgLSBLb250 byA2MDExMDUwDQogIEhhbmRlbHNyZWdpc3RlcjogSFJBIDY3NDQsIEFtdHNn ZXJpY2h0IFJlZ2Vuc2J1cmcNCiAgS29tcGxlbWVudMOkcmluOiBPbmVWaXNp b24gU29mdHdhcmUgRW50d2lja2x1bmdzIFZlcndhbHR1bmdzIEdtYkgNCiAg RHIuLUxlby1SaXR0ZXItU3RyYcOfZSA5IOKAkyA5MzA0OSBSZWdlbnNidXJn DQogIEhhbmRlbHNyZWdpc3RlcjogSFJCIDg5MzIsIEFtdHNnZXJpY2h0IFJl Z2Vuc2J1cmcgLSBHZXNjaMOkZnRzZsO8aHJlcjogDQpVbHJpa2UgRMO2aGxl ciwgTWFudWVsYSBLbHVnZXINCg0K --=_mixed 0033582EC12572BF_= Content-Type: text/plain; name="windres_int.txt" Content-Disposition: attachment; filename="windres_int.txt" Content-Transfer-Encoding: quoted-printable Content-length: 47779 Index: rclex.l =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/binutils/rclex.l,v retrieving revision 1.14 diff -B -b -u -r1.14 rclex.l --- rclex.l 12 Oct 2005 00:16:12 -0000 1.14 +++ rclex.l 16 Apr 2007 09:13:35 -0000 @@ -70,7 +70,7 @@ /* Local functions. */ =20 static void cpp_line (const char *); -static char *handle_quotes (const char *, unsigned long *); +static char *handle_quotes (const char *, unsigned int *); static char *get_string (int); =20 %} @@ -201,7 +201,7 @@ =20 ("\""[^\"\n]*"\""[ \t\n]*)+ { char *s; - unsigned long length; + unsigned int length; =20 s =3D handle_quotes (yytext, &length); if (! rcdata_mode) @@ -303,7 +303,7 @@ merged separated by whitespace are merged, as in C. */ =20 static char * -handle_quotes (const char *input, unsigned long *len) +handle_quotes (const char *input, unsigned int *len) { char *ret, *s; const char *t; Index: rcparse.y =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/binutils/rcparse.y,v retrieving revision 1.22 diff -B -b -u -r1.22 rcparse.y --- rcparse.y 8 May 2005 14:17:39 -0000 1.22 +++ rcparse.y 16 Apr 2007 09:13:36 -0000 @@ -45,14 +45,14 @@ /* This is used when building a style. It is modified by the nonterminal styleexpr. */ =20 -static unsigned long style; +static unsigned int style; =20 /* These are used when building a control. They are set before using control_params. */ =20 -static unsigned long base_style; -static unsigned long default_style; -static unsigned long class; +static unsigned int base_style; +static unsigned int default_style; +static unsigned int class; static struct res_id res_text_field; static unichar null_unichar; =20 @@ -88,16 +88,16 @@ } memflags; struct { - unsigned long val; + unsigned int val; /* Nonzero if this number was explicitly specified as long. */ int dword; } i; - unsigned long il; + unsigned int il; unsigned short is; const char *s; struct { - unsigned long length; + unsigned int length; const char *s; } ss; }; Index: resbin.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/binutils/resbin.c,v retrieving revision 1.10 diff -B -b -u -r1.10 resbin.c --- resbin.c 29 Mar 2006 00:24:28 -0000 1.10 +++ resbin.c 16 Apr 2007 09:13:37 -0000 @@ -40,39 +40,39 @@ static void toosmall (const char *); =20 static unichar *get_unicode - (const unsigned char *, unsigned long, int, int *); + (const unsigned char *, unsigned int, int, int *); static int get_resid - (struct res_id *, const unsigned char *, unsigned long, int); + (struct res_id *, const unsigned char *, unsigned int, int); static struct res_resource *bin_to_res_generic - (enum res_type, const unsigned char *, unsigned long); + (enum res_type, const unsigned char *, unsigned int); static struct res_resource *bin_to_res_cursor - (const unsigned char *, unsigned long, int); + (const unsigned char *, unsigned int, int); static struct res_resource *bin_to_res_menu - (const unsigned char *, unsigned long, int); + (const unsigned char *, unsigned int, int); static struct menuitem *bin_to_res_menuitems - (const unsigned char *, unsigned long, int, int *); + (const unsigned char *, unsigned int, int, int *); static struct menuitem *bin_to_res_menuexitems - (const unsigned char *, unsigned long, int, int *); + (const unsigned char *, unsigned int, int, int *); static struct res_resource *bin_to_res_dialog - (const unsigned char *, unsigned long, int); + (const unsigned char *, unsigned int, int); static struct res_resource *bin_to_res_string - (const unsigned char *, unsigned long, int); + (const unsigned char *, unsigned int, int); static struct res_resource *bin_to_res_fontdir - (const unsigned char *, unsigned long, int); + (const unsigned char *, unsigned int, int); static struct res_resource *bin_to_res_accelerators - (const unsigned char *, unsigned long, int); + (const unsigned char *, unsigned int, int); static struct res_resource *bin_to_res_rcdata - (const unsigned char *, unsigned long, int); + (const unsigned char *, unsigned int, int); static struct res_resource *bin_to_res_group_cursor - (const unsigned char *, unsigned long, int); + (const unsigned char *, unsigned int, int); static struct res_resource *bin_to_res_group_icon - (const unsigned char *, unsigned long, int); + (const unsigned char *, unsigned int, int); static struct res_resource *bin_to_res_version - (const unsigned char *, unsigned long, int); + (const unsigned char *, unsigned int, int); static struct res_resource *bin_to_res_userdata - (const unsigned char *, unsigned long, int); + (const unsigned char *, unsigned int, int); static void get_version_header - (const unsigned char *, unsigned long, int, const char *, + (const unsigned char *, unsigned int, int, const char *, unichar **, int *, int *, int *, int *); =20 /* Given a resource type ID, a pointer to data, a length, return a @@ -82,7 +82,7 @@ =20 struct res_resource * bin_to_res (struct res_id type, const unsigned char *data, - unsigned long length, int big_endian) + unsigned int length, int big_endian) { if (type.named) return bin_to_res_userdata (data, length, big_endian); @@ -135,7 +135,7 @@ /* Swap in a NULL terminated unicode string. */ =20 static unichar * -get_unicode (const unsigned char *data, unsigned long length, +get_unicode (const unsigned char *data, unsigned int length, int big_endian, int *retlen) { int c, i; @@ -144,7 +144,7 @@ c =3D 0; while (1) { - if (length < (unsigned long) c * 2 + 2) + if (length < (unsigned int) c * 2 + 2) toosmall (_("null terminated unicode string")); if (get_16 (big_endian, data + c * 2) =3D=3D 0) break; @@ -167,7 +167,7 @@ =20 static int get_resid (struct res_id *id, const unsigned char *data, - unsigned long length, int big_endian) + unsigned int length, int big_endian) { int first; =20 @@ -196,7 +196,7 @@ =20 struct res_resource * bin_to_res_generic (enum res_type type, const unsigned char *data, - unsigned long length) + unsigned int length) { struct res_resource *r; =20 @@ -211,7 +211,7 @@ /* Convert a cursor resource from binary. */ =20 struct res_resource * -bin_to_res_cursor (const unsigned char *data, unsigned long length, +bin_to_res_cursor (const unsigned char *data, unsigned int length, int big_endian) { struct cursor *c; @@ -236,7 +236,7 @@ /* Convert a menu resource from binary. */ =20 struct res_resource * -bin_to_res_menu (const unsigned char *data, unsigned long length, +bin_to_res_menu (const unsigned char *data, unsigned int length, int big_endian) { struct res_resource *r; @@ -286,7 +286,7 @@ /* Convert menu items from binary. */ =20 static struct menuitem * -bin_to_res_menuitems (const unsigned char *data, unsigned long length, +bin_to_res_menuitems (const unsigned char *data, unsigned int length, int big_endian, int *read) { struct menuitem *first, **pp; @@ -364,7 +364,7 @@ /* Convert menuex items from binary. */ =20 static struct menuitem * -bin_to_res_menuexitems (const unsigned char *data, unsigned long length, +bin_to_res_menuexitems (const unsigned char *data, unsigned int length, int big_endian, int *read) { struct menuitem *first, **pp; @@ -439,7 +439,7 @@ /* Convert a dialog resource from binary. */ =20 static struct res_resource * -bin_to_res_dialog (const unsigned char *data, unsigned long length, +bin_to_res_dialog (const unsigned char *data, unsigned int length, int big_endian) { int signature; @@ -625,7 +625,7 @@ /* Convert a stringtable resource from binary. */ =20 static struct res_resource * -bin_to_res_string (const unsigned char *data, unsigned long length, +bin_to_res_string (const unsigned char *data, unsigned int length, int big_endian) { struct stringtable *st; @@ -672,7 +672,7 @@ /* Convert a fontdir resource from binary. */ =20 static struct res_resource * -bin_to_res_fontdir (const unsigned char *data, unsigned long length, +bin_to_res_fontdir (const unsigned char *data, unsigned int length, int big_endian) { int c, i; @@ -742,7 +742,7 @@ /* Convert an accelerators resource from binary. */ =20 static struct res_resource * -bin_to_res_accelerators (const unsigned char *data, unsigned long length, +bin_to_res_accelerators (const unsigned char *data, unsigned int length, int big_endian) { struct accelerator *first, **pp; @@ -785,7 +785,7 @@ /* Convert an rcdata resource from binary. */ =20 static struct res_resource * -bin_to_res_rcdata (const unsigned char *data, unsigned long length, +bin_to_res_rcdata (const unsigned char *data, unsigned int length, int big_endian ATTRIBUTE_UNUSED) { struct rcdata_item *ri; @@ -808,7 +808,7 @@ /* Convert a group cursor resource from binary. */ =20 static struct res_resource * -bin_to_res_group_cursor (const unsigned char *data, unsigned long length, +bin_to_res_group_cursor (const unsigned char *data, unsigned int length, int big_endian) { int type, c, i; @@ -864,7 +864,7 @@ /* Convert a group icon resource from binary. */ =20 static struct res_resource * -bin_to_res_group_icon (const unsigned char *data, unsigned long length, +bin_to_res_group_icon (const unsigned char *data, unsigned int length, int big_endian) { int type, c, i; @@ -924,7 +924,7 @@ to the type, and *OFF to the offset to the children. */ =20 static void -get_version_header (const unsigned char *data, unsigned long length, +get_version_header (const unsigned char *data, unsigned int length, int big_endian, const char *key, unichar **pkey, int *len, int *vallen, int *type, int *off) { @@ -973,7 +973,7 @@ /* Convert a version resource from binary. */ =20 static struct res_resource * -bin_to_res_version (const unsigned char *data, unsigned long length, +bin_to_res_version (const unsigned char *data, unsigned int length, int big_endian) { int verlen, vallen, type, off; @@ -986,7 +986,7 @@ (unichar **) NULL, &verlen, &vallen, &type, &off); =20 if ((unsigned int) verlen !=3D length) - fatal (_("version length %d does not match resource length %lu"), + fatal (_("version length %d does not match resource length %u"), verlen, length); =20 if (type !=3D 0) @@ -999,7 +999,7 @@ fi =3D NULL; else { - unsigned long signature, fiv; + unsigned int signature, fiv; =20 if (vallen !=3D 52) fatal (_("unexpected fixed version information length %d"), vallen); @@ -1009,11 +1009,11 @@ =20 signature =3D get_32 (big_endian, data); if (signature !=3D 0xfeef04bd) - fatal (_("unexpected fixed version signature %lu"), signature); + fatal (_("unexpected fixed version signature %u"), signature); =20 fiv =3D get_32 (big_endian, data + 4); if (fiv !=3D 0 && fiv !=3D 0x10000) - fatal (_("unexpected fixed version info version %lu"), fiv); + fatal (_("unexpected fixed version info version %u"), fiv); =20 fi =3D (struct fixed_versioninfo *) res_alloc (sizeof *fi); =20 @@ -1192,7 +1192,7 @@ /* Convert an arbitrary user defined resource from binary. */ =20 static struct res_resource * -bin_to_res_userdata (const unsigned char *data, unsigned long length, +bin_to_res_userdata (const unsigned char *data, unsigned int length, int big_endian ATTRIBUTE_UNUSED) { struct rcdata_item *ri; @@ -1220,7 +1220,7 @@ =20 /* Local functions used to convert resources to binary format. */ =20 -static void dword_align_bin (struct bindata ***, unsigned long *); +static void dword_align_bin (struct bindata ***, unsigned int *); static struct bindata *resid_to_bin (struct res_id, int); static struct bindata *unicode_to_bin (const unichar *, int); static struct bindata *res_to_bin_accelerator @@ -1249,7 +1249,7 @@ static struct bindata *res_to_bin_versioninfo (const struct versioninfo *, int); static struct bindata *res_to_bin_generic - (unsigned long, const unsigned char *); + (unsigned int, const unsigned char *); =20 /* Convert a resource to binary. */ =20 @@ -1296,7 +1296,7 @@ boundary. It updates *PPP and *LENGTH. */ =20 static void -dword_align_bin (struct bindata ***ppp, unsigned long *length) +dword_align_bin (struct bindata ***ppp, unsigned int *length) { int add; struct bindata *d; @@ -1502,7 +1502,7 @@ { int dialogex; struct bindata *first, **pp; - unsigned long length; + unsigned int length; int off, c; struct dialog_control *dc; =20 @@ -1654,7 +1654,7 @@ put_16 (big_endian, 0, d->data); else { - unsigned long sublen; + unsigned int sublen; =20 dword_align_bin (&pp, &length); =20 @@ -1858,7 +1858,7 @@ res_to_bin_menuexitems (const struct menuitem *items, int big_endian) { struct bindata *first, **pp; - unsigned long length; + unsigned int length; const struct menuitem *mi; =20 first =3D NULL; @@ -1965,7 +1965,7 @@ =20 case RCDATA_WSTRING: { - unsigned long i; + unsigned int i; =20 d->length =3D ri->u.wstring.length * 2; d->data =3D (unsigned char *) reswr_alloc (d->length); @@ -2055,7 +2055,7 @@ res_to_bin_versioninfo (const struct versioninfo *versioninfo, int big_end= ian) { struct bindata *first, **pp; - unsigned long length; + unsigned int length; struct ver_info *vi; =20 first =3D (struct bindata *) reswr_alloc (sizeof *first); @@ -2114,7 +2114,7 @@ for (vi =3D versioninfo->var; vi !=3D NULL; vi =3D vi->next) { struct bindata *vid; - unsigned long vilen; + unsigned int vilen; =20 dword_align_bin (&pp, &length); =20 @@ -2138,7 +2138,7 @@ =20 case VERINFO_STRING: { - unsigned long hold, vslen; + unsigned int hold, vslen; struct bindata *vsd; const struct ver_stringinfo *vs; =20 @@ -2174,7 +2174,7 @@ for (vs =3D vi->u.string.strings; vs !=3D NULL; vs =3D vs->next) { struct bindata *vssd; - unsigned long vsslen; + unsigned int vsslen; =20 hold =3D length; dword_align_bin (&pp, &length); @@ -2226,7 +2226,7 @@ =20 case VERINFO_VAR: { - unsigned long hold, vvlen, vvvlen; + unsigned int hold, vvlen, vvvlen; struct bindata *vvd; const struct ver_varinfo *vv; =20 @@ -2304,7 +2304,7 @@ /* Convert a generic resource to binary. */ =20 static struct bindata * -res_to_bin_generic (unsigned long length, const unsigned char *data) +res_to_bin_generic (unsigned int length, const unsigned char *data) { struct bindata *d; =20 Index: rescoff.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/binutils/rescoff.c,v retrieving revision 1.7 diff -B -b -u -r1.7 rescoff.c --- rescoff.c 8 May 2005 14:17:39 -0000 1.7 +++ rescoff.c 16 Apr 2007 09:13:37 -0000 @@ -209,7 +209,7 @@ =20 for (i =3D 0; i < name_count; i++, ere++) { - unsigned long name, rva; + unsigned int name, rva; struct res_entry *re; const bfd_byte *ers; int length, j; @@ -263,7 +263,7 @@ =20 for (i =3D 0; i < id_count; i++, ere++) { - unsigned long name, rva; + unsigned int name, rva; struct res_entry *re; =20 if ((const bfd_byte *) ere >=3D finfo->data_end) @@ -311,7 +311,7 @@ { const struct extern_res_data *erd; struct res_resource *r; - unsigned long size, rva; + unsigned int size, rva; const bfd_byte *resdata; =20 if (type =3D=3D NULL) @@ -351,7 +351,7 @@ /* The last structure we have added to the list. */ struct bindata *last; /* The size of the list as a whole. */ - unsigned long length; + unsigned int length; }; =20 /* This structure keeps track of information as we build the directory @@ -369,11 +369,11 @@ =20 /* These fields are computed initially, and then not changed. */ /* Length of directory tables and entries. */ - unsigned long dirsize; + unsigned int dirsize; /* Length of directory entry strings. */ - unsigned long dirstrsize; + unsigned int dirstrsize; /* Length of resource data entries. */ - unsigned long dataentsize; + unsigned int dataentsize; =20 /* These fields are updated as we add data. */ /* Directory tables and entries. */ @@ -421,7 +421,7 @@ asection *sec; struct coff_write_info cwi; struct bindata *d; - unsigned long length, offset; + unsigned int length, offset; =20 if (filename =3D=3D NULL) fatal (_("filename required for COFF output")); @@ -701,7 +701,7 @@ arelent *r; struct extern_res_data *erd; struct bindata *d; - unsigned long length; + unsigned int length; =20 /* For some reason, although every other address is a section offset, the address of the resource data itself is an RVA. That Index: resrc.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/binutils/resrc.c,v retrieving revision 1.27 diff -B -b -u -r1.27 resrc.c --- resrc.c 8 May 2005 14:17:39 -0000 1.27 +++ resrc.c 16 Apr 2007 09:13:39 -0000 @@ -110,9 +110,9 @@ } cursor; } u; /* Bytes in image. */ - unsigned long bytes; + unsigned int bytes; /* File offset of image. */ - unsigned long offset; + unsigned int offset; }; =20 /* The name of the rc file we are reading. */ @@ -169,8 +169,8 @@ static void close_input_stream (void); static void unexpected_eof (const char *); static int get_word (FILE *, const char *); -static unsigned long get_long (FILE *, const char *); -static void get_data (FILE *, unsigned char *, unsigned long, const char *= ); +static unsigned int get_long (FILE *, const char *); +static void get_data (FILE *, unsigned char *, unsigned int, const char *); static void define_fontdirs (void); =0C /* Run `cmd' and redirect the output to `redir'. */ @@ -555,7 +555,7 @@ /* Read a 32 bit word from a file. The data is assumed to be little endian. */ =20 -static unsigned long +static unsigned int get_long (FILE *e, const char *msg) { int b1, b2, b3, b4; @@ -575,15 +575,15 @@ /* Read data from a file. This is a wrapper to do error checking. */ =20 static void -get_data (FILE *e, unsigned char *p, unsigned long c, const char *msg) +get_data (FILE *e, unsigned char *p, unsigned int c, const char *msg) { - unsigned long got; + unsigned int got; =20 got =3D fread (p, 1, c, e); if (got =3D=3D c) return; =20 - fatal (_("%s: read of %lu returned %lu"), msg, c, got); + fatal (_("%s: read of %u returned %u"), msg, c, got); } =0C /* Define an accelerator resource. */ @@ -704,7 +704,7 @@ struct cursor *c; =20 if (fseek (e, icondirs[i].offset, SEEK_SET) !=3D 0) - fatal (_("%s: fseek to %lu failed: %s"), real_filename, + fatal (_("%s: fseek to %u failed: %s"), real_filename, icondirs[i].offset, strerror (errno)); =20 data =3D (unsigned char *) res_alloc (icondirs[i].bytes); @@ -788,10 +788,10 @@ merely allocates and fills in a structure. */ =20 struct dialog_control * -define_control (const struct res_id iid, unsigned long id, unsigned long x, - unsigned long y, unsigned long width, unsigned long height, - unsigned long class, unsigned long style, - unsigned long exstyle) +define_control (const struct res_id iid, unsigned int id, unsigned int x, + unsigned int y, unsigned int width, unsigned int height, + unsigned int class, unsigned int style, + unsigned int exstyle) { struct dialog_control *n; =20 @@ -814,9 +814,9 @@ } =20 struct dialog_control * -define_icon_control (struct res_id iid, unsigned long id, unsigned long x, - unsigned long y, unsigned long style, - unsigned long exstyle, unsigned long help, +define_icon_control (struct res_id iid, unsigned int id, unsigned int x, + unsigned int y, unsigned int style, + unsigned int exstyle, unsigned int help, struct rcdata_item *data, struct dialog_ex *ex) { struct dialog_control *n; @@ -1000,7 +1000,7 @@ struct res_id name; =20 if (fseek (e, icondirs[i].offset, SEEK_SET) !=3D 0) - fatal (_("%s: fseek to %lu failed: %s"), real_filename, + fatal (_("%s: fseek to %u failed: %s"), real_filename, icondirs[i].offset, strerror (errno)); =20 data =3D (unsigned char *) res_alloc (icondirs[i].bytes); @@ -1095,8 +1095,8 @@ allocates and fills in a structure. */ =20 struct menuitem * -define_menuitem (const char *text, int menuid, unsigned long type, - unsigned long state, unsigned long help, +define_menuitem (const char *text, int menuid, unsigned int type, + unsigned int state, unsigned int help, struct menuitem *menuitems) { struct menuitem *mi; @@ -1168,7 +1168,7 @@ /* Create an rcdata item holding a string. */ =20 struct rcdata_item * -define_rcdata_string (const char *string, unsigned long len) +define_rcdata_string (const char *string, unsigned int len) { struct rcdata_item *ri; char *s; @@ -1187,7 +1187,7 @@ /* Create an rcdata item holding a number. */ =20 struct rcdata_item * -define_rcdata_number (unsigned long val, int dword) +define_rcdata_number (unsigned int val, int dword) { struct rcdata_item *ri; =20 @@ -1204,7 +1204,7 @@ =20 void define_stringtable (const struct res_res_info *resinfo, - unsigned long stringid, const char *string) + unsigned int stringid, const char *string) { struct res_id id; struct res_resource *r; @@ -1414,8 +1414,8 @@ /* Append version variable information to a list. */ =20 struct ver_varinfo * -append_vertrans (struct ver_varinfo *var, unsigned long language, - unsigned long charset) +append_vertrans (struct ver_varinfo *var, unsigned int language, + unsigned int charset) { struct ver_varinfo *vv, **pp; =20 @@ -1456,7 +1456,7 @@ static void write_rc_stringtable (FILE *, const struct res_id *, const struct stringtable *); static void write_rc_versioninfo (FILE *, const struct versioninfo *); -static void write_rc_filedata (FILE *, unsigned long, const unsigned char = *); +static void write_rc_filedata (FILE *, unsigned int, const unsigned char *= ); =20 /* Indent a given number of spaces. */ =20 @@ -1515,9 +1515,9 @@ /* Print out some COFF information that rc files can't represent. */ =20 if (rd->time !=3D 0) - fprintf (e, "// Time stamp: %lu\n", rd->time); + fprintf (e, "// Time stamp: %u\n", rd->time); if (rd->characteristics !=3D 0) - fprintf (e, "// Characteristics: %lu\n", rd->characteristics); + fprintf (e, "// Characteristics: %u\n", rd->characteristics); if (rd->major !=3D 0 || rd->minor !=3D 0) fprintf (e, "// Version: %d %d\n", rd->major, rd->minor); =20 @@ -1543,10 +1543,10 @@ /* If we're at level 3, then this key represents a language. Use it to update the current language. */ if (! re->id.named - && re->id.u.id !=3D (unsigned long) (unsigned int) *language + && re->id.u.id !=3D (unsigned int) (unsigned int) *language && (re->id.u.id & 0xffff) =3D=3D re->id.u.id) { - fprintf (e, "LANGUAGE %lu, %lu\n", + fprintf (e, "LANGUAGE %u, %u\n", re->id.u.id & ((1 << SUBLANG_SHIFT) - 1), (re->id.u.id >> SUBLANG_SHIFT) & 0xff); *language =3D re->id.u.id; @@ -1766,7 +1766,7 @@ =20 if (rt !=3D 0 && type !=3D NULL - && (type->named || type->u.id !=3D (unsigned long) rt)) + && (type->named || type->u.id !=3D (unsigned int) rt)) { fprintf (e, "// Unexpected resource type mismatch: "); res_id_print (e, *type, 1); @@ -1774,9 +1774,9 @@ } =20 if (res->coff_info.codepage !=3D 0) - fprintf (e, "// Code page: %lu\n", res->coff_info.codepage); + fprintf (e, "// Code page: %u\n", res->coff_info.codepage); if (res->coff_info.reserved !=3D 0) - fprintf (e, "// COFF reserved value: %lu\n", res->coff_info.reserved); + fprintf (e, "// COFF reserved value: %u\n", res->coff_info.reserved); =20 if (name !=3D NULL) res_id_print (e, *name, 0); @@ -1809,7 +1809,7 @@ res->u.dialog->width, res->u.dialog->height); if (res->u.dialog->ex !=3D NULL && res->u.dialog->ex->help !=3D 0) - fprintf (e, ", %lu", res->u.dialog->ex->help); + fprintf (e, ", %u", res->u.dialog->ex->help); } =20 fprintf (e, "\n"); @@ -1841,11 +1841,11 @@ res->res_info.language & ((1<res_info.language >> SUBLANG_SHIFT) & 0xff); if (res->res_info.characteristics !=3D 0) - fprintf (e, "%sCHARACTERISTICS %lu\n", + fprintf (e, "%sCHARACTERISTICS %u\n", modifiers ? "// " : "", res->res_info.characteristics); if (res->res_info.version !=3D 0) - fprintf (e, "%sVERSION %lu\n", + fprintf (e, "%sVERSION %u\n", modifiers ? "// " : "", res->res_info.version); } @@ -1981,7 +1981,7 @@ { fprintf (e, "// width: %d; height %d; planes %d; bits %d\n", gc->width, gc->height, gc->planes, gc->bits); - fprintf (e, "// data bytes: %lu; index: %d\n", + fprintf (e, "// data bytes: %u; index: %d\n", gc->bytes, gc->index); } } @@ -1993,10 +1993,10 @@ { const struct dialog_control *control; =20 - fprintf (e, "STYLE 0x%lx\n", dialog->style); + fprintf (e, "STYLE 0x%x\n", dialog->style); =20 if (dialog->exstyle !=3D 0) - fprintf (e, "EXSTYLE 0x%lx\n", dialog->exstyle); + fprintf (e, "EXSTYLE 0x%x\n", dialog->exstyle); =20 if ((dialog->class.named && dialog->class.u.n.length > 0) || dialog->class.u.id !=3D 0) @@ -2050,7 +2050,7 @@ { const char *name; unsigned short class; - unsigned long style; + unsigned int style; }; =20 static const struct control_info control_info[] =3D @@ -2059,23 +2059,23 @@ { "AUTOCHECKBOX", CTL_BUTTON, BS_AUTOCHECKBOX }, { "AUTORADIOBUTTON", CTL_BUTTON, BS_AUTORADIOBUTTON }, { "CHECKBOX", CTL_BUTTON, BS_CHECKBOX }, - { "COMBOBOX", CTL_COMBOBOX, (unsigned long) -1 }, + { "COMBOBOX", CTL_COMBOBOX, (unsigned int) -1 }, { "CTEXT", CTL_STATIC, SS_CENTER }, { "DEFPUSHBUTTON", CTL_BUTTON, BS_DEFPUSHBUTTON }, - { "EDITTEXT", CTL_EDIT, (unsigned long) -1 }, + { "EDITTEXT", CTL_EDIT, (unsigned int) -1 }, { "GROUPBOX", CTL_BUTTON, BS_GROUPBOX }, { "ICON", CTL_STATIC, SS_ICON }, - { "LISTBOX", CTL_LISTBOX, (unsigned long) -1 }, + { "LISTBOX", CTL_LISTBOX, (unsigned int) -1 }, { "LTEXT", CTL_STATIC, SS_LEFT }, { "PUSHBOX", CTL_BUTTON, BS_PUSHBOX }, { "PUSHBUTTON", CTL_BUTTON, BS_PUSHBUTTON }, { "RADIOBUTTON", CTL_BUTTON, BS_RADIOBUTTON }, { "RTEXT", CTL_STATIC, SS_RIGHT }, - { "SCROLLBAR", CTL_SCROLLBAR, (unsigned long) -1 }, + { "SCROLLBAR", CTL_SCROLLBAR, (unsigned int) -1 }, { "STATE3", CTL_BUTTON, BS_3STATE }, /* It's important that USERBUTTON come after all the other button types, so that it won't be matched too early. */ - { "USERBUTTON", CTL_BUTTON, (unsigned long) -1 }, + { "USERBUTTON", CTL_BUTTON, (unsigned int) -1 }, { NULL, 0, 0 } }; =20 @@ -2094,7 +2094,7 @@ { for (ci =3D control_info; ci->name !=3D NULL; ++ci) if (ci->class =3D=3D control->class.u.id - && (ci->style =3D=3D (unsigned long) -1 + && (ci->style =3D=3D (unsigned int) -1 || ci->style =3D=3D (control->style & 0xff))) break; } @@ -2121,7 +2121,7 @@ res_id_print (e, control->class, 0); if (control->class.named) fprintf (e, "\""); - fprintf (e, ", 0x%lx, ", control->style); + fprintf (e, ", 0x%x, ", control->style); } =20 fprintf (e, "%d, %d", control->x, control->y); @@ -2137,10 +2137,10 @@ /* FIXME: We don't need to print the style if it is the default. More importantly, in certain cases we actually need to turn off parts of the forced style, by using NOT. */ - fprintf (e, ", 0x%lx", control->style); + fprintf (e, ", 0x%x", control->style); =20 if (control->exstyle !=3D 0 || control->help !=3D 0) - fprintf (e, ", 0x%lx, %lu", control->exstyle, control->help); + fprintf (e, ", 0x%x, %u", control->exstyle, control->help); } =20 fprintf (e, "\n"); @@ -2176,7 +2176,7 @@ { fprintf (e, "// width: %d; height %d; colors: %d; planes %d; bits %d= \n", gi->width, gi->height, gi->colors, gi->planes, gi->bits); - fprintf (e, "// data bytes: %lu; index: %d\n", + fprintf (e, "// data bytes: %u; index: %d\n", gi->bytes, gi->index); } } @@ -2187,7 +2187,7 @@ write_rc_menu (FILE *e, const struct menu *menu, int menuex) { if (menu->help !=3D 0) - fprintf (e, "// Help ID: %lu\n", menu->help); + fprintf (e, "// Help ID: %u\n", menu->help); write_rc_menuitems (e, menu->items, menuex, 0); } =20 @@ -2255,12 +2255,12 @@ fprintf (e, ", %d", mi->id); if (mi->type !=3D 0 || mi->state !=3D 0 || mi->help !=3D 0) { - fprintf (e, ", %lu", mi->type); + fprintf (e, ", %u", mi->type); if (mi->state !=3D 0 || mi->help !=3D 0) { - fprintf (e, ", %lu", mi->state); + fprintf (e, ", %u", mi->state); if (mi->help !=3D 0) - fprintf (e, ", %lu", mi->help); + fprintf (e, ", %u", mi->help); } } } @@ -2304,13 +2304,13 @@ break; =20 case RCDATA_DWORD: - fprintf (e, "%luL", ri->u.dword); + fprintf (e, "%uL", ri->u.dword); break; =20 case RCDATA_STRING: { const char *s; - unsigned long i; + unsigned int i; =20 fprintf (e, "\""); s =3D ri->u.string.s; @@ -2333,7 +2333,7 @@ =20 case RCDATA_BUFFER: { - unsigned long i; + unsigned int i; int first; =20 /* Assume little endian data. */ @@ -2341,7 +2341,7 @@ first =3D 1; for (i =3D 0; i + 3 < ri->u.buffer.length; i +=3D 4) { - unsigned long l; + unsigned int l; int j; =20 if (! first) @@ -2350,7 +2350,7 @@ | ri->u.buffer.data[i + 2]) << 8) | ri->u.buffer.data[i + 1]) << 8) | ri->u.buffer.data[i]); - fprintf (e, "%luL", l); + fprintf (e, "%uL", l); if (i + 4 < ri->u.buffer.length || ri->next !=3D NULL) fprintf (e, ","); for (j =3D 0; j < 4; ++j) @@ -2448,7 +2448,7 @@ write_rc_stringtable (FILE *e, const struct res_id *name, const struct stringtable *stringtable) { - unsigned long offset; + unsigned int offset; int i; =20 if (name !=3D NULL && ! name->named) @@ -2466,7 +2466,7 @@ { if (stringtable->strings[i].length !=3D 0) { - fprintf (e, " %lu, \"", offset + i); + fprintf (e, " %u, \"", offset + i); unicode_print (e, stringtable->strings[i].string, stringtable->strings[i].length); fprintf (e, "\"\n"); @@ -2486,29 +2486,29 @@ =20 f =3D versioninfo->fixed; if (f->file_version_ms !=3D 0 || f->file_version_ls !=3D 0) - fprintf (e, " FILEVERSION %lu, %lu, %lu, %lu\n", + fprintf (e, " FILEVERSION %u, %u, %u, %u\n", (f->file_version_ms >> 16) & 0xffff, f->file_version_ms & 0xffff, (f->file_version_ls >> 16) & 0xffff, f->file_version_ls & 0xffff); if (f->product_version_ms !=3D 0 || f->product_version_ls !=3D 0) - fprintf (e, " PRODUCTVERSION %lu, %lu, %lu, %lu\n", + fprintf (e, " PRODUCTVERSION %u, %u, %u, %u\n", (f->product_version_ms >> 16) & 0xffff, f->product_version_ms & 0xffff, (f->product_version_ls >> 16) & 0xffff, f->product_version_ls & 0xffff); if (f->file_flags_mask !=3D 0) - fprintf (e, " FILEFLAGSMASK 0x%lx\n", f->file_flags_mask); + fprintf (e, " FILEFLAGSMASK 0x%x\n", f->file_flags_mask); if (f->file_flags !=3D 0) - fprintf (e, " FILEFLAGS 0x%lx\n", f->file_flags); + fprintf (e, " FILEFLAGS 0x%x\n", f->file_flags); if (f->file_os !=3D 0) - fprintf (e, " FILEOS 0x%lx\n", f->file_os); + fprintf (e, " FILEOS 0x%x\n", f->file_os); if (f->file_type !=3D 0) - fprintf (e, " FILETYPE 0x%lx\n", f->file_type); + fprintf (e, " FILETYPE 0x%x\n", f->file_type); if (f->file_subtype !=3D 0) - fprintf (e, " FILESUBTYPE 0x%lx\n", f->file_subtype); + fprintf (e, " FILESUBTYPE 0x%x\n", f->file_subtype); if (f->file_date_ms !=3D 0 || f->file_date_ls !=3D 0) - fprintf (e, "// Date: %lu, %lu\n", f->file_date_ms, f->file_date_ls); + fprintf (e, "// Date: %u, %u\n", f->file_date_ms, f->file_date_ls); =20 fprintf (e, "BEGIN\n"); =20 @@ -2568,13 +2568,13 @@ /* Write out data which would normally be read from a file. */ =20 static void -write_rc_filedata (FILE *e, unsigned long length, const unsigned char *dat= a) +write_rc_filedata (FILE *e, unsigned int length, const unsigned char *data) { - unsigned long i; + unsigned int i; =20 for (i =3D 0; i + 15 < length; i +=3D 16) { - fprintf (e, "// %4lx: ", i); + fprintf (e, "// %4x: ", i); fprintf (e, "%02x %02x %02x %02x %02x %02x %02x %02x ", data[i + 0], data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7]); @@ -2585,7 +2585,7 @@ =20 if (i < length) { - fprintf (e, "// %4lx:", i); + fprintf (e, "// %4x:", i); while (i < length) { fprintf (e, " %02x", data[i]); Index: resres.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/binutils/resres.c,v retrieving revision 1.7 diff -B -b -u -r1.7 resres.c --- resres.c 16 Jun 2005 09:18:19 -0000 1.7 +++ resres.c 16 Apr 2007 09:13:39 -0000 @@ -33,8 +33,8 @@ =20 struct res_hdr { - unsigned long data_size; - unsigned long header_size; + unsigned int data_size; + unsigned int header_size; }; =20 static void write_res_directory @@ -52,7 +52,7 @@ static void write_res_info PARAMS ((const struct res_res_info *)); static void write_res_data PARAMS ((const void *, size_t, int)); static void write_res_header - PARAMS ((unsigned long, const struct res_id *, const struct res_id *, + PARAMS ((unsigned int, const struct res_id *, const struct res_id *, const struct res_res_info *)); =20 static int read_resource_entry PARAMS ((void)); @@ -61,7 +61,7 @@ static unichar *read_unistring PARAMS ((int *)); static void skip_null_resource PARAMS ((void)); =20 -static unsigned long get_id_size PARAMS ((const struct res_id *)); +static unsigned int get_id_size PARAMS ((const struct res_id *)); static void res_align_file PARAMS ((void)); =20 static void @@ -219,7 +219,7 @@ /* If we're at level 3, then this key represents a language. Use it to update the current language. */ if (!re->id.named - && re->id.u.id !=3D (unsigned long) *language + && re->id.u.id !=3D (unsigned int) *language && (re->id.u.id & 0xffff) =3D=3D re->id.u.id) { *language =3D re->id.u.id; @@ -331,7 +331,7 @@ =20 if (rt !=3D 0 && type !=3D NULL - && (type->named || type->u.id !=3D (unsigned long) rt)) + && (type->named || type->u.id !=3D (unsigned int) rt)) { fprintf (stderr, "// Unexpected resource type mismatch: "); res_id_print (stderr, *type, 1); @@ -351,7 +351,7 @@ const struct res_id *name; const struct res_res_info *resinfo; { - unsigned long datasize =3D 0; + unsigned int datasize =3D 0; const struct bindata *bin_rep, *data; =20 bin_rep =3D res_to_bin (res, 0); @@ -365,7 +365,7 @@ } =20 /* Get number of bytes needed to store an id in binary format */ -static unsigned long +static unsigned int get_id_size (id) const struct res_id *id; { @@ -378,7 +378,7 @@ /* Write a resource header */ static void write_res_header (datasize, type, name, resinfo) - unsigned long datasize; + unsigned int datasize; const struct res_id *type; const struct res_id *name; const struct res_res_info *resinfo; @@ -430,7 +430,7 @@ { if (id->named) { - unsigned long len =3D id->u.n.length; + unsigned int len =3D id->u.n.length; unichar null_term =3D 0; write_res_data (id->u.n.name, len * sizeof (unichar), 1); write_res_data (&null_term, sizeof (null_term), 1); @@ -586,7 +586,7 @@ =20 if (*resources =3D=3D NULL) { - static unsigned long timeval; + static unsigned int timeval; =20 /* Use the same timestamp for every resource created in a single run. */ Index: windres.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/binutils/windres.c,v retrieving revision 1.28 diff -B -b -u -r1.28 windres.c --- windres.c 17 Feb 2007 13:33:54 -0000 1.28 +++ windres.c 16 Apr 2007 09:13:39 -0000 @@ -263,7 +263,7 @@ res_id_print (FILE *stream, struct res_id id, int quote) { if (! id.named) - fprintf (stream, "%lu", id.u.id); + fprintf (stream, "%u", id.u.id); else { if (quote) @@ -320,12 +320,12 @@ =20 if (*resources =3D=3D NULL) { - static unsigned long timeval; + static unsigned int timeval; =20 /* Use the same timestamp for every resource created in a single run. */ if (timeval =3D=3D 0) - timeval =3D time (NULL); + timeval =3D (unsigned int) time (NULL); =20 *resources =3D ((struct res_directory *) res_alloc (sizeof **resources)); @@ -756,6 +756,9 @@ struct res_directory *resources; int use_temp_file; =20 + /* TODO: Test that sizeof int has 4 byte size. */ + assert (sizeof (int) =3D=3D 4); + #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif Index: windres.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/binutils/windres.h,v retrieving revision 1.14 diff -B -b -u -r1.14 windres.h --- windres.h 8 May 2005 14:17:39 -0000 1.14 +++ windres.h 16 Apr 2007 09:13:40 -0000 @@ -35,9 +35,9 @@ { /* Resource flags. According to the MS docs, this is currently always zero. */ - unsigned long characteristics; + unsigned int characteristics; /* Time/date stamp. */ - unsigned long time; + unsigned int time; /* Major version number. */ unsigned short major; /* Minor version number. */ @@ -63,7 +63,7 @@ unichar *name; } n; /* If the named field is zero, this is the ID. */ - unsigned long id; + unsigned int id; } u; }; =20 @@ -127,11 +127,11 @@ COFF file, the res_directory structure has a characteristics field, but I don't know if it's related to the one in the res file. */ - unsigned long characteristics; + unsigned int characteristics; /* Version of the resource. Entirely user defined. In a COFF file, the res_directory structure has a characteristics field, but I don't know if it's related to the one in the res file. */ - unsigned long version; + unsigned int version; /* Memory flags. This is a combination of the MEMFLAG values defined below. Most of these values are historical, and are not meaningful for win32. I don't think there is any way to store @@ -146,11 +146,11 @@ { /* The code page used for the data. I don't really know what this should be. */ - unsigned long codepage; + unsigned int codepage; /* A resource entry in a COFF file has a reserved field, which we record here when reading a COFF file. When writing a COFF file, we set this field to zero. */ - unsigned long reserved; + unsigned int reserved; }; =20 /* Resource data is stored in a res_resource structure. */ @@ -164,7 +164,7 @@ { struct { - unsigned long length; + unsigned int length; const unsigned char *data; } data; struct accelerator *acc; @@ -250,7 +250,7 @@ /* Y coordinate of hotspot. */ short yhotspot; /* Length of bitmap data. */ - unsigned long length; + unsigned int length; /* Data. */ const unsigned char *data; }; @@ -270,7 +270,7 @@ /* Bits per pixel. */ unsigned short bits; /* Number of bytes in cursor resource. */ - unsigned long bytes; + unsigned int bytes; /* Index of cursor resource. */ unsigned short index; }; @@ -280,9 +280,9 @@ struct dialog { /* Basic window style. */ - unsigned long style; + unsigned int style; /* Extended window style. */ - unsigned long exstyle; + unsigned int exstyle; /* X coordinate. */ unsigned short x; /* Y coordinate. */ @@ -312,7 +312,7 @@ struct dialog_ex { /* Help ID. */ - unsigned long help; + unsigned int help; /* Font weight. */ unsigned short weight; /* Whether the font is italic. */ @@ -482,9 +482,9 @@ /* ID. */ unsigned short id; /* Style. */ - unsigned long style; + unsigned int style; /* Extended style. */ - unsigned long exstyle; + unsigned int exstyle; /* X coordinate. */ unsigned short x; /* Y coordinate. */ @@ -500,7 +500,7 @@ /* Extra data for the window procedure. */ struct rcdata_item *data; /* Help ID. Only used in an extended dialog. */ - unsigned long help; + unsigned int help; }; =20 /* Control classes. These can be used as the ID field in a struct @@ -521,7 +521,7 @@ /* Index of font entry. */ short index; /* Length of font information. */ - unsigned long length; + unsigned int length; /* Font information. */ const unsigned char *data; }; @@ -543,7 +543,7 @@ /* Bits per pixel. */ unsigned short bits; /* Number of bytes in cursor resource. */ - unsigned long bytes; + unsigned int bytes; /* Index of cursor resource. */ unsigned short index; }; @@ -556,7 +556,7 @@ struct menuitem *items; /* Help ID. I don't think there is any way to set this in an rc file, but it can appear in the binary format. */ - unsigned long help; + unsigned int help; }; =20 /* A menu resource is a list of menuitem structures. */ @@ -567,9 +567,9 @@ struct menuitem *next; /* Type. In a normal menu, rather than a menuex, this is the flags field. */ - unsigned long type; + unsigned int type; /* State. This is only used in a menuex. */ - unsigned long state; + unsigned int state; /* Id. */ unsigned short id; /* Unicode text. */ @@ -577,7 +577,7 @@ /* Popup menu items for a popup. */ struct menuitem *popup; /* Help ID. This is only used in a menuex. */ - unsigned long help; + unsigned int help; }; =20 /* Menu item flags. These can appear in the flags field of a struct @@ -613,20 +613,20 @@ union { unsigned int word; - unsigned long dword; + unsigned int dword; struct { - unsigned long length; + unsigned int length; const char *s; } string; struct { - unsigned long length; + unsigned int length; const unichar *w; } wstring; struct { - unsigned long length; + unsigned int length; const unsigned char *data; } buffer; } u; @@ -661,24 +661,24 @@ struct fixed_versioninfo { /* The file version, which is two 32 bit integers. */ - unsigned long file_version_ms; - unsigned long file_version_ls; + unsigned int file_version_ms; + unsigned int file_version_ls; /* The product version, which is two 32 bit integers. */ - unsigned long product_version_ms; - unsigned long product_version_ls; + unsigned int product_version_ms; + unsigned int product_version_ls; /* The file flags mask. */ - unsigned long file_flags_mask; + unsigned int file_flags_mask; /* The file flags. */ - unsigned long file_flags; + unsigned int file_flags; /* The OS type. */ - unsigned long file_os; + unsigned int file_os; /* The file type. */ - unsigned long file_type; + unsigned int file_type; /* The file subtype. */ - unsigned long file_subtype; + unsigned int file_subtype; /* The date, which in Windows is two 32 bit integers. */ - unsigned long file_date_ms; - unsigned long file_date_ls; + unsigned int file_date_ms; + unsigned int file_date_ls; }; =20 /* A list of variable version information. */ @@ -742,7 +742,7 @@ /* Next data. */ struct bindata *next; /* Length of data. */ - unsigned long length; + unsigned int length; /* Data. */ unsigned char *data; }; @@ -761,7 +761,7 @@ (const char *, const char *, const struct res_directory *); =20 extern struct res_resource *bin_to_res - (struct res_id, const unsigned char *, unsigned long, int); + (struct res_id, const unsigned char *, unsigned int, int); extern struct bindata *res_to_bin (const struct res_resource *, int); =20 extern FILE *open_file_search @@ -812,11 +812,11 @@ extern void define_dialog (struct res_id, const struct res_res_info *, const struct dialog *); extern struct dialog_control *define_control - (const struct res_id, unsigned long, unsigned long, unsigned long, - unsigned long, unsigned long, unsigned long, unsigned long, unsigned lo= ng); + (const struct res_id, unsigned int, unsigned int, unsigned int, + unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); extern struct dialog_control *define_icon_control - (struct res_id, unsigned long, unsigned long, unsigned long, unsigned lo= ng, - unsigned long, unsigned long, struct rcdata_item *, struct dialog_ex *); + (struct res_id, unsigned int, unsigned int, unsigned int, unsigned int, + unsigned int, unsigned int, struct rcdata_item *, struct dialog_ex *); extern void define_font (struct res_id, const struct res_res_info *, const char *); extern void define_icon @@ -824,7 +824,7 @@ extern void define_menu (struct res_id, const struct res_res_info *, struct menuitem *); extern struct menuitem *define_menuitem - (const char *, int, unsigned long, unsigned long, unsigned long, + (const char *, int, unsigned int, unsigned int, unsigned int, struct menuitem *); extern void define_messagetable (struct res_id, const struct res_res_info *, const char *); @@ -833,10 +833,10 @@ extern void define_rcdata_file=20 (struct res_id, const struct res_res_info *, const char *); extern struct rcdata_item *define_rcdata_string - (const char *, unsigned long); -extern struct rcdata_item *define_rcdata_number (unsigned long, int); + (const char *, unsigned int); +extern struct rcdata_item *define_rcdata_number (unsigned int, int); extern void define_stringtable - (const struct res_res_info *, unsigned long, const char *); + (const struct res_res_info *, unsigned int, const char *); extern void define_user_data (struct res_id, struct res_id, const struct res_res_info *, struct rcdata_item *); @@ -851,4 +851,4 @@ extern struct ver_stringinfo *append_verval (struct ver_stringinfo *, const char *, const char *); extern struct ver_varinfo *append_vertrans - (struct ver_varinfo *, unsigned long, unsigned long); + (struct ver_varinfo *, unsigned int, unsigned int); =3D= --=_mixed 0033582EC12572BF_=--