@@ -539,18 +539,18 @@ unsigned int CppCheck::checkClang(const std::string &path)
539539 return mExitCode ;
540540}
541541
542- unsigned int CppCheck::check (const std::string &path )
542+ unsigned int CppCheck::check (const FileWithDetails &file )
543543{
544544 if (mSettings .clang )
545- return checkClang (Path::simplifyPath (path ));
545+ return checkClang (file. spath ( ));
546546
547- return checkFile (Path::simplifyPath (path ), emptyString);
547+ return checkFile (file. spath ( ), emptyString);
548548}
549549
550- unsigned int CppCheck::check (const std::string &path , const std::string &content)
550+ unsigned int CppCheck::check (const FileWithDetails &file , const std::string &content)
551551{
552552 std::istringstream iss (content);
553- return checkFile (Path::simplifyPath (path ), emptyString, &iss);
553+ return checkFile (file. spath ( ), emptyString, &iss);
554554}
555555
556556unsigned int CppCheck::check (const FileSettings &fs)
@@ -578,12 +578,12 @@ unsigned int CppCheck::check(const FileSettings &fs)
578578 if (mSettings .clang ) {
579579 temp.mSettings .includePaths .insert (temp.mSettings .includePaths .end (), fs.systemIncludePaths .cbegin (), fs.systemIncludePaths .cend ());
580580 // TODO: propagate back suppressions
581- const unsigned int returnValue = temp.check (Path::simplifyPath ( fs.filename ()) );
581+ const unsigned int returnValue = temp.check (fs.file );
582582 if (mUnusedFunctionsCheck )
583583 mUnusedFunctionsCheck ->updateFunctionData (*temp.mUnusedFunctionsCheck );
584584 return returnValue;
585585 }
586- const unsigned int returnValue = temp.checkFile (Path::simplifyPath ( fs.filename () ), fs.cfg );
586+ const unsigned int returnValue = temp.checkFile (fs.sfilename ( ), fs.cfg );
587587 mSettings .supprs .nomsg .addSuppressions (temp.mSettings .supprs .nomsg .getSuppressions ());
588588 if (mUnusedFunctionsCheck )
589589 mUnusedFunctionsCheck ->updateFunctionData (*temp.mUnusedFunctionsCheck );
@@ -612,8 +612,7 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string
612612 const Timer fileTotalTimer (mSettings .showtime == SHOWTIME_MODES::SHOWTIME_FILE_TOTAL, filename);
613613
614614 if (!mSettings .quiet ) {
615- std::string fixedpath = Path::simplifyPath (filename);
616- fixedpath = Path::toNativeSeparators (std::move (fixedpath));
615+ std::string fixedpath = Path::toNativeSeparators (filename);
617616 mErrorLogger .reportOut (std::string (" Checking " ) + fixedpath + ' ' + cfgname + std::string (" ..." ), Color::FgGreen);
618617
619618 if (mSettings .verbose ) {
@@ -867,8 +866,7 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string
867866
868867 // If only errors are printed, print filename after the check
869868 if (!mSettings .quiet && (!mCurrentConfig .empty () || checkCount > 1 )) {
870- std::string fixedpath = Path::simplifyPath (filename);
871- fixedpath = Path::toNativeSeparators (std::move (fixedpath));
869+ std::string fixedpath = Path::toNativeSeparators (filename);
872870 mErrorLogger .reportOut (" Checking " + fixedpath + " : " + mCurrentConfig + " ..." , Color::FgGreen);
873871 }
874872
@@ -973,7 +971,7 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string
973971 fdump.close ();
974972 }
975973
976- executeAddons (dumpFile, Path::simplifyPath ( filename) );
974+ executeAddons (dumpFile, filename);
977975
978976 } catch (const TerminateException &) {
979977 // Analysis is terminated
0 commit comments