[PATCH libX11 3/5] fix: warning: pointer targets in passing argument 2 of '_XSend' differ in signedness [-Wpointer-sign]
walter harms
wharms at bfs.de
Thu Apr 28 14:53:46 UTC 2016
Am 27.04.2016 07:04, schrieb Alan Coopersmith:
> On 04/26/16 07:31 AM, walter harms wrote:
>>
>> fix signess warning by casting
>> Signed-off-by: walter harms <wharms at bfs.de>
>>
>>
>> ---
>> src/ModMap.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/ModMap.c b/src/ModMap.c
>> index a809aa2..4263a8b 100644
>> --- a/src/ModMap.c
>> +++ b/src/ModMap.c
>> @@ -39,7 +39,7 @@ XGetModifierMapping(register Display *dpy)
>> XModifierKeymap *res;
>>
>> LockDisplay(dpy);
>> - GetEmptyReq(GetModifierMapping, req);
>> + (GetModifierMapping, req); // Never used ?
>> (void) _XReply (dpy, (xReply *)&rep, 0, xFalse);
>
> The request is used on the very next line, where it's sent to the
> Xserver and then _XReply waits for the response. It's just all the
> behind the scenes magic of the X request buffer handling in Xlib.
>
hi Alan,
Actualy it was left when i was trying to understand why this causes this:
ModMap.c:37:20: warning: variable 'req' set but not used [-Wunused-but-set-variable]
i understand:
GetEmptyReq = _XGetRequest is changing dpy what is needed in _XReply
so i could get rid of that warning by checking for the (unlikely) error
if (req == NULL ) or by something like req=req
assuming that a redefine is not an option:
#define GetEmptyReq (nane,req) (void)_XGetRequest(dpy, X_##name, SIZEOF(xReq))
note: there are 17 more of this kind in libX11
re,
wh
More information about the xorg-devel
mailing list