From 42d2965727df1c0cc14e62a56f29e16d324310ec Mon Sep 17 00:00:00 2001 From: Zoltan Bojthe Date: Mon, 25 Sep 2023 11:42:41 +0200 Subject: [PATCH] all: follow omnetpp change: cNedValue::OBJECT renamed to POINTER --- src/inet/common/NedFunctions.cc | 13 +++++++++++++ .../common/TSNschedGateScheduleConfigurator.cc | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/src/inet/common/NedFunctions.cc b/src/inet/common/NedFunctions.cc index 54c77504da3..ef97fb3bf09 100644 --- a/src/inet/common/NedFunctions.cc +++ b/src/inet/common/NedFunctions.cc @@ -218,8 +218,16 @@ static cNedValue nedf_intWithUnit(cComponent *context, cNedValue argv[], int arg return cNedValue(checked_int_cast(floor(argv[0].doubleValueRaw())), argv[0].getUnit()); case cNedValue::STRING: throw cRuntimeError("intWithUnit(): Cannot convert string to int"); +#if OMNETPP_BUILDNUM < 1527 case cNedValue::OBJECT: throw cRuntimeError("intWithUnit(): Cannot convert cObject to int"); +#else + case cNedValue::POINTER: + if (argv[0].containsXML()) + throw cRuntimeError("intWithUnit(): Cannot convert xml to int"); + else + throw cRuntimeError("intWithUnit(): Cannot convert pointer to int"); +#endif default: throw cRuntimeError("Internal error: Invalid cNedValue type"); } @@ -232,8 +240,13 @@ Define_NED_Function2(nedf_intWithUnit, cNedValue nedf_xmlattr(cComponent *context, cNedValue argv[], int argc) { +#if OMNETPP_BUILDNUM < 1527 if (argv[0].getType() != cNedValue::OBJECT) throw cRuntimeError("xmlattr(): xmlNode argument must be an xml node"); +#else + if (argv[0].getType() != cNedValue::POINTER || !argv[0].containsXML()) + throw cRuntimeError("xmlattr(): xmlNode argument must be an xml node"); +#endif if (argv[1].getType() != cNEDValue::STRING) throw cRuntimeError("xmlattr(): attributeName argument must be a string"); diff --git a/src/inet/linklayer/configurator/gatescheduling/common/TSNschedGateScheduleConfigurator.cc b/src/inet/linklayer/configurator/gatescheduling/common/TSNschedGateScheduleConfigurator.cc index 2a9b016d93a..ea72aba8335 100644 --- a/src/inet/linklayer/configurator/gatescheduling/common/TSNschedGateScheduleConfigurator.cc +++ b/src/inet/linklayer/configurator/gatescheduling/common/TSNschedGateScheduleConfigurator.cc @@ -17,7 +17,11 @@ Define_Module(TSNschedGateScheduleConfigurator); static void printJson(std::ostream& stream, const cValue& value, int level = 0) { std::string indent(level * 2, ' '); +#if OMNETPP_BUILDNUM < 1527 if (value.getType() == cValue::OBJECT) { +#else + if (value.getType() == cNedValue::POINTER && value.containsObject()) { +#endif auto object = value.objectValue(); if (auto array = dynamic_cast(object)) { if (array->size() == 0)