@@ -164,7 +164,7 @@ std::string Preprocessor::read(std::istream &istr, const std::string &filename)
164164 // ------------------------------------------------------------------------------------------
165165 //
166166 // Remove all comments..
167- result = removeComments (result, filename, _settings );
167+ result = removeComments (result, filename);
168168
169169 // ------------------------------------------------------------------------------------------
170170 //
@@ -301,7 +301,7 @@ static bool isFallThroughComment(std::string comment)
301301 comment == " fall" ;
302302}
303303
304- std::string Preprocessor::removeComments (const std::string &str, const std::string &filename, Settings *settings )
304+ std::string Preprocessor::removeComments (const std::string &str, const std::string &filename)
305305{
306306 // For the error report
307307 unsigned int lineno = 1 ;
@@ -371,7 +371,7 @@ std::string Preprocessor::removeComments(const std::string &str, const std::stri
371371 break ;
372372 std::string comment (str, commentStart, i - commentStart);
373373
374- if (settings && settings ->_inlineSuppressions ) {
374+ if (_settings && _settings ->_inlineSuppressions ) {
375375 std::istringstream iss (comment);
376376 std::string word;
377377 iss >> word;
@@ -408,7 +408,7 @@ std::string Preprocessor::removeComments(const std::string &str, const std::stri
408408 fallThroughComment = true ;
409409 }
410410
411- if (settings && settings ->_inlineSuppressions ) {
411+ if (_settings && _settings ->_inlineSuppressions ) {
412412 std::istringstream iss (comment);
413413 std::string word;
414414 iss >> word;
@@ -425,10 +425,10 @@ std::string Preprocessor::removeComments(const std::string &str, const std::stri
425425
426426 // Add any pending inline suppressions that have accumulated.
427427 if (!suppressionIDs.empty ()) {
428- if (settings != NULL ) {
428+ if (_settings != NULL ) {
429429 // Add the suppressions.
430430 for (size_t j (0 ); j < suppressionIDs.size (); ++j) {
431- const std::string errmsg (settings ->nomsg .addSuppression (suppressionIDs[j], filename, lineno));
431+ const std::string errmsg (_settings ->nomsg .addSuppression (suppressionIDs[j], filename, lineno));
432432 if (!errmsg.empty ()) {
433433 writeError (filename, lineno, _errorLogger, " cppcheckError" , errmsg);
434434 }
@@ -453,10 +453,10 @@ std::string Preprocessor::removeComments(const std::string &str, const std::stri
453453
454454 // Add any pending inline suppressions that have accumulated.
455455 if (!suppressionIDs.empty ()) {
456- if (settings != NULL ) {
456+ if (_settings != NULL ) {
457457 // Add the suppressions.
458458 for (size_t j (0 ); j < suppressionIDs.size (); ++j) {
459- const std::string errmsg (settings ->nomsg .addSuppression (suppressionIDs[j], filename, lineno));
459+ const std::string errmsg (_settings ->nomsg .addSuppression (suppressionIDs[j], filename, lineno));
460460 if (!errmsg.empty ()) {
461461 writeError (filename, lineno, _errorLogger, " cppcheckError" , errmsg);
462462 }
0 commit comments