Add CTAGS_ATTR_ prefix to UNUSED() and PRINTF() macros

Also fix the macro use in objc.c to appear behind variables.
This commit is contained in:
Jiří Techet 2016-08-22 14:54:19 +02:00
parent b7f7ce2675
commit cb7da79824
12 changed files with 35 additions and 35 deletions

View File

@ -30,11 +30,11 @@
* to prevent warnings about unused variables.
*/
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !(defined (__APPLE_CC__) || defined (__GNUG__))
# define UNUSED __attribute__((unused))
# define PRINTF(s,f) __attribute__((format (printf, s, f)))
# define CTAGS_ATTR_UNUSED __attribute__((unused))
# define CTAGS_ATTR_PRINTF(s,f) __attribute__((format (printf, s, f)))
#else
# define UNUSED
# define PRINTF(s,f)
# define CTAGS_ATTR_UNUSED
# define CTAGS_ATTR_PRINTF(s,f)
#endif

View File

@ -531,11 +531,11 @@ extern void findRegexTags (void)
#endif /* HAVE_REGEX */
extern void addTagRegex (
const langType language UNUSED,
const char* const regex UNUSED,
const char* const name UNUSED,
const char* const kinds UNUSED,
const char* const flags UNUSED)
const langType language CTAGS_ATTR_UNUSED,
const char* const regex CTAGS_ATTR_UNUSED,
const char* const name CTAGS_ATTR_UNUSED,
const char* const kinds CTAGS_ATTR_UNUSED,
const char* const flags CTAGS_ATTR_UNUSED)
{
#ifdef HAVE_REGEX
Assert (regex != NULL);
@ -557,10 +557,10 @@ extern void addTagRegex (
}
extern void addCallbackRegex (
const langType language UNUSED,
const char* const regex UNUSED,
const char* const flags UNUSED,
const regexCallback callback UNUSED)
const langType language CTAGS_ATTR_UNUSED,
const char* const regex CTAGS_ATTR_UNUSED,
const char* const flags CTAGS_ATTR_UNUSED,
const regexCallback callback CTAGS_ATTR_UNUSED)
{
#ifdef HAVE_REGEX
Assert (regex != NULL);
@ -574,7 +574,7 @@ extern void addCallbackRegex (
}
extern void addLanguageRegex (
const langType language UNUSED, const char* const regex UNUSED)
const langType language CTAGS_ATTR_UNUSED, const char* const regex CTAGS_ATTR_UNUSED)
{
#ifdef HAVE_REGEX
if (! regexBroken)
@ -595,7 +595,7 @@ extern void addLanguageRegex (
*/
extern boolean processRegexOption (const char *const option,
const char *const parameter UNUSED)
const char *const parameter CTAGS_ATTR_UNUSED)
{
boolean handled = FALSE;
const char* const dash = strchr (option, '-');
@ -617,7 +617,7 @@ extern boolean processRegexOption (const char *const option,
return handled;
}
extern void disableRegexKinds (const langType language UNUSED)
extern void disableRegexKinds (const langType language CTAGS_ATTR_UNUSED)
{
#ifdef HAVE_REGEX
if (language <= SetUpper && Sets [language].count > 0)
@ -632,8 +632,8 @@ extern void disableRegexKinds (const langType language UNUSED)
}
extern boolean enableRegexKind (
const langType language UNUSED,
const int kind UNUSED, const boolean mode UNUSED)
const langType language CTAGS_ATTR_UNUSED,
const int kind CTAGS_ATTR_UNUSED, const boolean mode CTAGS_ATTR_UNUSED)
{
boolean result = FALSE;
#ifdef HAVE_REGEX
@ -653,7 +653,7 @@ extern boolean enableRegexKind (
return result;
}
extern void printRegexKinds (const langType language UNUSED, boolean indent UNUSED)
extern void printRegexKinds (const langType language CTAGS_ATTR_UNUSED, boolean indent CTAGS_ATTR_UNUSED)
{
#ifdef HAVE_REGEX
if (language <= SetUpper && Sets [language].count > 0)

View File

@ -162,8 +162,8 @@ int mio_ungetc (MIO *mio, int ch);
int mio_putc (MIO *mio, int c);
int mio_puts (MIO *mio, const char *s);
int mio_vprintf (MIO *mio, const char *format, va_list ap) PRINTF (2, 0);
int mio_printf (MIO *mio, const char *format, ...) PRINTF (2, 3);
int mio_vprintf (MIO *mio, const char *format, va_list ap) CTAGS_ATTR_PRINTF (2, 0);
int mio_printf (MIO *mio, const char *format, ...) CTAGS_ATTR_PRINTF (2, 3);
void mio_clearerr (MIO *mio);
int mio_eof (MIO *mio);

View File

@ -208,7 +208,7 @@ void addIgnoreListFromFile (const char *const fileName)
stringListCombine (Option.ignore, tokens);
}
extern void processExcludeOption (const char *const UNUSED option,
extern void processExcludeOption (const char *const option CTAGS_ATTR_UNUSED,
const char *const parameter)
{
if (parameter [0] == '\0')

View File

@ -93,7 +93,7 @@ extern CONST_OPTION optionValues Option;
/*
* FUNCTION PROTOTYPES
*/
extern void verbose (const char *const format, ...) PRINTF (1, 2);
extern void verbose (const char *const format, ...) CTAGS_ATTR_PRINTF (1, 2);
extern void freeList (stringList** const pString);
extern void setDefaultTagFileName (void);

View File

@ -383,7 +383,7 @@ extern void freeParserResources (void)
*/
extern void processLanguageDefineOption (const char *const option,
const char *const UNUSED parameter)
const char *const parameter CTAGS_ATTR_UNUSED)
{
#ifdef HAVE_REGEX
if (parameter [0] == '\0')

View File

@ -144,7 +144,7 @@ extern void addLanguageRegex (const langType language, const char* const regex);
extern void installTagRegexTable (const langType language);
extern void addTagRegex (const langType language, const char* const regex, const char* const name, const char* const kinds, const char* const flags);
extern void addCallbackRegex (const langType language, const char* const regex, const char* flags, const regexCallback callback);
extern void disableRegexKinds (const langType UNUSED language);
extern void disableRegexKinds (const langType language CTAGS_ATTR_UNUSED);
extern boolean enableRegexKind (const langType language, const int kind, const boolean mode);
extern void printRegexKindOptions (const langType language);
extern void freeRegexResources (void);

View File

@ -63,7 +63,7 @@ enum eErrorTypes { FATAL = 1, WARNING = 2, PERROR = 4 };
*/
extern void setExecutableName (const char *const path);
extern const char *getExecutableName (void);
extern void error (const errorSelection selection, const char *const format, ...) PRINTF (2, 3);
extern void error (const errorSelection selection, const char *const format, ...) CTAGS_ATTR_PRINTF (2, 3);
/* Memory allocation functions */
#ifdef NEED_PROTO_MALLOC

View File

@ -20,7 +20,7 @@
#include <string.h>
static boolean isPseudoTagsEnabled (xtagDesc *pdesc UNUSED)
static boolean isPseudoTagsEnabled (xtagDesc *pdesc CTAGS_ATTR_UNUSED)
{
return ! isDestinationStdout ();
}

View File

@ -740,7 +740,7 @@ static const char *keywordString (const keywordId keyword)
return name;
}
static void UNUSED pt (tokenInfo *const token)
static void CTAGS_ATTR_UNUSED pt (tokenInfo *const token)
{
if (isType (token, TOKEN_NAME))
printf ("type: %-12s: %-13s line: %lu\n",
@ -755,7 +755,7 @@ static void UNUSED pt (tokenInfo *const token)
tokenString (token->type), token->lineNumber);
}
static void UNUSED ps (statementInfo *const st)
static void CTAGS_ATTR_UNUSED ps (statementInfo *const st)
{
unsigned int i;
printf("scope: %s decl: %s gotName: %s gotParenName: %s\n",

View File

@ -35,7 +35,7 @@ static kindOption LuaKinds [] = {
*/
/* for debugging purposes */
static void UNUSED print_string (char *p, char *q)
static void CTAGS_ATTR_UNUSED print_string (char *p, char *q)
{
for ( ; p != q; p++)
fprintf (errout, "%c", *p);

View File

@ -465,13 +465,13 @@ static objcToken waitedToken, fallBackToken;
/* Ignore everything till waitedToken and jump to comeAfter.
* If the "end" keyword is encountered break, doesn't remember
* why though. */
static void tillToken (vString * const UNUSED (ident), objcToken what)
static void tillToken (vString * const ident CTAGS_ATTR_UNUSED, objcToken what)
{
if (what == waitedToken)
toDoNext = comeAfter;
}
static void tillTokenOrFallBack (vString * const UNUSED (ident), objcToken what)
static void tillTokenOrFallBack (vString * const ident CTAGS_ATTR_UNUSED, objcToken what)
{
if (what == waitedToken)
toDoNext = comeAfter;
@ -482,7 +482,7 @@ static void tillTokenOrFallBack (vString * const UNUSED (ident), objcToken what)
}
static int ignoreBalanced_count = 0;
static void ignoreBalanced (vString * const UNUSED (ident), objcToken what)
static void ignoreBalanced (vString * const ident CTAGS_ATTR_UNUSED, objcToken what)
{
switch (what)
@ -684,7 +684,7 @@ static void parseProperty (vString * const ident, objcToken what)
}
}
static void parseMethods (vString * const UNUSED (ident), objcToken what)
static void parseMethods (vString * const ident CTAGS_ATTR_UNUSED, objcToken what)
{
switch (what)
{
@ -943,7 +943,7 @@ static void parseTypedef (vString * const ident, objcToken what)
}
static boolean ignorePreprocStuff_escaped = FALSE;
static void ignorePreprocStuff (vString * const UNUSED (ident), objcToken what)
static void ignorePreprocStuff (vString * const ident CTAGS_ATTR_UNUSED, objcToken what)
{
switch (what)
{