qgrayraster: use a cast to void to mark a variable as unused

Do not use a self-assignment, as that may trigger compiler warnings.

Casting to void is also what Q_UNUSED is doing these days, but we can't
use it here because qgrayraster.c does not include qglobal.h.

Remove a 15-years old comment related to the self assignment.

Found by clazy.

Change-Id: I8cc92b7a1b0b5fb13824959740243e17606ec753
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Giuseppe D'Angelo 2017-04-12 14:19:31 +01:00
parent 924b02aecb
commit e70e8dd6a9
1 changed files with 1 additions and 5 deletions

View File

@ -167,11 +167,7 @@
#include <stdlib.h>
#include <stdio.h>
/* This macro is used to indicate that a function parameter is unused. */
/* Its purpose is simply to reduce compiler warnings. Note also that */
/* simply defining it as `(void)x' doesn't avoid warnings with certain */
/* ANSI compilers (e.g. LCC). */
#define QT_FT_UNUSED( x ) (x) = (x)
#define QT_FT_UNUSED( x ) (void) x
/* Disable the tracing mechanism for simplicity -- developers can */
/* activate it easily by redefining these two macros. */