Label some unused static vars as SK_UNUSED

Makes my gcc 5.1.1 much happier.

R=mtklein@google.com,scroggo@google.com

[ mtklein mischief below here ]
No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1170863006
This commit is contained in:
fmalita 2015-06-10 10:46:50 -07:00 committed by Commit bot
parent d3c162200f
commit 523beb7fd9
2 changed files with 29 additions and 29 deletions

View File

@ -17,4 +17,4 @@
int SkForceLinking(bool doNotPassTrue);
#define __SK_FORCE_IMAGE_DECODER_LINKING \
static int linking_forced = SkForceLinking(false)
SK_UNUSED static int linking_forced = SkForceLinking(false)

View File

@ -180,59 +180,59 @@ private:
#define DEFINE_bool(name, defaultValue, helpString) \
bool FLAGS_##name; \
static bool unused_##name = SkFlagInfo::CreateBoolFlag(TO_STRING(name), \
NULL, \
&FLAGS_##name, \
defaultValue, \
helpString)
SK_UNUSED static bool unused_##name = SkFlagInfo::CreateBoolFlag(TO_STRING(name), \
NULL, \
&FLAGS_##name, \
defaultValue, \
helpString)
// bool 2 allows specifying a short name. No check is done to ensure that shortName
// is actually shorter than name.
#define DEFINE_bool2(name, shortName, defaultValue, helpString) \
bool FLAGS_##name; \
static bool unused_##name = SkFlagInfo::CreateBoolFlag(TO_STRING(name), \
TO_STRING(shortName),\
&FLAGS_##name, \
defaultValue, \
helpString)
SK_UNUSED static bool unused_##name = SkFlagInfo::CreateBoolFlag(TO_STRING(name), \
TO_STRING(shortName),\
&FLAGS_##name, \
defaultValue, \
helpString)
#define DECLARE_bool(name) extern bool FLAGS_##name;
#define DEFINE_string(name, defaultValue, helpString) \
SkCommandLineFlags::StringArray FLAGS_##name; \
static bool unused_##name = SkFlagInfo::CreateStringFlag(TO_STRING(name), \
NULL, \
&FLAGS_##name, \
defaultValue, \
helpString)
SK_UNUSED static bool unused_##name = SkFlagInfo::CreateStringFlag(TO_STRING(name), \
NULL, \
&FLAGS_##name, \
defaultValue, \
helpString)
// string2 allows specifying a short name. There is an assert that shortName
// is only 1 character.
#define DEFINE_string2(name, shortName, defaultValue, helpString) \
SkCommandLineFlags::StringArray FLAGS_##name; \
static bool unused_##name = SkFlagInfo::CreateStringFlag(TO_STRING(name), \
TO_STRING(shortName), \
&FLAGS_##name, \
defaultValue, \
helpString)
SK_UNUSED static bool unused_##name = SkFlagInfo::CreateStringFlag(TO_STRING(name), \
TO_STRING(shortName), \
&FLAGS_##name, \
defaultValue, \
helpString)
#define DECLARE_string(name) extern SkCommandLineFlags::StringArray FLAGS_##name;
#define DEFINE_int32(name, defaultValue, helpString) \
int32_t FLAGS_##name; \
static bool unused_##name = SkFlagInfo::CreateIntFlag(TO_STRING(name), \
&FLAGS_##name, \
defaultValue, \
helpString)
SK_UNUSED static bool unused_##name = SkFlagInfo::CreateIntFlag(TO_STRING(name), \
&FLAGS_##name, \
defaultValue, \
helpString)
#define DECLARE_int32(name) extern int32_t FLAGS_##name;
#define DEFINE_double(name, defaultValue, helpString) \
double FLAGS_##name; \
static bool unused_##name = SkFlagInfo::CreateDoubleFlag(TO_STRING(name), \
&FLAGS_##name, \
defaultValue, \
helpString)
SK_UNUSED static bool unused_##name = SkFlagInfo::CreateDoubleFlag(TO_STRING(name), \
&FLAGS_##name, \
defaultValue, \
helpString)
#define DECLARE_double(name) extern double FLAGS_##name;