diff --git a/BUILD.gn b/BUILD.gn index 9d6fb4009baf57dd1969c3d3df80eddbf1d71df1..870dbae9a6a1b2a8eb82418c228feaf7d495eee1 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -3,7 +3,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index 6e3ba13dd568e35ef88abe518e953446c6bb8991..7481710b3516d82f96a68391b3fcac66aff81cef 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/interfaces/inner_api/syscap_interface.c b/interfaces/inner_api/syscap_interface.c index 10400be2a8d085de82970991229f75cd7d35e245..017eb5b7523edf5f04b7d9d111ae090cc219db0f 100644 --- a/interfaces/inner_api/syscap_interface.c +++ b/interfaces/inner_api/syscap_interface.c @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -178,8 +178,7 @@ bool DecodeOsSyscap(const char input[PCID_MAIN_BYTES], char (**output)[SINGLE_SY *outputCnt = 0; return false; } - (void)memset_s(strSyscap, countOfSyscap * SINGLE_SYSCAP_LEN, \ - 0, countOfSyscap * SINGLE_SYSCAP_LEN); + (void)memset_s(strSyscap, countOfSyscap * SINGLE_SYSCAP_LEN, 0, countOfSyscap * SINGLE_SYSCAP_LEN); *output = strSyscap; for (i = 0; i < countOfSyscap; i++) { @@ -279,7 +278,7 @@ static int SetOsSysCapBitMap(uint8_t *out, uint16_t outLen, const uint16_t *inde PRINT_ERR("Syscap num(%u) out of range(120).\n", sector); return -1; } - out[sector] |= (1 << pos); + out[sector] |= (1 << pos); } return 0; } @@ -411,7 +410,7 @@ static void PartSysCapAndOutBuffer(struct FreeAfterDecodeRpcidInfo freeAfterDeco uint16_t indexPri = 0; cJSON *cJsonTemp = NULL; - freeAfterDecodeRpcidInfo.sysCapDefine = CreateWholeSyscapJsonObj(); + freeAfterDecodeRpcidInfo.sysCapDefine = CreateWholeSyscapJsonObj(); (void)memset_s(priSyscapArray, freeAfterDecodeRpcidInfo.sysCapArraySize * SINGLE_SYSCAP_LEN, 0, freeAfterDecodeRpcidInfo.sysCapArraySize * SINGLE_SYSCAP_LEN); freeAfterDecodeRpcidInfo.priSyscap = priSyscapArray; @@ -647,7 +646,7 @@ int32_t ComparePcidString(const char *pcidString, const char *rpcidString, Compa uint32_t rpcidOsAarry[PCID_OUT_BUFFER] = {0}; const size_t allSyscapNum = sizeof(g_arraySyscap) / sizeof(SyscapWithNum); - pcidPriSyscapInfo.ret = SeparateSyscapFromString(pcidString, pcidOsAarry, PCID_OUT_BUFFER, + pcidPriSyscapInfo.ret = SeparateSyscapFromString(pcidString, pcidOsAarry, PCID_OUT_BUFFER, &pcidPriSyscapInfo.pcidPriSyscap, &pcidPriSyscapInfo.pcidPriSyscapLen); pcidPriSyscapInfo.ret += SeparateSyscapFromString(rpcidString, rpcidOsAarry, RPCID_OUT_BUFFER, &pcidPriSyscapInfo.rpcidPriSyscap, &pcidPriSyscapInfo.rpcidPriSyscapLen); diff --git a/src/create_pcid.c b/src/create_pcid.c index 531698478299b3f228c1208c8e129b51c1322233..09aaa64d26d42d638348e57697302d36e2a5198a 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -202,7 +202,7 @@ int32_t GetPriSyscapLen(uint32_t privateCapSize, cJSON *jsonPriSyscapObj, uint16 return -1; } *len += (uint16_t)strlen(strchr(jsonArrayItem->valuestring, '.') + 1); - (*len)++; // for separator ',' + (*len)++; // for separator ',' } if ((*len + 1) > PRIVATE_SYSCAP_SIZE) { PRINT_ERR("context of \"pri\" array is too many.\n"); @@ -347,7 +347,7 @@ int32_t GetOsSyscap(PCIDMain *pcidMain, cJSON *sysCapObject) return 0; } -static int32_t GetPriSyscapResult(cJSON* capVectorPtr, int32_t ret) +static int32_t GetPriSyscapResult(cJSON *capVectorPtr, int32_t ret) { cJSON_Delete(capVectorPtr); return ret; diff --git a/tools/syscap_collector.py b/tools/syscap_collector.py index 19eb3979d41208a14662e1b4206b34243089951a..18ee661ba2099ae81ba212b89b7dae5f809a7bae 100755 --- a/tools/syscap_collector.py +++ b/tools/syscap_collector.py @@ -47,7 +47,7 @@ def dict_to_json(output_path: str, syscaps_dict: dict): counts = Counter(syscaps_list) duplicates = [elem for elem, count in counts.items() if count > 1] if len(duplicates) > 0: - print("repeated syscap: " + ",".join(duplicates)) + print("[Warning] repeated syscap: {}".format(",".join(duplicates))) syscaps_list = list(set(syscaps_list)) filename = os.path.join(output_path, f'{product_name}.json') with os.fdopen(os.open(filename, flags, modes), 'w') as f: