replace UNUSED with standard stuff

master
Daniel Kolesa 2020-07-30 19:26:07 +02:00
parent baceb44b26
commit 93591c1b6b
4 changed files with 4 additions and 10 deletions

View File

@ -211,7 +211,7 @@ static bool initidents()
}
return true;
}
UNUSED static bool forceinitidents = initidents();
[[maybe_unused]] static bool forceinitidents = initidents();
static const char *sourcefile = nullptr, *sourcestr = nullptr;

View File

@ -47,7 +47,7 @@ static model *__loadmodel__##modelclass(const char *filename) \
{ \
return new modelclass(filename); \
} \
UNUSED static int __dummy__##modelclass = addmodeltype((modeltype), __loadmodel__##modelclass);
[[maybe_unused]] static int __dummy__##modelclass = addmodeltype((modeltype), __loadmodel__##modelclass);
static void loadskin(const char *dir, const char *altdir, Texture *&skin, Texture *&masks);

View File

@ -20,12 +20,6 @@
#define RESTRICT
#endif
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
#else
#define UNUSED
#endif
#ifdef swap
#undef swap
#endif

View File

@ -315,8 +315,8 @@ inline void ident::getcval(tagval &v) const
}
// nasty macros for registering script functions, abuses globals to avoid excessive infrastructure
#define KEYWORD(name, type) UNUSED static bool __dummy_##type = addcommand(#name, (identfun)nullptr, nullptr, type)
#define COMMANDKN(name, type, fun, nargs) UNUSED static bool __dummy_##fun = addcommand(#name, (identfun)fun, nargs, type)
#define KEYWORD(name, type) [[maybe_unused]] static bool __dummy_##type = addcommand(#name, (identfun)nullptr, nullptr, type)
#define COMMANDKN(name, type, fun, nargs) [[maybe_unused]] static bool __dummy_##fun = addcommand(#name, (identfun)fun, nargs, type)
#define COMMANDK(name, type, nargs) COMMANDKN(name, type, name, nargs)
#define COMMANDN(name, fun, nargs) COMMANDKN(name, ID_COMMAND, fun, nargs)
#define COMMAND(name, nargs) COMMANDN(name, name, nargs)