From 5cb7376f39ca1ea5f066cb6dbffc3652b29836fc Mon Sep 17 00:00:00 2001 From: Arvid Norlander Date: Tue, 18 Nov 2008 12:45:47 -0500 Subject: [PATCH] Add some const to the *.y and *.l files. --- src/lexer.l | 6 +++--- src/oil.y | 4 ++-- src/parser.y | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lexer.l b/src/lexer.l index 9bd5538..0ee48a8 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -81,7 +81,7 @@ static char *lineptr = linebuf; ick_bool re_send_token = ick_FALSE; int lexer(void); -static int myatoi(char *text); +static int myatoi(const char *text); #define SETLINENO \ {if (stbeginline == 0) stbeginline = iyylineno;\ @@ -469,7 +469,7 @@ int lexer(void) return(tok); } -static int myatoi(char *text) /* AIS */ +static int myatoi(const char *text) /* AIS */ { #define MAXTEXT 100 static char buf[MAXTEXT]; @@ -492,7 +492,7 @@ static int myatoi(char *text) /* AIS */ return atoi(thinbuf); } -void yyerror(char *errtype) +void yyerror(const char *errtype) { #ifdef MAIN (void) printf("lextest: lexer error: %s.\n", errtype); diff --git a/src/oil.y b/src/oil.y index 5bb065e..e01f290 100644 --- a/src/oil.y +++ b/src/oil.y @@ -69,12 +69,12 @@ struct ickstype sequence of lvals (=0) or rvals (=1) this is from the root; depth bits from the end are relevant, and the bit nearest the root is least significant */ - char* condition; /* Points to a constant string; the condition to generate + const char* condition; /* Points to a constant string; the condition to generate on that node. Could also point to something the lexer mallocs, but then the lexer has to keep track of being able to free it again. If this is NULL, it means that there isn't a condition other than maybe mustbemesh */ - char* nodetypename; /* The name of the type of node this condition matches, + const char* nodetypename; /* The name of the type of node this condition matches, or NULL for a LEXERLEAF */ mybool usec; /* Whether to append the value of c to the condition */ mybool mustbemesh; /* Must this node be a mesh or mesh32? */ diff --git a/src/parser.y b/src/parser.y index 901b2bc..eb2125d 100644 --- a/src/parser.y +++ b/src/parser.y @@ -36,7 +36,7 @@ LICENSE TERMS #include "feh.h" #include "ick_lose.h" -extern int yyerror(char*); +extern int yyerror(const char*); /* Intervene our ick_first-stage lexer. */ extern int lexer(void); -- 2.43.0