Skip to content

Commit f925e3e

Browse files
committed
src: fix format specifier warnings for nodeIds
simu5g/stack/phy/LtePhyBase.cc:214:93: warning: format specifies type 'int' but the argument has type 'MacNodeId' [-Wformat] 214 | throw cRuntimeError("LtePhyBase::sendMulticast - Error. Group ID %d is not valid.", groupId); ...
1 parent 5677fa6 commit f925e3e

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/simu5g/common/binder/Binder.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void Binder::registerNode(MacNodeId nodeId, cModule *nodeModule, RanNodeType typ
145145

146146
// validate input
147147
if (nodeInfoMap_.find(nodeId) != nodeInfoMap_.end())
148-
throw cRuntimeError("Cannot register node %s in Binder: macNodeId %d already occupied", nodeModule->getFullPath().c_str(), nodeId);
148+
throw cRuntimeError("Cannot register node %s in Binder: macNodeId %d already occupied", nodeModule->getFullPath().c_str(), num(nodeId));
149149

150150
if (type == NODEB) {
151151
if (getNodeTypeById(nodeId) != NODEB)

src/simu5g/stack/ip2nic/Ip2Nic.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,20 @@ void Ip2Nic::initialize(int stage)
6868
binder_->registerNode(nodeId_, bs, nodeType_, isNr);
6969

7070
// display node ID above node icon
71-
bs->getDisplayString().setTagArg("t", 0, opp_stringf("nodeId=%d", nodeId_).c_str());
71+
bs->getDisplayString().setTagArg("t", 0, opp_stringf("nodeId=%d", num(nodeId_)).c_str());
7272
}
7373
else if (nodeType_ == UE) {
7474
cModule *ue = getContainingNode(this);
7575
servingNodeId_ = MacNodeId(ue->par("servingNodeId").intValue());
7676
nodeId_ = MacNodeId(ue->par("macNodeId").intValue());
7777
binder_->registerNode(nodeId_, ue, nodeType_, false);
78-
ue->getDisplayString().setTagArg("t", 0, opp_stringf("nodeId=%d", nodeId_).c_str());
78+
ue->getDisplayString().setTagArg("t", 0, opp_stringf("nodeId=%d", num(nodeId_)).c_str());
7979

8080
if (ue->hasPar("nrServingNodeId") && ue->par("nrServingNodeId").intValue() != 0) { // register also the NR MacNodeId
8181
nrServingNodeId_ = MacNodeId(ue->par("nrServingNodeId").intValue());
8282
nrNodeId_ = MacNodeId(ue->par("nrMacNodeId").intValue());
8383
binder_->registerNode(nrNodeId_, ue, nodeType_, true);
84-
ue->getDisplayString().setTagArg("t", 0, opp_stringf("nodeId=%d/%d", nodeId_, nrNodeId_).c_str());
84+
ue->getDisplayString().setTagArg("t", 0, opp_stringf("nodeId=%d/%d", num(nodeId_), num(nrNodeId_)).c_str());
8585
}
8686
}
8787

src/simu5g/stack/mac/LteMacEnb.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void LteMacEnb::initialize(int stage)
130130
nodeId_ = MacNodeId(networkNode_->par("macNodeId").intValue());
131131

132132
// display node ID above module icon
133-
getDisplayString().setTagArg("t", 0, opp_stringf("nodeId=%d", nodeId_).c_str());
133+
getDisplayString().setTagArg("t", 0, opp_stringf("nodeId=%d", num(nodeId_)).c_str());
134134

135135
cellId_ = nodeId_;
136136

src/simu5g/stack/mac/LteMacUe.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void LteMacUe::initialize(int stage)
7373
else if (stage == inet::INITSTAGE_NETWORK_LAYER) {
7474

7575
// display node ID above module icon
76-
getDisplayString().setTagArg("t", 0, opp_stringf("nodeId=%d", nodeId_).c_str());
76+
getDisplayString().setTagArg("t", 0, opp_stringf("nodeId=%d", num(nodeId_)).c_str());
7777

7878
// Insert UeInfo in the Binder
7979
UeInfo *info = new UeInfo();

src/simu5g/stack/phy/LtePhyBase.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void LtePhyBase::sendMulticast(LteAirFrame *frame)
211211
// get the group Id
212212
MacNodeId groupId = ci->getPacketMulticastGroupId();
213213
if (groupId == NODEID_NONE)
214-
throw cRuntimeError("LtePhyBase::sendMulticast - Error. Group ID %d is not valid.", groupId);
214+
throw cRuntimeError("LtePhyBase::sendMulticast - Error. Group ID %d is not valid.", num(groupId));
215215

216216
// transfer control info into airframe fields
217217
frame->setAdditionalInfo(*ci);

0 commit comments

Comments
 (0)