[PATCH libX11] modules/im/ximcp/imDefIc.c: simplify code

walter harms wharms at bfs.de
Sat Jul 12 09:05:59 PDT 2014


If somebody could test this ....

It is possible that the code is wrong in the first place
the function _XimResetICCheck() looks comparable but returns
True in the second if()

re,
 wh


Am 12.07.2014 17:53, schrieb walter harms:
> 
> the if will return false as the function would do anyway
> 
> Signed-off-by: Harms <wharms at bfs,de>
> ---
>  modules/im/ximcp/imDefIc.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/modules/im/ximcp/imDefIc.c b/modules/im/ximcp/imDefIc.c
> index 143bd59..21f2f8f 100644
> --- a/modules/im/ximcp/imDefIc.c
> +++ b/modules/im/ximcp/imDefIc.c
> @@ -820,21 +820,14 @@ _XimDestroyICCheck(
>      CARD8	 minor_opcode = *((CARD8 *)data + 1);
>      XIMID	 imid = buf_s[0];
>      XICID	 icid = buf_s[1];
> -    Bool	 ret = False;
> 
>      if ((major_opcode == XIM_DESTROY_IC_REPLY)
>       && (minor_opcode == 0)
>       && (imid == im->private.proto.imid)
>       && (icid == ic->private.proto.icid))
> -	ret = True;
> -    if ((major_opcode == XIM_ERROR)
> -     && (minor_opcode == 0)
> -     && (buf_s[2] & XIM_IMID_VALID)
> -     && (imid == im->private.proto.imid)
> -     && (buf_s[2] & XIM_ICID_VALID)
> -     && (icid == ic->private.proto.icid))
> -    ret = False;
> -    return ret;
> +	return True;
> +
> +    return False;
>  }
> 
>  static void


More information about the xorg-devel mailing list