[PATCH xserver 2/2] xfree86: allow to check for percent options without warnings in the log

Peter Hutterer peter.hutterer at who-t.net
Mon Feb 7 17:26:46 PST 2011


On Mon, Feb 07, 2011 at 11:28:49PM +0100, Simon Thum wrote:
> This allows set_percent_option() in synaptics to work as described, i.e.
> without an irritating warning.
> 
> Signed-off-by: Simon Thum <simon.thum at gmx.de>
> ---
> Possibly, the other cases should be aligned as well?

yes, that makes sense. Please fix the others up as well.

Cheers,
  Peter

> 
>  hw/xfree86/common/xf86Option.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
> index 455cafa..9ab183b 100644
> --- a/hw/xfree86/common/xf86Option.c
> +++ b/hw/xfree86/common/xf86Option.c
> @@ -561,8 +561,10 @@ ParseOptionValue(int scrnIndex, pointer options,
> OptionInfoPtr p,
>  		 * hence 100 looks the same as 100% to the caller of sccanf
>  		 */
>  		if (sscanf(s, "%lf%c", &p->value.realnum, &tmp) != 2 || tmp != '%') {
> -		    xf86DrvMsg(scrnIndex, X_WARNING,
> +		    if (markUsed) {
> +			xf86DrvMsg(scrnIndex, X_WARNING,
>  			       "Option \"%s\" requires a percent value\n", p->name);
> +		    }
>  		    p->found = FALSE;
>  		} else {
>  		    p->found = TRUE;
> -- 
> 1.7.3.4
> 


More information about the xorg-devel mailing list