| Submitter | Kai Tietz |
|---|---|
| Date | Nov. 29, 2012, 12:09 p.m. |
| Message ID | <CAEwic4Zz43j6U90a_bBks7P1-79Yu3PqyxxRqF2tVQzK5LRVvw@mail.gmail.com> |
| Download | mbox | patch |
| Permalink | /patch/202725/ |
| State | New |
| Headers | show |
Comments
On Thu, Nov 29, 2012 at 4:09 AM, Kai Tietz <ktietz70@googlemail.com> wrote: > > ChangeLog > > 2012-11-29 Kai Tietz > > PR target/53912 > * prefix.c (lookup_key): Explicit cast return-type of xmalloc/xrealloc > to char *. > > Tested for i686-w64-mingw32, x86_64-w64-mingw32, and > x86_64-unknown-gnu-linux. Ok for apply? > > Regards, > Kai > > Index: prefix.c > =================================================================== > --- prefix.c (Revision 193925) > +++ prefix.c (Arbeitskopie) > @@ -157,12 +157,12 @@ lookup_key (char *key) > } > > size = 32; > - dst = xmalloc (size); > + dst = (char *) xmalloc (size); > > res = RegQueryValueExA (reg_key, key, 0, &type, (LPBYTE) dst, &size); > if (res == ERROR_MORE_DATA && type == REG_SZ) > { > - dst = xrealloc (dst, size); > + dst = (char *) xrealloc (dst, size); > res = RegQueryValueExA (reg_key, key, 0, &type, (LPBYTE) dst, &size); > } This code should be using the XNEWVEC and XRESIZEVEC macros. Ian
Patch
Index: prefix.c =================================================================== --- prefix.c (Revision 193925) +++ prefix.c (Arbeitskopie) @@ -157,12 +157,12 @@ lookup_key (char *key) } size = 32; - dst = xmalloc (size); + dst = (char *) xmalloc (size); res = RegQueryValueExA (reg_key, key, 0, &type, (LPBYTE) dst, &size); if (res == ERROR_MORE_DATA && type == REG_SZ) { - dst = xrealloc (dst, size); + dst = (char *) xrealloc (dst, size); res = RegQueryValueExA (reg_key, key, 0, &type, (LPBYTE) dst, &size); }