@@ -228,30 +228,30 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
228228
229229 // Enables inline suppressions.
230230 else if (std::strcmp (argv[i], " --inline-suppr" ) == 0 )
231- _settings->_inlineSuppressions = true ;
231+ _settings->inlineSuppressions = true ;
232232
233233 // Verbose error messages (configuration info)
234234 else if (std::strcmp (argv[i], " -v" ) == 0 || std::strcmp (argv[i], " --verbose" ) == 0 )
235- _settings->_verbose = true ;
235+ _settings->verbose = true ;
236236
237237 // Force checking of files that have "too many" configurations
238238 else if (std::strcmp (argv[i], " -f" ) == 0 || std::strcmp (argv[i], " --force" ) == 0 )
239- _settings->_force = true ;
239+ _settings->force = true ;
240240
241241 // Output relative paths
242242 else if (std::strcmp (argv[i], " -rp" ) == 0 || std::strcmp (argv[i], " --relative-paths" ) == 0 )
243- _settings->_relativePaths = true ;
243+ _settings->relativePaths = true ;
244244 else if (std::strncmp (argv[i], " -rp=" , 4 ) == 0 || std::strncmp (argv[i], " --relative-paths=" , 17 ) == 0 ) {
245- _settings->_relativePaths = true ;
245+ _settings->relativePaths = true ;
246246 if (argv[i][argv[i][3 ]==' =' ?4 :17 ] != 0 ) {
247247 std::string paths = argv[i]+(argv[i][3 ]==' =' ?4 :17 );
248248 for (;;) {
249249 std::string::size_type pos = paths.find (' ;' );
250250 if (pos == std::string::npos) {
251- _settings->_basePaths .push_back (Path::fromNativeSeparators (paths));
251+ _settings->basePaths .push_back (Path::fromNativeSeparators (paths));
252252 break ;
253253 } else {
254- _settings->_basePaths .push_back (Path::fromNativeSeparators (paths.substr (0 , pos)));
254+ _settings->basePaths .push_back (Path::fromNativeSeparators (paths.substr (0 , pos)));
255255 paths.erase (0 , pos + 1 );
256256 }
257257 }
@@ -263,26 +263,26 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
263263
264264 // Write results in results.xml
265265 else if (std::strcmp (argv[i], " --xml" ) == 0 )
266- _settings->_xml = true ;
266+ _settings->xml = true ;
267267
268268 // Define the XML file version (and enable XML output)
269269 else if (std::strncmp (argv[i], " --xml-version=" , 14 ) == 0 ) {
270270 std::string numberString (argv[i]+14 );
271271
272272 std::istringstream iss (numberString);
273- if (!(iss >> _settings->_xml_version )) {
273+ if (!(iss >> _settings->xml_version )) {
274274 PrintMessage (" cppcheck: argument to '--xml-version' is not a number." );
275275 return false ;
276276 }
277277
278- if (_settings->_xml_version < 0 || _settings->_xml_version > 2 ) {
278+ if (_settings->xml_version < 0 || _settings->xml_version > 2 ) {
279279 // We only have xml versions 1 and 2
280280 PrintMessage (" cppcheck: '--xml-version' can only be 1 or 2." );
281281 return false ;
282282 }
283283
284284 // Enable also XML if version is set
285- _settings->_xml = true ;
285+ _settings->xml = true ;
286286 }
287287
288288 // Only print something when there are errors
@@ -326,8 +326,8 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
326326 else if (std::strncmp (argv[i], " --error-exitcode=" , 17 ) == 0 ) {
327327 std::string temp = argv[i]+17 ;
328328 std::istringstream iss (temp);
329- if (!(iss >> _settings->_exitCode )) {
330- _settings->_exitCode = 0 ;
329+ if (!(iss >> _settings->exitCode )) {
330+ _settings->exitCode = 0 ;
331331 PrintMessage (" cppcheck: Argument must be an integer. Try something like '--error-exitcode=1'." );
332332 return false ;
333333 }
@@ -414,7 +414,7 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
414414 if (path.back () != ' /' )
415415 path += ' /' ;
416416
417- _settings->_includePaths .push_back (path);
417+ _settings->includePaths .push_back (path);
418418 } else if (std::strncmp (argv[i], " --include=" , 10 ) == 0 ) {
419419 std::string path = argv[i] + 10 ;
420420
@@ -423,7 +423,7 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
423423 _settings->userIncludes .push_back (path);
424424 } else if (std::strncmp (argv[i], " --includes-file=" , 16 ) == 0 ) {
425425 // open this file and read every input file (1 file name per line)
426- AddInclPathsToList (16 + argv[i], &_settings->_includePaths );
426+ AddInclPathsToList (16 + argv[i], &_settings->includePaths );
427427 } else if (std::strncmp (argv[i], " --config-exclude=" ,17 ) ==0 ) {
428428 std::string path = argv[i] + 17 ;
429429 path = Path::fromNativeSeparators (path);
@@ -503,21 +503,21 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
503503 std::strncmp (argv[i], " --template=" , 11 ) == 0 ) {
504504 // "--template path/"
505505 if (argv[i][10 ] == ' =' )
506- _settings->_outputFormat = argv[i] + 11 ;
506+ _settings->outputFormat = argv[i] + 11 ;
507507 else if ((i+1 ) < argc && argv[i+1 ][0 ] != ' -' ) {
508508 ++i;
509- _settings->_outputFormat = argv[i];
509+ _settings->outputFormat = argv[i];
510510 } else {
511511 PrintMessage (" cppcheck: argument to '--template' is missing." );
512512 return false ;
513513 }
514514
515- if (_settings->_outputFormat == " gcc" )
516- _settings->_outputFormat = " {file}:{line}: {severity}: {message}" ;
517- else if (_settings->_outputFormat == " vs" )
518- _settings->_outputFormat = " {file}({line}): {severity}: {message}" ;
519- else if (_settings->_outputFormat == " edit" )
520- _settings->_outputFormat = " {file} +{line}: {severity}: {message}" ;
515+ if (_settings->outputFormat == " gcc" )
516+ _settings->outputFormat = " {file}:{line}: {severity}: {message}" ;
517+ else if (_settings->outputFormat == " vs" )
518+ _settings->outputFormat = " {file}({line}): {severity}: {message}" ;
519+ else if (_settings->outputFormat == " edit" )
520+ _settings->outputFormat = " {file} +{line}: {severity}: {message}" ;
521521 }
522522
523523 // Checking threads
@@ -540,12 +540,12 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
540540 numberString = argv[i]+2 ;
541541
542542 std::istringstream iss (numberString);
543- if (!(iss >> _settings->_jobs )) {
543+ if (!(iss >> _settings->jobs )) {
544544 PrintMessage (" cppcheck: argument to '-j' is not a number." );
545545 return false ;
546546 }
547547
548- if (_settings->_jobs > 10000 ) {
548+ if (_settings->jobs > 10000 ) {
549549 // This limit is here just to catch typos. If someone has
550550 // need for more jobs, this value should be increased.
551551 PrintMessage (" cppcheck: argument for '-j' is allowed to be 10000 at max." );
@@ -570,7 +570,7 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
570570 numberString = argv[i]+2 ;
571571
572572 std::istringstream iss (numberString);
573- if (!(iss >> _settings->_loadAverage )) {
573+ if (!(iss >> _settings->loadAverage )) {
574574 PrintMessage (" cppcheck: argument to '-l' is not a number." );
575575 return false ;
576576 }
@@ -579,7 +579,7 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
579579 // print all possible error messages..
580580 else if (std::strcmp (argv[i], " --errorlist" ) == 0 ) {
581581 _showErrorMessages = true ;
582- _settings->_xml = true ;
582+ _settings->xml = true ;
583583 _exitAfterPrint = true ;
584584 }
585585
@@ -604,13 +604,13 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
604604 else if (std::strncmp (argv[i], " --showtime=" , 11 ) == 0 ) {
605605 const std::string showtimeMode = argv[i] + 11 ;
606606 if (showtimeMode == " file" )
607- _settings->_showtime = SHOWTIME_FILE;
607+ _settings->showtime = SHOWTIME_FILE;
608608 else if (showtimeMode == " summary" )
609- _settings->_showtime = SHOWTIME_SUMMARY;
609+ _settings->showtime = SHOWTIME_SUMMARY;
610610 else if (showtimeMode == " top5" )
611- _settings->_showtime = SHOWTIME_TOP5;
611+ _settings->showtime = SHOWTIME_TOP5;
612612 else if (showtimeMode.empty ())
613- _settings->_showtime = SHOWTIME_NONE;
613+ _settings->showtime = SHOWTIME_NONE;
614614 else {
615615 std::string message (" cppcheck: error: unrecognized showtime mode: \" " );
616616 message += showtimeMode;
@@ -694,15 +694,15 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
694694
695695 // Set maximum number of #ifdef configurations to check
696696 else if (std::strncmp (argv[i], " --max-configs=" , 14 ) == 0 ) {
697- _settings->_force = false ;
697+ _settings->force = false ;
698698
699699 std::istringstream iss (14 +argv[i]);
700- if (!(iss >> _settings->_maxConfigs )) {
700+ if (!(iss >> _settings->maxConfigs )) {
701701 PrintMessage (" cppcheck: argument to '--max-configs=' is not a number." );
702702 return false ;
703703 }
704704
705- if (_settings->_maxConfigs < 1 ) {
705+ if (_settings->maxConfigs < 1 ) {
706706 PrintMessage (" cppcheck: argument to '--max-configs=' must be greater than 0." );
707707 return false ;
708708 }
@@ -734,17 +734,17 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
734734 }
735735 }
736736
737- if (_settings->_force )
738- _settings->_maxConfigs = ~0U ;
737+ if (_settings->force )
738+ _settings->maxConfigs = ~0U ;
739739
740740 else if ((def || _settings->preprocessOnly ) && !maxconfigs)
741- _settings->_maxConfigs = 1U ;
741+ _settings->maxConfigs = 1U ;
742742
743- if (_settings->isEnabled (" unusedFunction" ) && _settings->_jobs > 1 ) {
743+ if (_settings->isEnabled (" unusedFunction" ) && _settings->jobs > 1 ) {
744744 PrintMessage (" cppcheck: unusedFunction check can't be used with '-j' option. Disabling unusedFunction check." );
745745 }
746746
747- if (_settings->inconclusive && _settings->_xml && _settings->_xml_version == 1U ) {
747+ if (_settings->inconclusive && _settings->xml && _settings->xml_version == 1U ) {
748748 PrintMessage (" cppcheck: inconclusive messages will not be shown, because the old xml format is not compatible. It's recommended to use the new xml format (use --xml-version=2)." );
749749 }
750750
@@ -765,8 +765,8 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
765765 }
766766
767767 // Use paths _pathnames if no base paths for relative path output are given
768- if (_settings->_basePaths .empty () && _settings->_relativePaths )
769- _settings->_basePaths = _pathnames;
768+ if (_settings->basePaths .empty () && _settings->relativePaths )
769+ _settings->basePaths = _pathnames;
770770
771771 return true ;
772772}
0 commit comments