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:
parent
b7f7ce2675
commit
cb7da79824
@ -30,11 +30,11 @@
|
|||||||
* to prevent warnings about unused variables.
|
* to prevent warnings about unused variables.
|
||||||
*/
|
*/
|
||||||
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !(defined (__APPLE_CC__) || defined (__GNUG__))
|
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !(defined (__APPLE_CC__) || defined (__GNUG__))
|
||||||
# define UNUSED __attribute__((unused))
|
# define CTAGS_ATTR_UNUSED __attribute__((unused))
|
||||||
# define PRINTF(s,f) __attribute__((format (printf, s, f)))
|
# define CTAGS_ATTR_PRINTF(s,f) __attribute__((format (printf, s, f)))
|
||||||
#else
|
#else
|
||||||
# define UNUSED
|
# define CTAGS_ATTR_UNUSED
|
||||||
# define PRINTF(s,f)
|
# define CTAGS_ATTR_PRINTF(s,f)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -531,11 +531,11 @@ extern void findRegexTags (void)
|
|||||||
#endif /* HAVE_REGEX */
|
#endif /* HAVE_REGEX */
|
||||||
|
|
||||||
extern void addTagRegex (
|
extern void addTagRegex (
|
||||||
const langType language UNUSED,
|
const langType language CTAGS_ATTR_UNUSED,
|
||||||
const char* const regex UNUSED,
|
const char* const regex CTAGS_ATTR_UNUSED,
|
||||||
const char* const name UNUSED,
|
const char* const name CTAGS_ATTR_UNUSED,
|
||||||
const char* const kinds UNUSED,
|
const char* const kinds CTAGS_ATTR_UNUSED,
|
||||||
const char* const flags UNUSED)
|
const char* const flags CTAGS_ATTR_UNUSED)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_REGEX
|
#ifdef HAVE_REGEX
|
||||||
Assert (regex != NULL);
|
Assert (regex != NULL);
|
||||||
@ -557,10 +557,10 @@ extern void addTagRegex (
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern void addCallbackRegex (
|
extern void addCallbackRegex (
|
||||||
const langType language UNUSED,
|
const langType language CTAGS_ATTR_UNUSED,
|
||||||
const char* const regex UNUSED,
|
const char* const regex CTAGS_ATTR_UNUSED,
|
||||||
const char* const flags UNUSED,
|
const char* const flags CTAGS_ATTR_UNUSED,
|
||||||
const regexCallback callback UNUSED)
|
const regexCallback callback CTAGS_ATTR_UNUSED)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_REGEX
|
#ifdef HAVE_REGEX
|
||||||
Assert (regex != NULL);
|
Assert (regex != NULL);
|
||||||
@ -574,7 +574,7 @@ extern void addCallbackRegex (
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern void addLanguageRegex (
|
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
|
#ifdef HAVE_REGEX
|
||||||
if (! regexBroken)
|
if (! regexBroken)
|
||||||
@ -595,7 +595,7 @@ extern void addLanguageRegex (
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
extern boolean processRegexOption (const char *const option,
|
extern boolean processRegexOption (const char *const option,
|
||||||
const char *const parameter UNUSED)
|
const char *const parameter CTAGS_ATTR_UNUSED)
|
||||||
{
|
{
|
||||||
boolean handled = FALSE;
|
boolean handled = FALSE;
|
||||||
const char* const dash = strchr (option, '-');
|
const char* const dash = strchr (option, '-');
|
||||||
@ -617,7 +617,7 @@ extern boolean processRegexOption (const char *const option,
|
|||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void disableRegexKinds (const langType language UNUSED)
|
extern void disableRegexKinds (const langType language CTAGS_ATTR_UNUSED)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_REGEX
|
#ifdef HAVE_REGEX
|
||||||
if (language <= SetUpper && Sets [language].count > 0)
|
if (language <= SetUpper && Sets [language].count > 0)
|
||||||
@ -632,8 +632,8 @@ extern void disableRegexKinds (const langType language UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern boolean enableRegexKind (
|
extern boolean enableRegexKind (
|
||||||
const langType language UNUSED,
|
const langType language CTAGS_ATTR_UNUSED,
|
||||||
const int kind UNUSED, const boolean mode UNUSED)
|
const int kind CTAGS_ATTR_UNUSED, const boolean mode CTAGS_ATTR_UNUSED)
|
||||||
{
|
{
|
||||||
boolean result = FALSE;
|
boolean result = FALSE;
|
||||||
#ifdef HAVE_REGEX
|
#ifdef HAVE_REGEX
|
||||||
@ -653,7 +653,7 @@ extern boolean enableRegexKind (
|
|||||||
return result;
|
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
|
#ifdef HAVE_REGEX
|
||||||
if (language <= SetUpper && Sets [language].count > 0)
|
if (language <= SetUpper && Sets [language].count > 0)
|
||||||
|
@ -162,8 +162,8 @@ int mio_ungetc (MIO *mio, int ch);
|
|||||||
int mio_putc (MIO *mio, int c);
|
int mio_putc (MIO *mio, int c);
|
||||||
int mio_puts (MIO *mio, const char *s);
|
int mio_puts (MIO *mio, const char *s);
|
||||||
|
|
||||||
int mio_vprintf (MIO *mio, const char *format, va_list ap) PRINTF (2, 0);
|
int mio_vprintf (MIO *mio, const char *format, va_list ap) CTAGS_ATTR_PRINTF (2, 0);
|
||||||
int mio_printf (MIO *mio, const char *format, ...) PRINTF (2, 3);
|
int mio_printf (MIO *mio, const char *format, ...) CTAGS_ATTR_PRINTF (2, 3);
|
||||||
|
|
||||||
void mio_clearerr (MIO *mio);
|
void mio_clearerr (MIO *mio);
|
||||||
int mio_eof (MIO *mio);
|
int mio_eof (MIO *mio);
|
||||||
|
@ -208,7 +208,7 @@ void addIgnoreListFromFile (const char *const fileName)
|
|||||||
stringListCombine (Option.ignore, tokens);
|
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)
|
const char *const parameter)
|
||||||
{
|
{
|
||||||
if (parameter [0] == '\0')
|
if (parameter [0] == '\0')
|
||||||
|
@ -93,7 +93,7 @@ extern CONST_OPTION optionValues Option;
|
|||||||
/*
|
/*
|
||||||
* FUNCTION PROTOTYPES
|
* 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 freeList (stringList** const pString);
|
||||||
extern void setDefaultTagFileName (void);
|
extern void setDefaultTagFileName (void);
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ extern void freeParserResources (void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
extern void processLanguageDefineOption (const char *const option,
|
extern void processLanguageDefineOption (const char *const option,
|
||||||
const char *const UNUSED parameter)
|
const char *const parameter CTAGS_ATTR_UNUSED)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_REGEX
|
#ifdef HAVE_REGEX
|
||||||
if (parameter [0] == '\0')
|
if (parameter [0] == '\0')
|
||||||
|
@ -144,7 +144,7 @@ extern void addLanguageRegex (const langType language, const char* const regex);
|
|||||||
extern void installTagRegexTable (const langType language);
|
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 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 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 boolean enableRegexKind (const langType language, const int kind, const boolean mode);
|
||||||
extern void printRegexKindOptions (const langType language);
|
extern void printRegexKindOptions (const langType language);
|
||||||
extern void freeRegexResources (void);
|
extern void freeRegexResources (void);
|
||||||
|
@ -63,7 +63,7 @@ enum eErrorTypes { FATAL = 1, WARNING = 2, PERROR = 4 };
|
|||||||
*/
|
*/
|
||||||
extern void setExecutableName (const char *const path);
|
extern void setExecutableName (const char *const path);
|
||||||
extern const char *getExecutableName (void);
|
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 */
|
/* Memory allocation functions */
|
||||||
#ifdef NEED_PROTO_MALLOC
|
#ifdef NEED_PROTO_MALLOC
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
static boolean isPseudoTagsEnabled (xtagDesc *pdesc UNUSED)
|
static boolean isPseudoTagsEnabled (xtagDesc *pdesc CTAGS_ATTR_UNUSED)
|
||||||
{
|
{
|
||||||
return ! isDestinationStdout ();
|
return ! isDestinationStdout ();
|
||||||
}
|
}
|
||||||
|
@ -740,7 +740,7 @@ static const char *keywordString (const keywordId keyword)
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void UNUSED pt (tokenInfo *const token)
|
static void CTAGS_ATTR_UNUSED pt (tokenInfo *const token)
|
||||||
{
|
{
|
||||||
if (isType (token, TOKEN_NAME))
|
if (isType (token, TOKEN_NAME))
|
||||||
printf ("type: %-12s: %-13s line: %lu\n",
|
printf ("type: %-12s: %-13s line: %lu\n",
|
||||||
@ -755,7 +755,7 @@ static void UNUSED pt (tokenInfo *const token)
|
|||||||
tokenString (token->type), token->lineNumber);
|
tokenString (token->type), token->lineNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void UNUSED ps (statementInfo *const st)
|
static void CTAGS_ATTR_UNUSED ps (statementInfo *const st)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
printf("scope: %s decl: %s gotName: %s gotParenName: %s\n",
|
printf("scope: %s decl: %s gotName: %s gotParenName: %s\n",
|
||||||
|
@ -35,7 +35,7 @@ static kindOption LuaKinds [] = {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* for debugging purposes */
|
/* 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++)
|
for ( ; p != q; p++)
|
||||||
fprintf (errout, "%c", *p);
|
fprintf (errout, "%c", *p);
|
||||||
|
@ -465,13 +465,13 @@ static objcToken waitedToken, fallBackToken;
|
|||||||
/* Ignore everything till waitedToken and jump to comeAfter.
|
/* Ignore everything till waitedToken and jump to comeAfter.
|
||||||
* If the "end" keyword is encountered break, doesn't remember
|
* If the "end" keyword is encountered break, doesn't remember
|
||||||
* why though. */
|
* 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)
|
if (what == waitedToken)
|
||||||
toDoNext = comeAfter;
|
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)
|
if (what == waitedToken)
|
||||||
toDoNext = comeAfter;
|
toDoNext = comeAfter;
|
||||||
@ -482,7 +482,7 @@ static void tillTokenOrFallBack (vString * const UNUSED (ident), objcToken what)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int ignoreBalanced_count = 0;
|
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)
|
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)
|
switch (what)
|
||||||
{
|
{
|
||||||
@ -943,7 +943,7 @@ static void parseTypedef (vString * const ident, objcToken what)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static boolean ignorePreprocStuff_escaped = FALSE;
|
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)
|
switch (what)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user