@@ -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 ))
@@ -3135,7 +3135,7 @@ simplecpp::FileDataCache &simplecpp::FileDataCache::operator=(simplecpp::FileDat
31353135
31363136static bool getFileId (const std::string &path, FileID &id);
31373137
3138- 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)
3138+ 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)
31393139{
31403140 const std::string &path = name_it->first ;
31413141 FileID fileId;
@@ -3254,7 +3254,7 @@ static bool getFileId(const std::string &path, FileID &id)
32543254#endif
32553255}
32563256
3257- simplecpp::FileDataCache simplecpp::load (const simplecpp::TokenList &rawtokens, std::vector<std::string> &filenames, const simplecpp::DUI &dui, simplecpp::OutputList *outputList, FileDataCache cache)
3257+ simplecpp::FileDataCache simplecpp::load (const simplecpp::TokenList &rawtokens, std::vector<std::string> &filenames, const simplecpp::DUI &dui, simplecpp::OutputList * const outputList, FileDataCache cache)
32583258{
32593259#ifdef SIMPLECPP_WINDOWS
32603260 if (dui.clearIncludeCache )
@@ -3337,7 +3337,7 @@ simplecpp::FileDataCache simplecpp::load(const simplecpp::TokenList &rawtokens,
33373337 return cache;
33383338}
33393339
3340- static bool preprocessToken (simplecpp::TokenList &output, const simplecpp::Token *&tok1, simplecpp::MacroMap ¯os, std::vector<std::string> &files, simplecpp::OutputList *outputList)
3340+ static bool preprocessToken (simplecpp::TokenList &output, const simplecpp::Token *&tok1, simplecpp::MacroMap ¯os, std::vector<std::string> &files, simplecpp::OutputList * const outputList)
33413341{
33423342 const simplecpp::Token * const tok = tok1;
33433343 const simplecpp::MacroMap::const_iterator it = tok->name ? macros.find (tok->str ()) : macros.end ();
@@ -3377,21 +3377,21 @@ static void getLocaltime(struct tm <ime)
33773377#endif
33783378}
33793379
3380- static std::string getDateDefine (const struct tm *timep)
3380+ static std::string getDateDefine (const struct tm * const timep)
33813381{
33823382 char buf[] = " ??? ?? ????" ;
33833383 strftime (buf, sizeof (buf), " %b %d %Y" , timep);
33843384 return std::string (" \" " ).append (buf).append (" \" " );
33853385}
33863386
3387- static std::string getTimeDefine (const struct tm *timep)
3387+ static std::string getTimeDefine (const struct tm * const timep)
33883388{
33893389 char buf[] = " ??:??:??" ;
33903390 strftime (buf, sizeof (buf), " %H:%M:%S" , timep);
33913391 return std::string (" \" " ).append (buf).append (" \" " );
33923392}
33933393
3394- 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)
3394+ 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)
33953395{
33963396#ifdef SIMPLECPP_WINDOWS
33973397 if (dui.clearIncludeCache )
0 commit comments