changeset 177:6119608a9817

Finish joerg's halfassedly partial const changes. (why only do half of it?)
author David A. Holland
date Fri, 12 Jun 2015 03:03:04 -0400
parents a2f047301c15
children 0d5b9651b240
files macro.c macro.h
diffstat 2 files changed, 19 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/macro.c	Fri Jun 12 02:55:02 2015 -0400
+++ b/macro.c	Fri Jun 12 03:03:04 2015 -0400
@@ -677,7 +677,7 @@
 static struct expstate mainstate;
 
 static void doexpand(struct expstate *es, struct place *p,
-		     char *buf, size_t len);
+		     const char *buf, size_t len);
 
 static
 void
@@ -921,7 +921,8 @@
 
 static
 void
-expand_got_ws(struct expstate *es, struct place *p, const char *buf, size_t len)
+expand_got_ws(struct expstate *es, struct place *p,
+	      const char *buf, size_t len)
 {
 	switch (es->state) {
 	    case ES_NORMAL:
@@ -943,7 +944,8 @@
 
 static
 void
-expand_got_word(struct expstate *es, struct place *p, char *buf, size_t len)
+expand_got_word(struct expstate *es, struct place *p,
+		const char *buf, size_t len)
 {
 	struct macro *m;
 
@@ -992,7 +994,8 @@
 
 static
 void
-expand_got_lparen(struct expstate *es, struct place *p, char *buf, size_t len)
+expand_got_lparen(struct expstate *es, struct place *p,
+		  const char *buf, size_t len)
 {
 	switch (es->state) {
 	    case ES_NORMAL:
@@ -1015,7 +1018,8 @@
 
 static
 void
-expand_got_rparen(struct expstate *es, struct place *p, char *buf, size_t len)
+expand_got_rparen(struct expstate *es, struct place *p,
+		  const char *buf, size_t len)
 {
 	switch (es->state) {
 	    case ES_NORMAL:
@@ -1050,7 +1054,8 @@
 
 static
 void
-expand_got_comma(struct expstate *es, struct place *p, char *buf, size_t len)
+expand_got_comma(struct expstate *es, struct place *p,
+		 const char *buf, size_t len)
 {
 	switch (es->state) {
 	    case ES_NORMAL:
@@ -1078,7 +1083,8 @@
 
 static
 void
-expand_got_other(struct expstate *es, struct place *p, char *buf, size_t len)
+expand_got_other(struct expstate *es, struct place *p,
+		 const char *buf, size_t len)
 {
 	switch (es->state) {
 	    case ES_NORMAL:
@@ -1130,7 +1136,7 @@
 
 static
 void
-doexpand(struct expstate *es, struct place *p, char *buf, size_t len)
+doexpand(struct expstate *es, struct place *p, const char *buf, size_t len)
 {
 	char *s;
 	size_t x;
@@ -1219,7 +1225,7 @@
 }
 
 char *
-macroexpand(struct place *p, char *buf, size_t len, bool honordefined)
+macroexpand(struct place *p, const char *buf, size_t len, bool honordefined)
 {
 	struct expstate es;
 	char *ret;
@@ -1241,7 +1247,7 @@
 }
 
 void
-macro_sendline(struct place *p, char *buf, size_t len)
+macro_sendline(struct place *p, const char *buf, size_t len)
 {
 	doexpand(&mainstate, p, buf, len);
 	switch (mainstate.state) {
--- a/macro.h	Fri Jun 12 02:55:02 2015 -0400
+++ b/macro.h	Fri Jun 12 03:03:04 2015 -0400
@@ -44,7 +44,8 @@
 void macro_undef(const char *macro);
 bool macro_isdefined(const char *macro);
 
-char *macroexpand(struct place *, char *buf, size_t len, bool honordefined);
+char *macroexpand(struct place *, const char *buf, size_t len,
+		  bool honordefined);
 
-void macro_sendline(struct place *, char *buf, size_t len);
+void macro_sendline(struct place *, const char *buf, size_t len);
 void macro_sendeof(struct place *);