Skip to content

Commit

Permalink
build: resolve 10 instances of -Wshadow
Browse files Browse the repository at this point in the history
lib/mapi/msgchg_groups.cpp:98:22: warning: declaration of "err" shadows a previous local [-Wshadow]
exch/http/pdu_processor.cpp:1854:29: warning: declaration of "pkt" shadows a member of "dcerpc_call" [-Wshadow]
exch/http/pdu_processor.cpp:2088:29: warning: declaration of "pkt" shadows a member of "dcerpc_call" [-Wshadow]
exch/http/pdu_processor.cpp:2164:29: warning: declaration of "pkt" shadows a member of "dcerpc_call" [-Wshadow]
exch/http/pdu_processor.cpp:2200:29: warning: declaration of "pkt" shadows a member of "dcerpc_call" [-Wshadow]
exch/http/pdu_processor.cpp:2238:29: warning: declaration of "pkt" shadows a member of "dcerpc_call" [-Wshadow]
exch/zcore/common_util.cpp:1970:23: warning: declaration of "using LLU = long long unsigned int" shadows a global declaration [-Wshadow]
tools/mbop_main.cpp:348:29: warning: declaration of "ret" shadows a previous local [-Wshadow]
exch/ews/ews.cpp:511:21: warning: declaration of "smtp_url" shadows a member of 'gromox::EWS::EWSPlugin' [-Wshadow]
exch/emsmdb/common_util.cpp:1496:15: warning: declaration of "using LLU = long long unsigned int" shadows a global declaration [-Wshadow]

Fixes: gromox-2.20-25-gb64c4ddff
References: GXH-82
  • Loading branch information
jengelh committed Jan 3, 2024
1 parent 8e80e43 commit a4c1450
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 35 deletions.
1 change: 0 additions & 1 deletion exch/emsmdb/common_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,6 @@ ec_error_t cu_send_message(logon_object *plogon, message_object *msg, bool b_sub
uint64_t new_id;
uint64_t folder_id;
MESSAGE_CONTENT *pmsgctnt;
using LLU = unsigned long long;

auto pinfo = emsmdb_interface_get_emsmdb_info();
auto dir = plogon->get_dir();
Expand Down
1 change: 0 additions & 1 deletion exch/ews/ews.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ void EWSPlugin::loadConfig()
max_user_photo_size = cfg->get_ll("ews_max_user_photo_size");

auto str = gxcfg->get_value("outgoing_smtp_url");
std::string smtp_url;
if (str != nullptr) {
try {
smtp_url = vmime::utility::url(str);
Expand Down
60 changes: 30 additions & 30 deletions exch/http/pdu_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1851,13 +1851,13 @@ void pdu_processor_rts_echo(char *pbuff)
BOOL dcerpc_call::rts_ping() try
{
auto pcall = this;
dcerpc_ncacn_packet pkt(pcall->b_bigendian);
dcerpc_ncacn_packet dnp(pcall->b_bigendian);

pkt.call_id = pcall->pkt.call_id;
pkt.pkt_type = DCERPC_PKT_RTS;
pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST;
dnp.call_id = pcall->pkt.call_id;
dnp.pkt_type = DCERPC_PKT_RTS;
dnp.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST;
auto rts = new dcerpc_rts;
pkt.payload = rts;
dnp.payload = rts;
rts->flags = RTS_FLAG_PING;
rts->num = 0;
rts->commands = nullptr;
Expand All @@ -1866,7 +1866,7 @@ BOOL dcerpc_call::rts_ping() try
pblob_node->node.pdata = pblob_node;
pblob_node->b_rts = TRUE;
if (!pdu_processor_ncacn_push_with_auth(&pblob_node->blob,
&pkt, NULL)) {
&dnp, nullptr)) {
delete pblob_node;
return FALSE;
}
Expand Down Expand Up @@ -2085,12 +2085,12 @@ BOOL dcerpc_call::rts_conn_c2(uint32_t in_window_size) try
pblob_node->node.pdata = pblob_node;
pblob_node->b_rts = TRUE;

dcerpc_ncacn_packet pkt(pcall->b_bigendian);
pkt.call_id = pcall->pkt.call_id;
pkt.pkt_type = DCERPC_PKT_RTS;
pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST;
dcerpc_ncacn_packet dnp(pcall->b_bigendian);
dnp.call_id = pcall->pkt.call_id;
dnp.pkt_type = DCERPC_PKT_RTS;
dnp.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST;
auto rts = new dcerpc_rts;
pkt.payload = rts;
dnp.payload = rts;
rts->flags = RTS_FLAG_NONE;
rts->num = 3;
rts->commands = me_alloc<RTS_CMD>(3);
Expand All @@ -2106,7 +2106,7 @@ BOOL dcerpc_call::rts_conn_c2(uint32_t in_window_size) try
rts->commands[2].command.connectiontimeout =
http_parser_get_param(HTTP_SESSION_TIMEOUT) * 1000;
if (!pdu_processor_ncacn_push_with_auth(&pblob_node->blob,
&pkt, NULL)) {
&dnp, nullptr)) {
delete pblob_node;
return FALSE;
}
Expand Down Expand Up @@ -2161,12 +2161,12 @@ BOOL dcerpc_call::rts_outr2_a2() try
pblob_node->node.pdata = pblob_node;
pblob_node->b_rts = TRUE;

dcerpc_ncacn_packet pkt(pcall->b_bigendian);
pkt.call_id = pcall->pkt.call_id;
pkt.pkt_type = DCERPC_PKT_RTS;
pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST;
dcerpc_ncacn_packet dnp(pcall->b_bigendian);
dnp.call_id = pcall->pkt.call_id;
dnp.pkt_type = DCERPC_PKT_RTS;
dnp.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST;
auto rts = new dcerpc_rts;
pkt.payload = rts;
dnp.payload = rts;
rts->flags = RTS_FLAG_RECYCLE_CHANNEL;
rts->num = 1;
rts->commands = me_alloc<RTS_CMD>(1);
Expand All @@ -2178,7 +2178,7 @@ BOOL dcerpc_call::rts_outr2_a2() try
rts->commands[0].command_type = RTS_CMD_DESTINATION;
rts->commands[0].command.destination = FD_CLIENT;
if (!pdu_processor_ncacn_push_with_auth(&pblob_node->blob,
&pkt, NULL)) {
&dnp, nullptr)) {
delete pblob_node;
return FALSE;
}
Expand All @@ -2197,12 +2197,12 @@ BOOL dcerpc_call::rts_outr2_a6() try
pblob_node->node.pdata = pblob_node;
pblob_node->b_rts = TRUE;

dcerpc_ncacn_packet pkt(pcall->b_bigendian);
pkt.call_id = pcall->pkt.call_id;
pkt.pkt_type = DCERPC_PKT_RTS;
pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST;
dcerpc_ncacn_packet dnp(pcall->b_bigendian);
dnp.call_id = pcall->pkt.call_id;
dnp.pkt_type = DCERPC_PKT_RTS;
dnp.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST;
auto rts = new dcerpc_rts;
pkt.payload = rts;
dnp.payload = rts;
rts->flags = RTS_FLAG_NONE;
rts->num = 2;
rts->commands = me_alloc<RTS_CMD>(2);
Expand All @@ -2216,7 +2216,7 @@ BOOL dcerpc_call::rts_outr2_a6() try

rts->commands[1].command_type = RTS_CMD_ANCE;
if (!pdu_processor_ncacn_push_with_auth(&pblob_node->blob,
&pkt, NULL)) {
&dnp, nullptr)) {
delete pblob_node;
return FALSE;
}
Expand All @@ -2235,12 +2235,12 @@ BOOL dcerpc_call::rts_outr2_b3() try
pblob_node->node.pdata = pblob_node;
pblob_node->b_rts = TRUE;

dcerpc_ncacn_packet pkt(pcall->b_bigendian);
pkt.call_id = pcall->pkt.call_id;
pkt.pkt_type = DCERPC_PKT_RTS;
pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST;
dcerpc_ncacn_packet dnp(pcall->b_bigendian);
dnp.call_id = pcall->pkt.call_id;
dnp.pkt_type = DCERPC_PKT_RTS;
dnp.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST;
auto rts = new dcerpc_rts;
pkt.payload = rts;
dnp.payload = rts;
rts->flags = RTS_FLAG_EOF;
rts->num = 1;
rts->commands = me_alloc<RTS_CMD>(1);
Expand All @@ -2251,7 +2251,7 @@ BOOL dcerpc_call::rts_outr2_b3() try

rts->commands[0].command_type = RTS_CMD_ANCE;
if (!pdu_processor_ncacn_push_with_auth(&pblob_node->blob,
&pkt, NULL)) {
&dnp, nullptr)) {
delete pblob_node;
return FALSE;
}
Expand Down
1 change: 0 additions & 1 deletion exch/zcore/common_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,6 @@ BOOL common_util_message_to_ical(store_object *pstore, uint64_t message_id,
common_util_set_dir(pstore->get_dir());
if (!oxcical_export(pmsgctnt, ical, g_org_name,
common_util_alloc, common_util_get_propids, cu_id2user)) {
using LLU = unsigned long long;
mlog(LV_DEBUG, "D-2202: oxcical_export %s:%llxh failed",
pstore->get_dir(), LLU{message_id});
return FALSE;
Expand Down
2 changes: 1 addition & 1 deletion lib/mapi/msgchg_groups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static errno_t mcg_loadfile(const char *file_path, uint32_t group_id)
if (tag_list == nullptr)
return EINVAL;
tag_entry tag;
auto err = mcg_parse(line, tag);
err = mcg_parse(line, tag);
if (err != 0)
return err;
tag_list->push_back(std::move(tag));
Expand Down
2 changes: 1 addition & 1 deletion tools/mbop_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static int main(int argc, const char **argv)
}
if (g_cutoff_time != 0 || g_recurse) {
/* Deletion via client */
int ret = do_hierarchy(eid);
ret = do_hierarchy(eid);
if (ret != EXIT_SUCCESS)
return ret;
continue;
Expand Down

0 comments on commit a4c1450

Please sign in to comment.