From 6954a88be47ff349b22a6a8668f84ae0d745a294 Mon Sep 17 00:00:00 2001 From: s_c_c Date: Fri, 22 Mar 2024 14:58:13 +0800 Subject: [PATCH] feat for embedded fix dsoftbus compile errors --- .../nstackx/fillp/src/fillp_lib/src/fillp/fillp_input.c | 2 +- components/nstackx/nstackx_ctrl/core/coap_discover/coap_app.c | 4 ++-- core/common/dfx/hisysevent_adapter/softbus_hisysevt_nstack.c | 4 ++-- sdk/BUILD.gn | 1 + .../trans_channel/proxy/src/client_trans_proxy_file_manager.c | 3 ++- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/components/nstackx/fillp/src/fillp_lib/src/fillp/fillp_input.c b/components/nstackx/fillp/src/fillp_lib/src/fillp/fillp_input.c index 2c0d51f..4123ac4 100644 --- a/components/nstackx/fillp/src/fillp_lib/src/fillp/fillp_input.c +++ b/components/nstackx/fillp/src/fillp_lib/src/fillp/fillp_input.c @@ -736,7 +736,7 @@ static void MoveUnackToUnrecvByPackInfo(struct FillpPcb *pcb, FILLP_UINT32 ackSe } } -static void FillpPackInputLog(FILLP_CONST struct FillpPcb *pcb) +__attribute__((unused)) static void FillpPackInputLog(FILLP_CONST struct FillpPcb *pcb) { FILLP_LOGDBG("fillp_sock_id:%d nackSend:%u,nackFailed:%u,nackRcv:%u,packSend:%u,packFailed:%u,packRcv:%u", FILLP_GET_SOCKET(pcb)->index, pcb->statistics.debugPcb.nackSend, pcb->statistics.debugPcb.nackFailed, diff --git a/components/nstackx/nstackx_ctrl/core/coap_discover/coap_app.c b/components/nstackx/nstackx_ctrl/core/coap_discover/coap_app.c index 3496a1b..ea0a21a 100644 --- a/components/nstackx/nstackx_ctrl/core/coap_discover/coap_app.c +++ b/components/nstackx/nstackx_ctrl/core/coap_discover/coap_app.c @@ -40,8 +40,8 @@ #ifdef DFINDER_SUPPORT_MULTI_NIF static CoapCtxType g_coapCtxArr[NSTACKX_MAX_LISTENED_NIF_NUM] = { - {NULL, {0}, 0, NSTACKX_FALSE}, - {NULL, {0}, 0, NSTACKX_FALSE} + {NULL, {{0}}, 0, NSTACKX_FALSE}, + {NULL, {{0}}, 0, NSTACKX_FALSE} }; #else static coap_context_t *g_ctx = NULL; diff --git a/core/common/dfx/hisysevent_adapter/softbus_hisysevt_nstack.c b/core/common/dfx/hisysevent_adapter/softbus_hisysevt_nstack.c index 07f88c2..cffb774 100644 --- a/core/common/dfx/hisysevent_adapter/softbus_hisysevt_nstack.c +++ b/core/common/dfx/hisysevent_adapter/softbus_hisysevt_nstack.c @@ -110,7 +110,7 @@ static int CopyEventParamVal(SoftBusEvtParamType type, void *dst, const void *sr static int NstackEventParaToSoftBusEventPara(SoftBusEvtParam *dst, const NstackDfxEvtParam *src) { - if (src->type >= SOFTBUS_EVT_PARAMTYPE_BUTT) { + if (src->type >= (int)SOFTBUS_EVT_PARAMTYPE_BUTT) { LOG_ERR("softbus paramType max %d, nstack paramType %d", SOFTBUS_EVT_PARAMTYPE_BUTT, src->type); return SOFTBUS_ERR; @@ -133,7 +133,7 @@ static int NstackDfxEvtToSoftBusReportMsg(SoftBusEvtReportMsg *msg, const Nstack LOG_ERR("eventName mismatch, nstack event name %s", info->eventName); return SOFTBUS_ERR; } - if (info->type >= SOFTBUS_EVT_TYPE_BUTT) { + if (info->type >= (int)SOFTBUS_EVT_TYPE_BUTT) { LOG_ERR("eventType mismatch, nstack event type %d", info->type); return SOFTBUS_ERR; } diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn index 10fbe2f..7d1c5e9 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -98,4 +98,5 @@ target(build_type, "softbus_client") { part_name = "dsoftbus" subsystem_name = "communication" } + cflags += [ "-Wno-unknown-pragmas" ] } diff --git a/sdk/transmission/trans_channel/proxy/src/client_trans_proxy_file_manager.c b/sdk/transmission/trans_channel/proxy/src/client_trans_proxy_file_manager.c index 6f63a66..b42b4ce 100644 --- a/sdk/transmission/trans_channel/proxy/src/client_trans_proxy_file_manager.c +++ b/sdk/transmission/trans_channel/proxy/src/client_trans_proxy_file_manager.c @@ -1394,7 +1394,8 @@ static int32_t PutToRecvFileList(FileRecipientInfo *recipient, const SingleFileI SoftBusCloseFile(fd); return SOFTBUS_FILE_ERR; } - (void)ftruncate(fd, 0); + int ret = ftruncate(fd, 0); + (void)ret; recipient->recvFileInfo.fileStatus = NODE_BUSY; recipient->recvFileInfo.fileOffset = 0; recipient->recvFileInfo.timeOut = 0; -- 2.20.1 (Apple Git-117)