From 90f022549dd94ab5124d8f93fce22cfbd83b64dd Mon Sep 17 00:00:00 2001 From: xiyoo0812 Date: Wed, 8 May 2024 13:59:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91=E8=AD=A6?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/luabus/src/socket_router.cpp | 3 +-- core/luabus/src/socket_router.h | 2 +- extend/lunqlite/lunqlite.lmak | 2 +- extend/lunqlite/lunqlite.mak | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/luabus/src/socket_router.cpp b/core/luabus/src/socket_router.cpp index f7c554d3..a90ebb54 100644 --- a/core/luabus/src/socket_router.cpp +++ b/core/luabus/src/socket_router.cpp @@ -80,7 +80,7 @@ bool socket_router::do_forward_master(router_header* header, char* data, size_t return true; } -bool socket_router::do_forward_broadcast(router_header* header, int source, char* data, size_t data_len, size_t& broadcast_num) { +bool socket_router::do_forward_broadcast(router_header* header, uint32_t source, char* data, size_t data_len, size_t& broadcast_num) { uint16_t service_id = (uint16_t)header->target_id; uint8_t flag = header->context & 0xf; @@ -89,7 +89,6 @@ bool socket_router::do_forward_broadcast(router_header* header, int source, char auto& services = m_services[service_id]; auto& nodes = services.nodes; - int count = (int)nodes.size(); for (auto& target : nodes) { if (target.token != 0 && target.token != source) { m_mgr->sendv(target.token, items, _countof(items)); diff --git a/core/luabus/src/socket_router.h b/core/luabus/src/socket_router.h index 3c7ae16c..f946f0a5 100644 --- a/core/luabus/src/socket_router.h +++ b/core/luabus/src/socket_router.h @@ -56,7 +56,7 @@ class socket_router bool do_forward_hash(router_header* header, char* data, size_t data_len); bool do_forward_target(router_header* header, char* data, size_t data_len); bool do_forward_master(router_header* header, char* data, size_t data_len); - bool do_forward_broadcast(router_header* header, int source, char* data, size_t data_len, size_t& broadcast_num); + bool do_forward_broadcast(router_header* header, uint32_t source, char* data, size_t data_len, size_t& broadcast_num); private: size_t m_route_count = 0; diff --git a/extend/lunqlite/lunqlite.lmak b/extend/lunqlite/lunqlite.lmak index 301baecb..9fb72140 100644 --- a/extend/lunqlite/lunqlite.lmak +++ b/extend/lunqlite/lunqlite.lmak @@ -8,7 +8,7 @@ TARGET_NAME = "lunqlite" PROJECT_TYPE = "dynamic" FLAGS = { - "Wmisleading-indentation" + "Wno-misleading-indentation" } --需要的include目录 diff --git a/extend/lunqlite/lunqlite.mak b/extend/lunqlite/lunqlite.mak index af49d075..a410e5c2 100644 --- a/extend/lunqlite/lunqlite.mak +++ b/extend/lunqlite/lunqlite.mak @@ -20,7 +20,7 @@ MYCFLAGS += -Wno-unused-variable MYCFLAGS += -Wno-unused-parameter MYCFLAGS += -Wno-unused-but-set-variable MYCFLAGS += -Wno-unused-but-set-parameter -MYCFLAGS += -Wmisleading-indentation +MYCFLAGS += -Wno-misleading-indentation #c标准库版本 #gnu99/gnu11/gnu17