diff src/tokenizer.h @ 48:ba0259c9e411 stable-1-0-11

Fixes to compile on Fedora 9 and for const correctness
author Carl Byington <carl@five-ten-sg.com>
date Thu, 29 May 2008 11:38:42 -0700
parents 6a2f26976898
children
line wrap: on
line diff
--- a/src/tokenizer.h	Sat Mar 22 11:34:56 2008 -0700
+++ b/src/tokenizer.h	Thu May 29 11:38:42 2008 -0700
@@ -10,14 +10,14 @@
 using namespace std;
 
 struct ltstr {
-	bool operator()(char* s1, char* s2) const {
+    bool operator()(const char* s1, const char* s2) const {
 		return strcmp(s1, s2) < 0;
 	}
 };
 
 typedef list<ifstream *>	stream_list;
-typedef list<char *>		string_list;
-typedef set<char *, ltstr>	string_set;
+typedef list<const char *>          string_list;
+typedef set<const char *, ltstr>    string_set;
 typedef list<int>			line_list;
 
 class TOKEN {
@@ -35,13 +35,13 @@
 	void push_char(u_char c);
 
 public:
-	TOKEN(char *fn, string_set *includes);
+    TOKEN(const char *fn, string_set *includes);
 	~TOKEN();
-	bool		include(char *fn);
-	char		*next();			// return next token
+    bool        include(const char *fn);
+    const char  *next();            // return next token
 	int 		nextint();
 	void		skipeol();			// skip to eol
-	void		push(char *token)			{pending_tokens.push_front(token);};
+    void        push(const char *token) {pending_tokens.push_front(token);};
 	const char	*cur_fn()					{return filenames.empty()	? "" : filenames.front();};
 	int 		cur_line()					{return linenumbers.empty() ? 0  : linenumbers.front();};
 	void		token_error(const char *err);