[geany/geany] cb7da7: Add CTAGS_ATTR_ prefix to UNUSED() and PRINTF() macros

Jiří Techet git-noreply at xxxxx
Sat Sep 10 07:26:33 UTC 2016


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Mon, 22 Aug 2016 12:54:19 UTC
Commit:      cb7da79824ccd023c495de37f047ae1441b45fd5
             https://github.com/geany/geany/commit/cb7da79824ccd023c495de37f047ae1441b45fd5

Log Message:
-----------
Add CTAGS_ATTR_ prefix to UNUSED() and PRINTF() macros

Also fix the macro use in objc.c to appear behind variables.


Modified Paths:
--------------
    ctags/main/general.h
    ctags/main/lregex.c
    ctags/main/mio.h
    ctags/main/options.c
    ctags/main/options.h
    ctags/main/parse.c
    ctags/main/parse.h
    ctags/main/routines.h
    ctags/main/xtag.c
    ctags/parsers/c.c
    ctags/parsers/lua.c
    ctags/parsers/objc.c

Modified: ctags/main/general.h
8 lines changed, 4 insertions(+), 4 deletions(-)
===================================================================
@@ -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
 
 


Modified: ctags/main/lregex.c
30 lines changed, 15 insertions(+), 15 deletions(-)
===================================================================
@@ -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)


Modified: ctags/main/mio.h
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -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);


Modified: ctags/main/options.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -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')


Modified: ctags/main/options.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -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);
 


Modified: ctags/main/parse.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -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')


Modified: ctags/main/parse.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -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);


Modified: ctags/main/routines.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -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


Modified: ctags/main/xtag.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -20,7 +20,7 @@
 #include <string.h>
 
 
-static boolean isPseudoTagsEnabled (xtagDesc *pdesc UNUSED)
+static boolean isPseudoTagsEnabled (xtagDesc *pdesc CTAGS_ATTR_UNUSED)
 {
 	return ! isDestinationStdout ();
 }


Modified: ctags/parsers/c.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -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",


Modified: ctags/parsers/lua.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -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);


Modified: ctags/parsers/objc.c
10 lines changed, 5 insertions(+), 5 deletions(-)
===================================================================
@@ -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)
 	{



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list