[PATCH RESEND 2/5] xfree86: use xf86AddNewOption instead of xf86addNewOption

Alan Coopersmith alan.coopersmith at oracle.com
Wed Oct 19 20:40:11 PDT 2011


On 10/19/11 20:05, Peter Hutterer wrote:
> The former strdups for us. If the strdup fails we miss out on the
> CorePointer option (default on anyway) and we're likely to fall over soon
> anyway, so let's pretend this is the same behaviour.
>
> Signed-off-by: Peter Hutterer<peter.hutterer at who-t.net>
> ---
>   hw/xfree86/common/xf86Config.c |    8 ++++----
>   1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
> index 5c46152..96e98c1 100644
> --- a/hw/xfree86/common/xf86Config.c
> +++ b/hw/xfree86/common/xf86Config.c
> @@ -1194,8 +1194,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
>   	if (Pointer)
>   	    foundPointer = configInput(Pointer, confInput, from);
>   	if (foundPointer) {
> -	    Pointer->options = xf86addNewOption(Pointer->options,
> -					       xnfstrdup("CorePointer"), "on");
> +	    Pointer->options = xf86AddNewOption(Pointer->options,
> +					        "CorePointer", "on");
>   	    servlayoutp->inputs = addDevice(servlayoutp->inputs, Pointer);
>   	}
>       }
> @@ -1284,8 +1284,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
>   	if (Keyboard)
>   	    foundKeyboard = configInput(Keyboard, confInput, from);
>   	if (foundKeyboard) {
> -	    Keyboard->options = xf86addNewOption(Keyboard->options,
> -						xnfstrdup("CoreKeyboard"), "on");
> +	    Keyboard->options = xf86AddNewOption(Keyboard->options,
> +						 "CoreKeyboard", "on");
>   	    servlayoutp->inputs = addDevice(servlayoutp->inputs, Keyboard);
>   	}
>       }

I wish I could say I was shocked at how horrible this API design is, that
whether or not the "a" in add is uppercase determines if the arguments are
strdup'ed by the caller or the callee, but this is the xf86 ddx.

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list