@@ -237,11 +237,11 @@ void CTU::FileInfo::loadFromXml(const tinyxml2::XMLElement *xmlElement)
237237 if (std::strcmp (e->Name (), " function-call" ) == 0 ) {
238238 FunctionCall functionCall;
239239 if (functionCall.loadFromXml (e))
240- functionCalls.push_back (functionCall);
240+ functionCalls.push_back (std::move ( functionCall) );
241241 } else if (std::strcmp (e->Name (), " nested-call" ) == 0 ) {
242242 NestedCall nestedCall;
243243 if (nestedCall.loadFromXml (e))
244- nestedCalls.push_back (nestedCall);
244+ nestedCalls.push_back (std::move ( nestedCall) );
245245 }
246246 }
247247}
@@ -273,7 +273,7 @@ std::list<CTU::FileInfo::UnsafeUsage> CTU::loadUnsafeUsageListFromXml(const tiny
273273 unsafeUsage.value = readAttrInt (e, ATTR_VALUE, &error);
274274
275275 if (!error)
276- ret.push_back (unsafeUsage);
276+ ret.push_back (std::move ( unsafeUsage) );
277277 }
278278 return ret;
279279}
@@ -353,9 +353,9 @@ CTU::FileInfo *CTU::getFileInfo(const Tokenizer *tokenizer)
353353 loc.line = i.first ->linenr ();
354354 loc.column = i.first ->column ();
355355 loc.setinfo (i.second );
356- functionCall.callValuePath .push_back (loc);
356+ functionCall.callValuePath .push_back (std::move ( loc) );
357357 }
358- fileInfo->functionCalls .push_back (functionCall);
358+ fileInfo->functionCalls .push_back (std::move ( functionCall) );
359359 }
360360 // array
361361 if (argtok->variable () && argtok->variable ()->isArray () && argtok->variable ()->dimensions ().size () == 1 ) {
@@ -368,7 +368,7 @@ CTU::FileInfo *CTU::getFileInfo(const Tokenizer *tokenizer)
368368 functionCall.callArgumentExpression = argtok->expressionString ();
369369 functionCall.callArgValue = argtok->variable ()->dimension (0 ) * argtok->valueType ()->typeSize (*tokenizer->getSettings ());
370370 functionCall.warning = false ;
371- fileInfo->functionCalls .push_back (functionCall);
371+ fileInfo->functionCalls .push_back (std::move ( functionCall) );
372372 }
373373 // &var => buffer
374374 if (argtok->isUnaryOp (" &" ) && argtok->astOperand1 ()->variable () && argtok->astOperand1 ()->valueType () && !argtok->astOperand1 ()->variable ()->isArray ()) {
@@ -381,7 +381,7 @@ CTU::FileInfo *CTU::getFileInfo(const Tokenizer *tokenizer)
381381 functionCall.callArgumentExpression = argtok->expressionString ();
382382 functionCall.callArgValue = argtok->astOperand1 ()->valueType ()->typeSize (*tokenizer->getSettings ());
383383 functionCall.warning = false ;
384- fileInfo->functionCalls .push_back (functionCall);
384+ fileInfo->functionCalls .push_back (std::move ( functionCall) );
385385 }
386386 // pointer/reference to uninitialized data
387387 auto isAddressOfArg = [](const Token* argtok) -> const Token* {
@@ -414,7 +414,7 @@ CTU::FileInfo *CTU::getFileInfo(const Tokenizer *tokenizer)
414414 functionCall.callArgValue = 0 ;
415415 functionCall.callArgumentExpression = argtok->expressionString ();
416416 functionCall.warning = false ;
417- fileInfo->functionCalls .push_back (functionCall);
417+ fileInfo->functionCalls .push_back (std::move ( functionCall) );
418418 continue ;
419419 }
420420 }
@@ -428,7 +428,7 @@ CTU::FileInfo *CTU::getFileInfo(const Tokenizer *tokenizer)
428428 FileInfo::NestedCall nestedCall (tokenizer, scopeFunction, tok);
429429 nestedCall.myArgNr = argnr + 1 ;
430430 nestedCall.callArgNr = argnr2;
431- fileInfo->nestedCalls .push_back (nestedCall);
431+ fileInfo->nestedCalls .push_back (std::move ( nestedCall) );
432432 }
433433 }
434434 }
@@ -580,12 +580,12 @@ std::list<ErrorMessage::FileLocation> CTU::FileInfo::getErrorPath(InvalidValueTy
580580
581581 ErrorMessage::FileLocation fileLoc (path[index]->location .fileName , path[index]->location .lineNumber , path[index]->location .column );
582582 fileLoc.setinfo (" Calling function " + path[index]->callFunctionName + " , " + MathLib::toString (path[index]->callArgNr ) + getOrdinalText (path[index]->callArgNr ) + " argument is " + value1);
583- locationList.push_back (fileLoc);
583+ locationList.push_back (std::move ( fileLoc) );
584584 }
585585
586586 ErrorMessage::FileLocation fileLoc2 (unsafeUsage.location .fileName , unsafeUsage.location .lineNumber , unsafeUsage.location .column );
587587 fileLoc2.setinfo (replaceStr (info, " ARG" , unsafeUsage.myArgumentName ));
588- locationList.push_back (fileLoc2);
588+ locationList.push_back (std::move ( fileLoc2) );
589589
590590 return locationList;
591591}
0 commit comments