diff --git a/docs/changes.md b/docs/changes.md index 5ea5374f7..27e12b827 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -4,6 +4,7 @@ * 修复启动时 widget\_is\_keyboard 和 widget\_is\_normal\_window 的判空警告, 使用了 free 且未置空的指针(感谢高源提供补丁)。 * 修复在 lcd_mem 模式下,创建离线画布影响全局LCD宽高问题(感谢高源提供补丁)。 * 补全svg_image离线画布创建时的编码格式(感谢高源提供补丁)。 + * 完善 api\_doc\_lint VS2023编译问题(感谢俊圣提供补丁)。 2023/05/04 * 完善tk\_object\_to\_json对不同数据类型和数组的处理。 diff --git a/tests/api_doc_lint_test.cc b/tests/api_doc_lint_test.cc index 7acccc580..2a323fdf2 100644 --- a/tests/api_doc_lint_test.cc +++ b/tests/api_doc_lint_test.cc @@ -57,10 +57,10 @@ static const char* errs[] = { "(829): error: nothing can be written between @param\n", "(934): error: unknown annotation \"string1\"\n", "(940): error: @const name invalid CODE_EDIT_PROP_LANG1 -- CODE_EDIT_PROP_LANG\n", - "(1096): error: @prefix name missing\n"}; + "(1098): error: @prefix name missing\n"}; static const char* warns[] = { - "(1076): warning: @prefix missing\n", + "(1078): warning: @prefix missing\n", }; void dummy_log(void* ctx, log_level_t level, const char* s) { diff --git a/tools/api_doc_lint/ctags/c.c b/tools/api_doc_lint/ctags/c.c index ba1631c75..d2f4dbe60 100644 --- a/tools/api_doc_lint/ctags/c.c +++ b/tools/api_doc_lint/ctags/c.c @@ -628,7 +628,7 @@ static const char *keywordString (const keywordId keyword) return name; } -static void __unused__ pt (tokenInfo *const token) +static void pt (tokenInfo *const token) { if (isType (token, TOKEN_NAME)) printf ("type: %-12s: %-13s line: %lu\n", @@ -643,7 +643,7 @@ static void __unused__ pt (tokenInfo *const token) tokenString (token->type), token->lineNumber); } -static void __unused__ ps (statementInfo *const st) +static void ps (statementInfo *const st) { unsigned int i; printf ("scope: %s decl: %s gotName: %s gotParenName: %s\n", diff --git a/tools/api_doc_lint/ctags/general.h b/tools/api_doc_lint/ctags/general.h index e1f7f9994..67148d29c 100644 --- a/tools/api_doc_lint/ctags/general.h +++ b/tools/api_doc_lint/ctags/general.h @@ -37,7 +37,6 @@ # endif #endif - /* * MACROS */ @@ -53,14 +52,9 @@ # define HAVE_REGEX 1 #endif -/* This is a helpful internal feature of later versions (> 2.7) of GCC - * 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))) #else -# define __unused__ # define __printf__(s,f) #endif diff --git a/tools/api_doc_lint/ctags/lregex.c b/tools/api_doc_lint/ctags/lregex.c index 304696cfd..7a2f8de7a 100644 --- a/tools/api_doc_lint/ctags/lregex.c +++ b/tools/api_doc_lint/ctags/lregex.c @@ -530,11 +530,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 , + const char* const regex , + const char* const name , + const char* const kinds , + const char* const flags ) { #ifdef HAVE_REGEX Assert (regex != NULL); @@ -556,10 +556,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 , + const char* const regex , + const char* const flags , + const regexCallback callback ) { #ifdef HAVE_REGEX Assert (regex != NULL); @@ -573,7 +573,7 @@ extern void addCallbackRegex ( } extern void addLanguageRegex ( - const langType language __unused__, const char* const regex __unused__) + const langType language , const char* const regex ) { #ifdef HAVE_REGEX if (! regexBroken) @@ -594,7 +594,7 @@ extern void addLanguageRegex ( */ extern boolean processRegexOption (const char *const option, - const char *const parameter __unused__) + const char *const parameter ) { boolean handled = FALSE; const char* const dash = strchr (option, '-'); @@ -616,7 +616,7 @@ extern boolean processRegexOption (const char *const option, return handled; } -extern void disableRegexKinds (const langType language __unused__) +extern void disableRegexKinds (const langType language ) { #ifdef HAVE_REGEX if (language <= SetUpper && Sets [language].count > 0) @@ -631,8 +631,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 , + const int kind , const boolean mode ) { boolean result = FALSE; #ifdef HAVE_REGEX @@ -652,7 +652,7 @@ extern boolean enableRegexKind ( return result; } -extern void printRegexKinds (const langType language __unused__, boolean indent) +extern void printRegexKinds (const langType language , boolean indent) { #ifdef HAVE_REGEX if (language <= SetUpper && Sets [language].count > 0) diff --git a/tools/api_doc_lint/ctags/options.c b/tools/api_doc_lint/ctags/options.c index 33a16ec32..a2d9db5d4 100644 --- a/tools/api_doc_lint/ctags/options.c +++ b/tools/api_doc_lint/ctags/options.c @@ -736,7 +736,7 @@ static void processEtagsInclude ( } static void processExcludeOption ( - const char *const option __unused__, const char *const parameter) + const char *const option , const char *const parameter) { const char *const fileName = parameter + 1; if (parameter [0] == '\0') @@ -873,7 +873,7 @@ static void processFieldsOption ( } static void processFilterTerminatorOption ( - const char *const option __unused__, const char *const parameter) + const char *const option , const char *const parameter) { freeString (&Option.filterTerminator); Option.filterTerminator = stringCopy (parameter); @@ -935,8 +935,8 @@ static void printProgramIdentification (void) } static void processHelpOption ( - const char *const option __unused__, - const char *const parameter __unused__) + const char *const option , + const char *const parameter ) { printProgramIdentification (); putchar ('\n'); @@ -1144,8 +1144,8 @@ static void processLanguagesOption ( } static void processLicenseOption ( - const char *const option __unused__, - const char *const parameter __unused__) + const char *const option , + const char *const parameter ) { printProgramIdentification (); puts (""); @@ -1171,8 +1171,8 @@ static void processListKindsOption ( } static void processListMapsOption ( - const char *const __unused__ option, - const char *const __unused__ parameter) + const char *const option, + const char *const parameter) { if (parameter [0] == '\0' || strcasecmp (parameter, "all") == 0) printLanguageMaps (LANG_AUTO); @@ -1188,8 +1188,8 @@ static void processListMapsOption ( } static void processListLanguagesOption ( - const char *const option __unused__, - const char *const parameter __unused__) + const char *const option , + const char *const parameter ) { printLanguageList (); exit (0); @@ -1363,8 +1363,8 @@ static void processIgnoreOption (const char *const list) } static void processVersionOption ( - const char *const option __unused__, - const char *const parameter __unused__) + const char *const option , + const char *const parameter ) { printProgramIdentification (); exit (0); diff --git a/tools/api_doc_lint/ctags/parse.c b/tools/api_doc_lint/ctags/parse.c index 4b695d5e0..79ce81002 100644 --- a/tools/api_doc_lint/ctags/parse.c +++ b/tools/api_doc_lint/ctags/parse.c @@ -383,7 +383,7 @@ extern void freeParserResources (void) */ extern void processLanguageDefineOption ( - const char *const option, const char *const parameter __unused__) + const char *const option, const char *const parameter ) { #ifdef HAVE_REGEX if (parameter [0] == '\0') diff --git a/tools/api_doc_lint/ctags/routines.c b/tools/api_doc_lint/ctags/routines.c index 4d4c566ec..c5796ed18 100644 --- a/tools/api_doc_lint/ctags/routines.c +++ b/tools/api_doc_lint/ctags/routines.c @@ -504,7 +504,7 @@ static boolean isPathSeparator (const int c) #if ! defined (HAVE_STAT_ST_INO) -static void canonicalizePath (char *const path __unused__) +static void canonicalizePath (char *const path) { #if defined (MSDOS_STYLE_PATH) char *p;