Re: Changed more malloc to HeapAlloc calls

2008-10-30 Thread Pete Myers
It does match the style of the way that HeapAlloc is used elsewhere in the
file, though not malloc admittedly.  I wasn't sure which convention had
precedent.

I'm afraid that I don't understand how my changelog doesn't match the
patch.  I'm new here, can you help me out?  There's obviously something I'm
missing!

Pete

2008/10/30 James Hawkins <[EMAIL PROTECTED]>

> On Wed, Oct 29, 2008 at 7:39 PM, Pete Myers
> <[EMAIL PROTECTED]> wrote:
> > In line with http://wiki.winehq.org/ReplaceMalloc this is a small patch
> that
> > changes all malloc calls to HeapAlloc in the following files:
> > ./dlls/iphlpapi/tests/iphlpapi.c
> > ./dlls/wnaspi32/winaspi16.c
> >
> > Changelog:
> > * malloc calls in dlls/kernel32/process.c have been change to HeapAlloc
> >
>
> Your changelog (right above) doesn't match the patch, and
>
> -  PMIB_IPADDRTABLE buf = (PMIB_IPADDRTABLE)malloc(dwSize);
> +  PMIB_IPADDRTABLE buf = (PMIB_IPADDRTABLE)HeapAlloc(
> GetProcessHeap(), 0, dwSize);
>
> You've introduced a space after opening parentheses which does not
> match the style of the rest of the file.
>
> --
> James Hawkins
>



Re: Changed more malloc to HeapAlloc calls

2008-10-30 Thread Pete Myers
> In addition to what James said please split the patch up; one patch per
> module. A dll or program is a "module".

Sorry, I'm inundated with noobie errors here I think.

> Also while you are at it please remove the superfluous casts in the lines
> you are changing. HeapAlloc (malloc too) returns a void pointer which
> doesn't needs to be casted to an other pointer type. E.g.

Will do.  Didn't want to change coding style.

Actually my big struggle at the moment is trying to figure out where
malloc() memory gets free().  What's the policy here?  Should
HeapAlloc() always be set free...  Is the fact that some malloc()
memory not free()'d an error, or a policy?  Or should I work harder to
find out where free() gets called?

Pete




Re: Changed more malloc to HeapAlloc calls

2008-10-30 Thread Pete Myers
2008/10/30 James Hawkins <[EMAIL PROTECTED]>
>
> On Wed, Oct 29, 2008 at 8:02 PM, Pete Myers
> <[EMAIL PROTECTED]> wrote:
> > It does match the style of the way that HeapAlloc is used elsewhere in the
> > file, though not malloc admittedly.  I wasn't sure which convention had
> > precedent.
> >
>
> Please bottom-post when replying to a post on the wine lists.  There
> is one test function that uses a space after opening parentheses, but
> it's the exception, not the rule.

Sure, I'll be more careful about both of those in future.

> > I'm afraid that I don't understand how my changelog doesn't match the
> > patch.  I'm new here, can you help me out?  There's obviously something I'm
> > missing!
> >
>
> You had several 'changelog' entries in the email, but the last one was
>
> Changelog:
> * malloc calls in dlls/kernel32/process.c have been change to HeapAlloc
>
> which does not match the patch.

That was a dumb mistake, caused by copying and pasting from a
different patch.  Thanks for your help James, I'll try and fix the
patch then resubmit.

Pete Myers