From e759f71c5623e10aacc6ee8eae328db3b9d7b2ea Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Mon, 29 Apr 2024 18:47:35 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E7=A0=81=E4=BA=91=E9=87=8C?= =?utf8?q?=E6=A3=80=E6=B5=8B=E5=87=BA=E7=9A=84=E5=AE=89=E5=85=A8=E9=9A=90?= =?utf8?q?=E6=82=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../wearable/fd230app/nativeui/main/include/DialBinParser.h | 2 +- .../fd230app/nativeui/phoneservice/src/PhoneService.cpp | 1 + .../wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp | 2 +- .../wearable/fd230app/nativeui/system/src/Systemupgrade.cpp | 2 +- .../service/factorytest_service/factorytest_protocol.c | 4 ++-- .../wearable/service/msg_center/src/msg_center_cmd.cpp | 1 + code/sdk/drivers/peripheral/utils/custom_utils.c | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/DialBinParser.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/DialBinParser.h index dc737236f..78d3570af 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/include/DialBinParser.h +++ b/code/sdk/application/wearable/fd230app/nativeui/main/include/DialBinParser.h @@ -54,7 +54,7 @@ private: DialViewGroup* dialGroup_ = nullptr; std::string file_; - uint32_t dirId_ = 0xfef << 20; // 20: offset + uint32_t dirId_ = 0x00000fef << 20; // 20: offset uint32_t imageOffset_ = 0; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp index 5de08d38d..61774e425 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp @@ -957,6 +957,7 @@ int GetCallLog(CallLogInfo **info, int *num) ret = fread(callInfo, sizeof(CallLogInfo), number, fp); if (ret != number) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[GetCallLog] fread fp fail ret = %d", ret); + free(callInfo); *info = NULL; *num = 0; fclose(fp); diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp index 122c0adb0..bf1e77f3a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialModel.cpp @@ -105,7 +105,7 @@ namespace OHOS { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ParseDialHeader imageOffset: %u", dialHeader.imageOffset); ImageInfo *info = ImageCacheManager::GetInstance().LoadOneInMultiRes( - dialHeader.previewImgId | (0xfef << 20), dialFullName, fp, false, dialHeader.imageOffset); + dialHeader.previewImgId | (0x00000fef << 20), dialFullName, fp, false, dialHeader.imageOffset); if (info == nullptr) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ParseDialHeader loadimage fail"); return -1; diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp index 8145ef388..3eb158bcb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp @@ -104,7 +104,7 @@ namespace OHOS if(fp==NULL) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "open_UPDATAREPORT_fail"); - fclose(fp); + // fclose(fp); return; } diff --git a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c index 346ac7fd4..ff897fe7f 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c @@ -319,7 +319,7 @@ void aging_task(void) aging_t.restart_num = 0; PRINT("aging_t.restart_num : %d \r\n",aging_t.restart_num); - uint16_t before_block_num; + uint16_t before_block_num=0; struct nand_driver_struct *nandflash_driver; nandflash_driver = get_nand_flash(); for (uint32_t i = 0; i < nandflash_driver->total_block; i++) @@ -396,7 +396,7 @@ void aging_task(void) } PRINT("aging_t.flash_res_error : %d \r\n",aging_t.flash_res_error); - uint16_t after_block_num; + uint16_t after_block_num=0; nandflash_driver = get_nand_flash(); for (uint32_t i = 0; i < nandflash_driver->total_block; i++) { diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp index 6300431df..7f0c5dc3b 100755 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp @@ -74,6 +74,7 @@ char *msg_center_get_bundle_name(uint8_t cmd_id) WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER,"msg_center_get_bundle_name: wrong cmd_id[%d]", cmd_id); break; } + return NULL; } static errcode_t msg_center_pkt_dispatch(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index ef526a90f..b36dd01da 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -1422,7 +1422,7 @@ int set_bmp(void) /* 打开BMP 文件 */ FILE *fp = fopen(path, "r"); if (fp == NULL) { - fclose(fp); + // fclose(fp); PRINT("file open failed !!!\r\n"); return -1; } -- 2.17.1