@@ -512,14 +512,14 @@ static std::string readcondition(const simplecpp::Token *iftok, const std::set<s
512512 return cfgStr;
513513}
514514
515- static bool hasDefine (const std::string &userDefines, const std::string &cfg )
515+ static bool hasDefine (const std::string &userDefines, const std::string &cfgStr )
516516{
517- if (cfg .empty ()) {
517+ if (cfgStr .empty ()) {
518518 return false ;
519519 }
520520
521521 std::string::size_type pos = 0 ;
522- const std::string cfgname = cfg .substr (0 , cfg .find (' =' ));
522+ const std::string cfgname = cfgStr .substr (0 , cfgStr .find (' =' ));
523523 while (pos < userDefines.size ()) {
524524 pos = userDefines.find (cfgname, pos);
525525 if (pos == std::string::npos)
@@ -550,11 +550,11 @@ static std::string cfg(const std::vector<std::string> &configs, const std::strin
550550 return ret;
551551}
552552
553- static bool isUndefined (const std::string &cfg , const std::set<std::string> &undefined)
553+ static bool isUndefined (const std::string &cfgStr , const std::set<std::string> &undefined)
554554{
555- for (std::string::size_type pos1 = 0U ; pos1 < cfg .size ();) {
556- const std::string::size_type pos2 = cfg .find (' ;' ,pos1);
557- const std::string def = (pos2 == std::string::npos) ? cfg .substr (pos1) : cfg .substr (pos1, pos2 - pos1);
555+ for (std::string::size_type pos1 = 0U ; pos1 < cfgStr .size ();) {
556+ const std::string::size_type pos2 = cfgStr .find (' ;' ,pos1);
557+ const std::string def = (pos2 == std::string::npos) ? cfgStr .substr (pos1) : cfgStr .substr (pos1, pos2 - pos1);
558558
559559 const std::string::size_type eq = def.find (' =' );
560560 if (eq == std::string::npos && undefined.find (def) != undefined.end ())
@@ -797,11 +797,11 @@ std::set<std::string> Preprocessor::getConfigs() const
797797 return ret;
798798}
799799
800- static void splitcfg (const std::string &cfg , std::list<std::string> &defines, const std::string &defaultValue)
800+ static void splitcfg (const std::string &cfgStr , std::list<std::string> &defines, const std::string &defaultValue)
801801{
802- for (std::string::size_type defineStartPos = 0U ; defineStartPos < cfg .size ();) {
803- const std::string::size_type defineEndPos = cfg .find (' ;' , defineStartPos);
804- std::string def = (defineEndPos == std::string::npos) ? cfg .substr (defineStartPos) : cfg .substr (defineStartPos, defineEndPos - defineStartPos);
802+ for (std::string::size_type defineStartPos = 0U ; defineStartPos < cfgStr .size ();) {
803+ const std::string::size_type defineEndPos = cfgStr .find (' ;' , defineStartPos);
804+ std::string def = (defineEndPos == std::string::npos) ? cfgStr .substr (defineStartPos) : cfgStr .substr (defineStartPos, defineEndPos - defineStartPos);
805805 if (!defaultValue.empty () && def.find (' =' ) == std::string::npos)
806806 def += ' =' + defaultValue;
807807 defines.push_back (std::move (def));
@@ -811,14 +811,14 @@ static void splitcfg(const std::string &cfg, std::list<std::string> &defines, co
811811 }
812812}
813813
814- static simplecpp::DUI createDUI (const Settings &mSettings , const std::string &cfg , Standards::Language lang)
814+ static simplecpp::DUI createDUI (const Settings &mSettings , const std::string &cfgStr , Standards::Language lang)
815815{
816816 // TODO: make it possible to specify platform-dependent sizes
817817 simplecpp::DUI dui;
818818
819819 splitcfg (mSettings .userDefines , dui.defines , " 1" );
820- if (!cfg .empty ())
821- splitcfg (cfg , dui.defines , " " );
820+ if (!cfgStr .empty ())
821+ splitcfg (cfgStr , dui.defines , " " );
822822
823823 for (const std::string &def : mSettings .library .defines ()) {
824824 const std::string::size_type pos = def.find_first_of (" (" );
@@ -899,9 +899,9 @@ void Preprocessor::setPlatformInfo()
899899 mTokens .sizeOfType [" long double *" ] = mSettings .platform .sizeof_pointer ;
900900}
901901
902- simplecpp::TokenList Preprocessor::preprocess (const std::string &cfg , std::vector<std::string> &files, simplecpp::OutputList& outputList)
902+ simplecpp::TokenList Preprocessor::preprocess (const std::string &cfgStr , std::vector<std::string> &files, simplecpp::OutputList& outputList)
903903{
904- const simplecpp::DUI dui = createDUI (mSettings , cfg , mLang );
904+ const simplecpp::DUI dui = createDUI (mSettings , cfgStr , mLang );
905905
906906 std::list<simplecpp::MacroUsage> macroUsage;
907907 std::list<simplecpp::IfCond> ifCond;
@@ -915,10 +915,10 @@ simplecpp::TokenList Preprocessor::preprocess(const std::string &cfg, std::vecto
915915 return tokens2;
916916}
917917
918- std::string Preprocessor::getcode (const std::string &cfg , std::vector<std::string> &files, const bool writeLocations)
918+ std::string Preprocessor::getcode (const std::string &cfgStr , std::vector<std::string> &files, const bool writeLocations)
919919{
920920 simplecpp::OutputList outputList;
921- simplecpp::TokenList tokens2 = preprocess (cfg , files, outputList);
921+ simplecpp::TokenList tokens2 = preprocess (cfgStr , files, outputList);
922922 handleErrors (outputList);
923923 unsigned int prevfile = 0 ;
924924 unsigned int line = 1 ;
0 commit comments