[PATCH libX11] XFree will accept NULL as argument

walter harms wharms at bfs.de
Tue Aug 16 13:25:00 UTC 2016



Am 16.08.2016 13:10, schrieb Eric Engestrom:
> On Tue, Aug 16, 2016 at 11:56:50AM +0100, Eric Engestrom wrote:
>> On Mon, Aug 15, 2016 at 07:18:14PM +0200, walter harms wrote:
>>> since Xfree is a define for free()
>>>   Xlibint.h:#define Xfree(ptr) free((ptr))
>>>
>>> Xfree will accept NULL and do nothing.
>>>
>>> the patch is also available on github.com/xtforever/libX11.git
>>>
> 
> Actually, that commit message could use some changes: remove the last
> line (eg. move it under the ---), and add a Signed-off-by line :)
> 
> I was just reminded of that by Keith's mail:
>> A patch is ready for merging when it has been has been 'generally agreed
>> to be useful', has been reviewed on the xorg-devel list and has both
>> Signed-off-by: and Reviewed-by: lines.
> 
> It's hard to keep track as not all projects require it, but this one
> does ;)
> 

the real change is "If data is NULL, no operation is performed."
the rest comes from several versions as discussed with hdegoede at redhat.com.

WHY there diff sees a change, no idea.

i admit i forgot the Signed-off-by:

re,
 wh


> Cheers, 
>   Eric
> 
>>> ---
>>>  man/XFree.man | 5 +++--
>>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/man/XFree.man b/man/XFree.man
>>> index ffc513b..72674a5 100644
>>> --- a/man/XFree.man
>>> +++ b/man/XFree.man
>>> @@ -90,8 +90,9 @@ Specifies the data that are to be freed.
>>>  The
>>>  .ZN XFree
>>>  function is a general-purpose Xlib routine that frees the specified data.
>>> -You must use it to free any objects that were allocated by Xlib,
>>> +You must use it to free any objects that were allocated by Xlib,
>>
>> What's the change here?
>>
>> The rest is:
>> Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>
>>
>>>  unless an alternate function is explicitly specified for the object.
>>> -A NULL pointer cannot be passed to this function.
>>> +
>>> +If data is NULL, no operation is performed.
>>>  .SH "SEE ALSO"
>>>  \fI\*(xL\fP
>>> -- 
>>> 2.1.4
>>>


More information about the xorg-devel mailing list