[PATCH RESEND 4/5] dix: move #if statement to stop compiler warning

Alan Coopersmith alan.coopersmith at oracle.com
Wed Oct 19 20:46:55 PDT 2011


On 10/19/11 20:05, Peter Hutterer wrote:
> ptrveloc.c: In function 'QueryTrackers':
> ptrveloc.c:598:34: warning: variable 'used_offset' set but not used
> [-Wunused-but-set-variable]
>
> used_offset is used, but only in the debugging code. Move the #if statement
> to ignore that warning.
>
> Signed-off-by: Peter Hutterer<peter.hutterer at who-t.net>
> ---
>   dix/ptrveloc.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
> index 53a0d03..7b6f560 100644
> --- a/dix/ptrveloc.c
> +++ b/dix/ptrveloc.c
> @@ -649,13 +649,13 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t){
>   	DebugAccelF("(dix prtacc) query: last tracker in effect\n");
>   	used_offset = vel->num_tracker-1;
>       }
> -#ifdef PTRACCEL_DEBUGGING
>       if(used_offset>= 0){
> +#ifdef PTRACCEL_DEBUGGING
>   	MotionTracker *tracker = TRACKER(vel, used_offset);
>   	DebugAccelF("(dix prtacc) result: offset %i [dx: %i dy: %i diff: %i]\n",
>   	            used_offset, tracker->dx, tracker->dy, cur_t - tracker->time);
> -    }
>   #endif
> +    }
>       return result;
>   }
>

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