1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

iec60870: fix compiler warning

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
This commit is contained in:
Steffen Vogel 2023-04-03 13:03:59 +00:00 committed by Philipp Jungkamp
parent a709a8a0fb
commit ea1f8c3d51

View file

@ -260,7 +260,7 @@ bool ASDUData::addSampleToASDU(CS101_ASDU &asdu, ASDUData::Sample sample) const
? std::optional { timespec_to_cp56time2a(sample.timestamp.value()) }
: std::nullopt;
InformationObject io;
InformationObject io = nullptr;
switch (descriptor->type) {
case ASDUData::SCALED_INT: {
auto scaled_int_value = static_cast<int16_t>(sample.signal_data.i & 0xFFFF);
@ -337,6 +337,7 @@ bool ASDUData::addSampleToASDU(CS101_ASDU &asdu, ASDUData::Sample sample) const
}
bool successfully_added = CS101_ASDU_addInformationObject(asdu, io);
InformationObject_destroy(io);
return successfully_added;