fix: not compiling on clang

This commit is contained in:
maelstrom 2025-05-17 19:22:02 +02:00
parent 6f9856c384
commit a022e682b7
2 changed files with 2 additions and 2 deletions

View file

@ -44,7 +44,7 @@ static std::string castFromVariant(std::string valueStr, std::string fieldType)
} }
std::string mappedType = MAPPED_TYPE[fieldType]; std::string mappedType = MAPPED_TYPE[fieldType];
return valueStr + ".get<" + (!mappedType.empty() ? mappedType : fieldType) + ">()"; return "(" + fieldType + ")" + valueStr + ".get<" + (!mappedType.empty() ? mappedType : fieldType) + ">()";
} }
static std::string castToVariant(std::string valueStr, std::string fieldType) { static std::string castToVariant(std::string valueStr, std::string fieldType) {

View file

@ -9,7 +9,7 @@ Service::Service(const InstanceType* type) : Instance(type){}
// Fail if parented to non-datamodel, otherwise lock parent // Fail if parented to non-datamodel, otherwise lock parent
void Service::OnParentUpdated(std::optional<std::shared_ptr<Instance>> oldParent, std::optional<std::shared_ptr<Instance>> newParent) { void Service::OnParentUpdated(std::optional<std::shared_ptr<Instance>> oldParent, std::optional<std::shared_ptr<Instance>> newParent) {
if (!newParent || newParent.value()->GetClass() != &DataModel::TYPE) { if (!newParent || newParent.value()->GetClass() != &DataModel::TYPE) {
Logger::fatalErrorf("Service %s was parented to object of type %s", GetClass()->className, newParent ? newParent.value()->GetClass()->className : "NULL"); Logger::fatalErrorf("Service %s was parented to object of type %s", GetClass()->className.c_str(), newParent ? newParent.value()->GetClass()->className.c_str() : "NULL");
panic(); panic();
} }