unsigned int CppCheck::check(const ImportProject::FileSettings &fs) { CppCheck temp(_errorLogger, _useGlobalSuppressions); temp._settings = _settings; temp._settings.userDefines = fs.cppcheckDefines(); temp._settings.includePaths = fs.includePaths; // TODO: temp._settings.userUndefs = fs.undefs; if (fs.platformType != Settings::Unspecified) { temp._settings.platform(fs.platformType); } std::ifstream fin(fs.filename.c_str()); return temp.processFile(Path::simplifyPath(fs.filename), fs.cfg, fin); }
unsigned int CppCheck::check(const ImportProject::FileSettings &fs) { CppCheck temp(mErrorLogger, mUseGlobalSuppressions); temp.mSettings = mSettings; if (!temp.mSettings.userDefines.empty()) temp.mSettings.userDefines += ';'; temp.mSettings.userDefines += fs.cppcheckDefines(); temp.mSettings.includePaths = fs.includePaths; temp.mSettings.userUndefs = fs.undefs; if (fs.platformType != Settings::Unspecified) { temp.mSettings.platform(fs.platformType); } std::ifstream fin(fs.filename); return temp.checkFile(Path::simplifyPath(fs.filename), fs.cfg, fin); }