From 0ade5e8e9050927ca025ad3a87f743e65e24f605 Mon Sep 17 00:00:00 2001 From: jwx1102601 Date: Wed, 20 Dec 2023 15:24:16 +0800 Subject: [PATCH] update clang address Signed-off-by: jwx1102601 --- .../capi_parser/src/coreImpl/check/check.py | 18 ++++++++++-------- build-tools/capi_parser/src/utils/constants.py | 8 ++++---- third_party/musl/ndk_musl_include/ctype.h | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/build-tools/capi_parser/src/coreImpl/check/check.py b/build-tools/capi_parser/src/coreImpl/check/check.py index ce5fc5417..ac2bcf42b 100644 --- a/build-tools/capi_parser/src/coreImpl/check/check.py +++ b/build-tools/capi_parser/src/coreImpl/check/check.py @@ -22,6 +22,9 @@ from coreImpl.parser.parser import parser_include_ast from coreImpl.check.check_syntax import check_syntax +file_path_test = [] + + def process_api_json(api_info, file_doc_info: FileDocInfo, api_result_info_list): api_result_info_list.extend(check_ndk_name(api_info)) if 'comment' in api_info.keys(): @@ -69,14 +72,11 @@ def write_in_txt(check_result, output_path): def result_to_json(check_result): txt_resul = [] - if len(check_result) == 0: - txt_resul.append('api_check: false') - else: - for result in check_result: - location = f'{result.location}(line:{result.location_line}, col:{result.location_column})' - message = 'API check error of [{}]:{}'.format(result.error_type['description'], result.error_info) - txt_resul.append(OutputTxt(result.error_type['id'], result.level, location, result.file_name, message)) - txt_resul.append('api_check: false') + txt_resul.extend(file_path_test) + for result in check_result: + location = f'{result.location}(line:{result.location_line}, col:{result.location_column})' + message = 'API check error of [{}]:{}'.format(result.error_type['description'], result.error_info) + txt_resul.append(OutputTxt(result.error_type['id'], result.level, location, result.file_name, message)) return json.dumps(txt_resul, default=lambda obj: obj.__dict__, indent=4) @@ -89,6 +89,8 @@ def curr_entry(file_path): def get_check_result_list(file_list): check_result_list = [] for file in file_list: + global file_path_test + file_path_test.append(f'file_path: {file}') root_start = file.split('sdk_c')[0] root_path = f'{root_start}sdk_c' python_obj = parser_include_ast(root_path, [file]) diff --git a/build-tools/capi_parser/src/utils/constants.py b/build-tools/capi_parser/src/utils/constants.py index d8c08425f..23df32bd9 100644 --- a/build-tools/capi_parser/src/utils/constants.py +++ b/build-tools/capi_parser/src/utils/constants.py @@ -19,13 +19,13 @@ import enum class StringConstant(enum.Enum): - LIB_CLG_PATH = r'D:\Environment\LLVM\bin\libclang.dll' # 共享库 + LIB_CLG_PATH = r'/home/tools/llvm/lib/libclang.so' # 共享库 FUNK_NAME = "ohos_ndk_headers" REPLACE_WAREHOUSE = '\\interface_sdk_c\\interface_sdk_c' # 拉到本地仓路径(去掉磁盘) # 拉到本地仓的三方库绝对路径 - INCLUDE_LIB = r'.\third_party\musl\ndk_musl_include' - STD_INCLUDE = r'.\sysroot\ndk_musl_include_files' - SELF_INCLUDE = r'.\sysroot\self_include_files' + INCLUDE_LIB = r'third_party/musl/ndk_musl_include' + STD_INCLUDE = r'sysroot/ndk_musl_include_files' + SELF_INCLUDE = r'sysroot/self_include_files' RESULT_HEAD_NAME = "result_total.xlsx" diff --git a/third_party/musl/ndk_musl_include/ctype.h b/third_party/musl/ndk_musl_include/ctype.h index fbdba6e3f..54f55f0e8 100644 --- a/third_party/musl/ndk_musl_include/ctype.h +++ b/third_party/musl/ndk_musl_include/ctype.h @@ -45,7 +45,7 @@ static __inline int __isspace(int _c) #define __NEED_locale_t #include -int isalnum_l(int, locale_t); +int isalnum_ll(int, locale_t); int isalpha_l(int, locale_t); int isblank_l(int, locale_t); int iscntrl_l(int, locale_t); -- Gitee