@@ -153,12 +153,12 @@ static bool endsWith(const std::string &s, const std::string &e)
153153 return (s.size () >= e.size ()) && std::equal (e.rbegin (), e.rend (), s.rbegin ());
154154}
155155
156- static bool sameline (const simplecpp::Token *tok1, const simplecpp::Token *tok2)
156+ static bool sameline (const simplecpp::Token * const tok1, const simplecpp::Token * const tok2)
157157{
158158 return tok1 && tok2 && tok1->location .sameline (tok2->location );
159159}
160160
161- static bool isAlternativeBinaryOp (const simplecpp::Token *tok, const std::string &alt)
161+ static bool isAlternativeBinaryOp (const simplecpp::Token * const tok, const std::string &alt)
162162{
163163 return (tok->name &&
164164 tok->str () == alt &&
@@ -168,7 +168,7 @@ static bool isAlternativeBinaryOp(const simplecpp::Token *tok, const std::string
168168 (tok->next ->number || tok->next ->name || tok->next ->op == ' (' ));
169169}
170170
171- static bool isAlternativeUnaryOp (const simplecpp::Token *tok, const std::string &alt)
171+ static bool isAlternativeUnaryOp (const simplecpp::Token * const tok, const std::string &alt)
172172{
173173 return ((tok->name && tok->str () == alt) &&
174174 (!tok->previous || tok->previous ->op == ' (' ) &&
@@ -622,7 +622,7 @@ static std::string escapeString(const std::string &str)
622622 return ostr.str ();
623623}
624624
625- static void portabilityBackslash (simplecpp::OutputList *outputList, const simplecpp::Location &location)
625+ static void portabilityBackslash (simplecpp::OutputList * const outputList, const simplecpp::Location &location)
626626{
627627 if (!outputList)
628628 return ;
@@ -999,7 +999,7 @@ void simplecpp::TokenList::constFold()
999999 }
10001000}
10011001
1002- static bool isFloatSuffix (const simplecpp::Token *tok)
1002+ static bool isFloatSuffix (const simplecpp::Token * const tok)
10031003{
10041004 if (!tok || tok->str ().size () != 1U )
10051005 return false ;
@@ -1010,7 +1010,7 @@ static bool isFloatSuffix(const simplecpp::Token *tok)
10101010static const std::string AND (" and" );
10111011static const std::string BITAND (" bitand" );
10121012static const std::string BITOR (" bitor" );
1013- static bool isAlternativeAndBitandBitor (const simplecpp::Token* tok)
1013+ static bool isAlternativeAndBitandBitor (const simplecpp::Token * const tok)
10141014{
10151015 return isAlternativeBinaryOp (tok, AND ) || isAlternativeBinaryOp (tok, BITAND ) || isAlternativeBinaryOp (tok, BITOR );
10161016}
@@ -2292,7 +2292,7 @@ namespace simplecpp {
22922292 * @return token after B
22932293 */
22942294 const Token *expandHashHash (TokenList &output, const Location &loc, const Token *tok, const MacroMap ¯os, const std::set<TokenString> &expandedmacros, const std::vector<const Token*> ¶metertokens, bool expandResult=true ) const {
2295- Token *A = output.back ();
2295+ Token * const A = output.back ();
22962296 if (!A)
22972297 throw invalidHashHash (tok->location , name (), " Missing first argument" );
22982298 if (!sameline (tok, tok->next ) || !sameline (tok, tok->next ->next ))
@@ -3132,7 +3132,7 @@ simplecpp::FileDataCache &simplecpp::FileDataCache::operator=(simplecpp::FileDat
31323132
31333133static bool getFileId (const std::string &path, FileID &id);
31343134
3135- std::pair<simplecpp::FileData *, bool > simplecpp::FileDataCache::tryload (FileDataCache::name_map_type::iterator &name_it, const simplecpp::DUI &dui, std::vector<std::string> &filenames, simplecpp::OutputList *outputList)
3135+ std::pair<simplecpp::FileData *, bool > simplecpp::FileDataCache::tryload (FileDataCache::name_map_type::iterator &name_it, const simplecpp::DUI &dui, std::vector<std::string> &filenames, simplecpp::OutputList * const outputList)
31363136{
31373137 const std::string &path = name_it->first ;
31383138 FileID fileId;
@@ -3251,7 +3251,7 @@ static bool getFileId(const std::string &path, FileID &id)
32513251#endif
32523252}
32533253
3254- simplecpp::FileDataCache simplecpp::load (const simplecpp::TokenList &rawtokens, std::vector<std::string> &filenames, const simplecpp::DUI &dui, simplecpp::OutputList *outputList, FileDataCache cache)
3254+ simplecpp::FileDataCache simplecpp::load (const simplecpp::TokenList &rawtokens, std::vector<std::string> &filenames, const simplecpp::DUI &dui, simplecpp::OutputList * const outputList, FileDataCache cache)
32553255{
32563256#ifdef SIMPLECPP_WINDOWS
32573257 if (dui.clearIncludeCache )
@@ -3334,7 +3334,7 @@ simplecpp::FileDataCache simplecpp::load(const simplecpp::TokenList &rawtokens,
33343334 return cache;
33353335}
33363336
3337- static bool preprocessToken (simplecpp::TokenList &output, const simplecpp::Token *&tok1, simplecpp::MacroMap ¯os, std::vector<std::string> &files, simplecpp::OutputList *outputList)
3337+ static bool preprocessToken (simplecpp::TokenList &output, const simplecpp::Token *&tok1, simplecpp::MacroMap ¯os, std::vector<std::string> &files, simplecpp::OutputList * const outputList)
33383338{
33393339 const simplecpp::Token * const tok = tok1;
33403340 const simplecpp::MacroMap::const_iterator it = tok->name ? macros.find (tok->str ()) : macros.end ();
@@ -3374,21 +3374,21 @@ static void getLocaltime(struct tm <ime)
33743374#endif
33753375}
33763376
3377- static std::string getDateDefine (const struct tm *timep)
3377+ static std::string getDateDefine (const struct tm * const timep)
33783378{
33793379 char buf[] = " ??? ?? ????" ;
33803380 strftime (buf, sizeof (buf), " %b %d %Y" , timep);
33813381 return std::string (" \" " ).append (buf).append (" \" " );
33823382}
33833383
3384- static std::string getTimeDefine (const struct tm *timep)
3384+ static std::string getTimeDefine (const struct tm * const timep)
33853385{
33863386 char buf[] = " ??:??:??" ;
33873387 strftime (buf, sizeof (buf), " %H:%M:%S" , timep);
33883388 return std::string (" \" " ).append (buf).append (" \" " );
33893389}
33903390
3391- void simplecpp::preprocess (simplecpp::TokenList &output, const simplecpp::TokenList &rawtokens, std::vector<std::string> &files, simplecpp::FileDataCache &cache, const simplecpp::DUI &dui, simplecpp::OutputList *outputList, std::list<simplecpp::MacroUsage> *macroUsage, std::list<simplecpp::IfCond> *ifCond)
3391+ void simplecpp::preprocess (simplecpp::TokenList &output, const simplecpp::TokenList &rawtokens, std::vector<std::string> &files, simplecpp::FileDataCache &cache, const simplecpp::DUI &dui, simplecpp::OutputList * const outputList, std::list<simplecpp::MacroUsage> * const macroUsage, std::list<simplecpp::IfCond> * const ifCond)
33923392{
33933393#ifdef SIMPLECPP_WINDOWS
33943394 if (dui.clearIncludeCache )
0 commit comments