diff --git a/compiler/infra/InterferenceGraph.cpp b/compiler/infra/InterferenceGraph.cpp index 17538f0726b..c6e2b5f8d64 100644 --- a/compiler/infra/InterferenceGraph.cpp +++ b/compiler/infra/InterferenceGraph.cpp @@ -503,7 +503,7 @@ bool TR_InterferenceGraph::select() #ifdef DEBUG -void TR_InterferenceGraph::dumpIG(char *msg) +void TR_InterferenceGraph::dumpIG(const char *msg) { if (msg) { diff --git a/compiler/infra/InterferenceGraph.hpp b/compiler/infra/InterferenceGraph.hpp index 59d7adc84a7..251be599b84 100644 --- a/compiler/infra/InterferenceGraph.hpp +++ b/compiler/infra/InterferenceGraph.hpp @@ -144,9 +144,9 @@ class TR_InterferenceGraph : public TR_IGBase IGNodeColour findMinimumChromaticNumber(); #ifdef DEBUG - void dumpIG(char *msg = NULL); + void dumpIG(const char *msg = NULL); #else - void dumpIG(char *msg = NULL) {} + void dumpIG(const char *msg = NULL) {} #endif }; #endif diff --git a/compiler/infra/SimpleRegex.cpp b/compiler/infra/SimpleRegex.cpp index 584af0eceb3..bee17f68670 100644 --- a/compiler/infra/SimpleRegex.cpp +++ b/compiler/infra/SimpleRegex.cpp @@ -55,11 +55,11 @@ namespace TR { -SimpleRegex *SimpleRegex::create(char *&s) +SimpleRegex *SimpleRegex::create(const char *& s) { if (s == NULL || s[0] != '{') return NULL; - char *origStr = s; + const char *origStr = s; ++s; bool negate = (s[0] == '^'); if (negate) @@ -78,7 +78,7 @@ SimpleRegex *SimpleRegex::create(char *&s) } -SimpleRegex::Regex *SimpleRegex::processRegex(char *&s, bool &foundError) +SimpleRegex::Regex *SimpleRegex::processRegex(const char *&s, bool &foundError) { // First get rid of all + and | // @@ -108,10 +108,10 @@ void *SimpleRegex::Component::operator new (size_t size, PERSISTENT_NEW_DECLARE, // Process a simple_pattern: a sequence of components // -SimpleRegex::Simple *SimpleRegex::processSimple(char *&s, TR_YesNoMaybe allowAlternates, bool &foundError) +SimpleRegex::Simple *SimpleRegex::processSimple(const char *&s, TR_YesNoMaybe allowAlternates, bool &foundError) { int32_t i,lo,hi; - char *startSimple = s; + const char *startSimple = s; if (s[0] == '\0' || s[0] == ',' || s[0] == '|' || s[0] == '}') return NULL; diff --git a/compiler/infra/SimpleRegex.hpp b/compiler/infra/SimpleRegex.hpp index d2efa87cb45..114fb59b3b0 100644 --- a/compiler/infra/SimpleRegex.hpp +++ b/compiler/infra/SimpleRegex.hpp @@ -50,7 +50,7 @@ class SimpleRegex // Create a new regular expression // - static SimpleRegex *create(char *&s); + static SimpleRegex *create(const char *& s); // Check whether a string matches this regular expression // @@ -139,15 +139,15 @@ class SimpleRegex private: - static Regex *processRegex(char *&s, bool &foundError); - static Simple *processSimple(char *&s, TR_YesNoMaybe allowAlternates, bool &foundError); + static Regex *processRegex(const char *&s, bool &foundError); + static Simple *processSimple(const char *&s, TR_YesNoMaybe allowAlternates, bool &foundError); Regex *_regex; bool _negate; // Length and pointer to the original string that the regex was parsed from size_t _regexStrLen; - char *_regexStr; + const char *_regexStr; }; } diff --git a/compiler/infra/Statistics.hpp b/compiler/infra/Statistics.hpp index 78c3efd3fac..fb031a52554 100644 --- a/compiler/infra/Statistics.hpp +++ b/compiler/infra/Statistics.hpp @@ -272,13 +272,13 @@ class TR_StatsEvents public: enum {NAME_LEN=31}; TR_StatsEvents() {} - TR_StatsEvents(const char *name, char **binNames, int minEventId) + TR_StatsEvents(const char *name, const char **binNames, int minEventId) { init(name, binNames, minEventId); } // the init method can be used if we want to declare an array of stats // that are initialized later (in a for loop) - void init(const char *name, char **binNames, int minEventId) + void init(const char *name, const char **binNames, int minEventId) { strncpy(_name, name, NAME_LEN); _name[NAME_LEN] = 0; // just in case name is longer than _name @@ -341,12 +341,12 @@ class TR_StatsEvents } unsigned samples() const {return _numSamples;} protected: - char _name[NAME_LEN+1]; - int _bins[N]; - char** _binNames; - int _minEventId; // value of smallest bin - int _numSamples; - int _numInvalidSamples; + char _name[NAME_LEN+1]; + int _bins[N]; + const char **_binNames; + int _minEventId; // value of smallest bin + int _numSamples; + int _numInvalidSamples; }; #endif