@@ -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}
@@ -2296,7 +2296,7 @@ namespace simplecpp {
22962296 * @return token after B
22972297 */
22982298 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 {
2299- Token *A = output.back ();
2299+ Token * const A = output.back ();
23002300 if (!A)
23012301 throw invalidHashHash (tok->location , name (), " Missing first argument" );
23022302 if (!sameline (tok, tok->next ) || !sameline (tok, tok->next ->next ))
@@ -3136,7 +3136,7 @@ simplecpp::FileDataCache &simplecpp::FileDataCache::operator=(simplecpp::FileDat
31363136
31373137static bool getFileId (const std::string &path, FileID &id);
31383138
3139- 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)
3139+ 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)
31403140{
31413141 const std::string &path = name_it->first ;
31423142 FileID fileId;
@@ -3258,7 +3258,7 @@ static bool getFileId(const std::string &path, FileID &id)
32583258#endif
32593259}
32603260
3261- simplecpp::FileDataCache simplecpp::load (const simplecpp::TokenList &rawtokens, std::vector<std::string> &filenames, const simplecpp::DUI &dui, simplecpp::OutputList *outputList, FileDataCache cache)
3261+ simplecpp::FileDataCache simplecpp::load (const simplecpp::TokenList &rawtokens, std::vector<std::string> &filenames, const simplecpp::DUI &dui, simplecpp::OutputList * const outputList, FileDataCache cache)
32623262{
32633263#ifdef SIMPLECPP_WINDOWS
32643264 if (dui.clearIncludeCache )
@@ -3341,7 +3341,7 @@ simplecpp::FileDataCache simplecpp::load(const simplecpp::TokenList &rawtokens,
33413341 return cache;
33423342}
33433343
3344- static bool preprocessToken (simplecpp::TokenList &output, const simplecpp::Token *&tok1, simplecpp::MacroMap ¯os, std::vector<std::string> &files, simplecpp::OutputList *outputList)
3344+ static bool preprocessToken (simplecpp::TokenList &output, const simplecpp::Token *&tok1, simplecpp::MacroMap ¯os, std::vector<std::string> &files, simplecpp::OutputList * const outputList)
33453345{
33463346 const simplecpp::Token * const tok = tok1;
33473347 const simplecpp::MacroMap::const_iterator it = tok->name ? macros.find (tok->str ()) : macros.end ();
@@ -3391,21 +3391,21 @@ static void getLocaltime(struct tm <ime)
33913391#endif
33923392}
33933393
3394- static std::string getDateDefine (const struct tm *timep)
3394+ static std::string getDateDefine (const struct tm * const timep)
33953395{
33963396 char buf[] = " ??? ?? ????" ;
33973397 strftime (buf, sizeof (buf), " %b %d %Y" , timep);
33983398 return std::string (" \" " ).append (buf).append (" \" " );
33993399}
34003400
3401- static std::string getTimeDefine (const struct tm *timep)
3401+ static std::string getTimeDefine (const struct tm * const timep)
34023402{
34033403 char buf[] = " ??:??:??" ;
34043404 strftime (buf, sizeof (buf), " %H:%M:%S" , timep);
34053405 return std::string (" \" " ).append (buf).append (" \" " );
34063406}
34073407
3408- 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)
3408+ 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)
34093409{
34103410#ifdef SIMPLECPP_WINDOWS
34113411 if (dui.clearIncludeCache )
0 commit comments