@@ -150,12 +150,12 @@ static bool endsWith(const std::string &s, const std::string &e)
150150 return (s.size () >= e.size ()) && std::equal (e.rbegin (), e.rend (), s.rbegin ());
151151}
152152
153- static bool sameline (const simplecpp::Token *tok1, const simplecpp::Token *tok2)
153+ static bool sameline (const simplecpp::Token * const tok1, const simplecpp::Token * const tok2)
154154{
155155 return tok1 && tok2 && tok1->location .sameline (tok2->location );
156156}
157157
158- static bool isAlternativeBinaryOp (const simplecpp::Token *tok, const std::string &alt)
158+ static bool isAlternativeBinaryOp (const simplecpp::Token * const tok, const std::string &alt)
159159{
160160 return (tok->name &&
161161 tok->str () == alt &&
@@ -165,7 +165,7 @@ static bool isAlternativeBinaryOp(const simplecpp::Token *tok, const std::string
165165 (tok->next ->number || tok->next ->name || tok->next ->op == ' (' ));
166166}
167167
168- static bool isAlternativeUnaryOp (const simplecpp::Token *tok, const std::string &alt)
168+ static bool isAlternativeUnaryOp (const simplecpp::Token * const tok, const std::string &alt)
169169{
170170 return ((tok->name && tok->str () == alt) &&
171171 (!tok->previous || tok->previous ->op == ' (' ) &&
@@ -619,7 +619,7 @@ static std::string escapeString(const std::string &str)
619619 return ostr.str ();
620620}
621621
622- static void portabilityBackslash (simplecpp::OutputList *outputList, const simplecpp::Location &location)
622+ static void portabilityBackslash (simplecpp::OutputList * const outputList, const simplecpp::Location &location)
623623{
624624 if (!outputList)
625625 return ;
@@ -1013,7 +1013,7 @@ void simplecpp::TokenList::constFold()
10131013 }
10141014}
10151015
1016- static bool isFloatSuffix (const simplecpp::Token *tok)
1016+ static bool isFloatSuffix (const simplecpp::Token * const tok)
10171017{
10181018 if (!tok || tok->str ().size () != 1U )
10191019 return false ;
@@ -1024,7 +1024,7 @@ static bool isFloatSuffix(const simplecpp::Token *tok)
10241024static const std::string AND (" and" );
10251025static const std::string BITAND (" bitand" );
10261026static const std::string BITOR (" bitor" );
1027- static bool isAlternativeAndBitandBitor (const simplecpp::Token* tok)
1027+ static bool isAlternativeAndBitandBitor (const simplecpp::Token * const tok)
10281028{
10291029 return isAlternativeBinaryOp (tok, AND ) || isAlternativeBinaryOp (tok, BITAND ) || isAlternativeBinaryOp (tok, BITOR );
10301030}
@@ -2306,7 +2306,7 @@ namespace simplecpp {
23062306 * @return token after B
23072307 */
23082308 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 {
2309- Token *A = output.back ();
2309+ Token * const A = output.back ();
23102310 if (!A)
23112311 throw invalidHashHash (tok->location , name (), " Missing first argument" );
23122312 if (!sameline (tok, tok->next ) || !sameline (tok, tok->next ->next ))
@@ -3090,7 +3090,7 @@ static std::string openHeader(std::ifstream &f, const simplecpp::DUI &dui, const
30903090 return " " ;
30913091}
30923092
3093- 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)
3093+ 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)
30943094{
30953095 const std::string &path = name_it->first ;
30963096 FileID fileId;
@@ -3202,7 +3202,7 @@ bool simplecpp::FileDataCache::getFileId(const std::string &path, FileID &id)
32023202#endif
32033203}
32043204
3205- simplecpp::FileDataCache simplecpp::load (const simplecpp::TokenList &rawtokens, std::vector<std::string> &filenames, const simplecpp::DUI &dui, simplecpp::OutputList *outputList, FileDataCache cache)
3205+ simplecpp::FileDataCache simplecpp::load (const simplecpp::TokenList &rawtokens, std::vector<std::string> &filenames, const simplecpp::DUI &dui, simplecpp::OutputList * const outputList, FileDataCache cache)
32063206{
32073207#ifdef SIMPLECPP_WINDOWS
32083208 if (dui.clearIncludeCache )
@@ -3285,7 +3285,7 @@ simplecpp::FileDataCache simplecpp::load(const simplecpp::TokenList &rawtokens,
32853285 return cache;
32863286}
32873287
3288- static bool preprocessToken (simplecpp::TokenList &output, const simplecpp::Token *&tok1, simplecpp::MacroMap ¯os, std::vector<std::string> &files, simplecpp::OutputList *outputList)
3288+ static bool preprocessToken (simplecpp::TokenList &output, const simplecpp::Token *&tok1, simplecpp::MacroMap ¯os, std::vector<std::string> &files, simplecpp::OutputList * const outputList)
32893289{
32903290 const simplecpp::Token * const tok = tok1;
32913291 const simplecpp::MacroMap::const_iterator it = tok->name ? macros.find (tok->str ()) : macros.end ();
@@ -3325,21 +3325,21 @@ static void getLocaltime(struct tm <ime)
33253325#endif
33263326}
33273327
3328- static std::string getDateDefine (const struct tm *timep)
3328+ static std::string getDateDefine (const struct tm * const timep)
33293329{
33303330 char buf[] = " ??? ?? ????" ;
33313331 strftime (buf, sizeof (buf), " %b %d %Y" , timep);
33323332 return std::string (" \" " ).append (buf).append (" \" " );
33333333}
33343334
3335- static std::string getTimeDefine (const struct tm *timep)
3335+ static std::string getTimeDefine (const struct tm * const timep)
33363336{
33373337 char buf[] = " ??:??:??" ;
33383338 strftime (buf, sizeof (buf), " %H:%M:%S" , timep);
33393339 return std::string (" \" " ).append (buf).append (" \" " );
33403340}
33413341
3342- 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)
3342+ 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)
33433343{
33443344#ifdef SIMPLECPP_WINDOWS
33453345 if (dui.clearIncludeCache )
0 commit comments