From 8967f5f090de50799f1c6756e1925b4933164fb3 Mon Sep 17 00:00:00 2001 From: Bruno Date: Mon, 6 Feb 2023 15:25:10 +0100 Subject: [PATCH] Forced int64 type for Session batch argument --- src/SessionCreator.cpp | 4 ++-- src/SessionVisitor.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SessionCreator.cpp b/src/SessionCreator.cpp index 1141124..b087ef2 100644 --- a/src/SessionCreator.cpp +++ b/src/SessionCreator.cpp @@ -236,7 +236,7 @@ void SessionCreator::loadInputCallbacks(tinyxml2::XMLElement *inputsNode) if (input > 0) { Target target; uint64_t sid = 0; - size_t bid = 0; + uint64_t bid = 0; if ( xmlCurrent_->QueryUnsigned64Attribute("id", &sid) != XML_NO_ATTRIBUTE ) { // find the source with the given id SourceList::iterator sit = session_->find(sid); @@ -247,7 +247,7 @@ void SessionCreator::loadInputCallbacks(tinyxml2::XMLElement *inputsNode) } else if ( xmlCurrent_->QueryUnsigned64Attribute("batch", &bid) != XML_NO_ATTRIBUTE ) { // assign variant - target = bid; + target = (size_t) bid; } // if could identify the target diff --git a/src/SessionVisitor.cpp b/src/SessionVisitor.cpp index 9d81cf3..fe0757f 100644 --- a/src/SessionVisitor.cpp +++ b/src/SessionVisitor.cpp @@ -237,7 +237,7 @@ void SessionVisitor::saveInputCallbacks(tinyxml2::XMLDocument *doc, Session *ses } // 2. Case of variant as index of batch else if ( const size_t* v = std::get_if(&kit->first)) { - cbNode->SetAttribute("batch", *v); + cbNode->SetAttribute("batch", (uint64_t) *v); } inputsNode->InsertEndChild(cbNode); // launch visitor to complete attributes