Browse code

Use "const char *" instead of "char *" where appropriate.

Maxim Sobolev authored on 20/12/2004 18:50:27
Showing 1 changed files
... ...
@@ -41,44 +41,44 @@ char* eat_line(char* buffer, unsigned int len);
41 41
 
42 42
 /* turn the most frequently called functions into inline functions */
43 43
 
44
-inline static char* eat_space_end(char* p, char* pend)
44
+inline static char* eat_space_end(const char* p, const char* pend)
45 45
 {
46 46
 	for(;(p<pend)&&(*p==' ' || *p=='\t') ;p++);
47
-	return p;
47
+	return (char *)p;
48 48
 }
49 49
 #define SP(_c) ((_c)=='\t' || (_c)==' ')
50
-inline static char* eat_lws_end(char* p, char* pend)
50
+inline static char* eat_lws_end(const char* p, const char* pend)
51 51
 {
52 52
 	while(p<pend) {
53 53
 		if (SP(*p)) p++;
54 54
 		/* BTW--I really dislike line folding; -jiri */
55 55
 		else if (*p=='\n' && p+1<pend && SP(*(p+1))) p+=2;
56
-		else if (*p=='\r' && p+2<pend && *(p+1)=='\n' 
56
+		else if (*p=='\r' && p+2<pend && *(p+1)=='\n'
57 57
 					&& SP(*(p+2))) p+=3;
58 58
 		else break; /* no whitespace encountered */
59 59
 	}
60
-	return p;
60
+	return (char *)p;
61 61
 }
62 62
 
63 63
 
64 64
 
65
-inline static char* eat_token_end(char* p, char* pend)
65
+inline static char* eat_token_end(const char* p, const char* pend)
66 66
 {
67 67
 	for (;(p<pend)&&(*p!=' ')&&(*p!='\t')&&(*p!='\n')&&(*p!='\r'); p++);
68
-	return p;
68
+	return (char *)p;
69 69
 }
70 70
 
71 71
 
72 72
 
73
-inline static char* eat_token2_end(char* p, char* pend, char delim)
73
+inline static char* eat_token2_end(const char* p, const char* pend, char delim)
74 74
 {
75 75
 	for (;(p<pend)&&(*p!=(delim))&&(*p!='\n')&&(*p!='\r'); p++);
76
-	return p;
76
+	return (char *)p;
77 77
 }
78 78
 
79 79
 
80 80
 
81
-inline static int is_empty_end(char* p, char* pend )
81
+inline static int is_empty_end(const char* p, const char* pend )
82 82
 {
83 83
 	p=eat_space_end(p, pend );
84 84
 	return ((p<(pend )) && (*p=='\r' || *p=='\n'));