From 967819769eab880caa9aaf3a13605b0516e44b06 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 28 Feb 2016 20:11:49 +0100 Subject: ndinstal(), char *, to get rid of casts and warnings --- src/flexdef.h | 2 +- src/scan.l | 6 +++--- src/sym.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/flexdef.h b/src/flexdef.h index d879d92..0b96664 100644 --- a/src/flexdef.h +++ b/src/flexdef.h @@ -996,7 +996,7 @@ extern void cclinstal(char[], int); /* Lookup the number associated with character class. */ extern int ccllookup(char[]); -extern void ndinstal(const char *, unsigned char[]); /* install a name definition */ +extern void ndinstal(const char *, char[]); /* install a name definition */ extern unsigned char *ndlookup(const char *); /* lookup a name definition */ /* Increase maximum number of SC's. */ diff --git a/src/scan.l b/src/scan.l index 7b8215c..5314268 100644 --- a/src/scan.l +++ b/src/scan.l @@ -135,7 +135,7 @@ M4QEND "]]" int doing_codeblock = false; int i, brace_depth=0, brace_start_line=0; - unsigned char nmdef[MAXLINE]; + char nmdef[MAXLINE]; { @@ -293,7 +293,7 @@ M4QEND "]]" {NOT_WS}[^\r\n]* { if(yyleng < MAXLINE) { - strcpy( (char *) nmdef, yytext ); + strcpy( nmdef, yytext ); } else { @@ -301,7 +301,7 @@ M4QEND "]]" FLEX_EXIT(EXIT_FAILURE); } /* Skip trailing whitespace. */ - for ( i = strlen( (char *) nmdef ) - 1; + for ( i = strlen( nmdef ) - 1; i >= 0 && (nmdef[i] == ' ' || nmdef[i] == '\t'); --i ) ; diff --git a/src/sym.c b/src/sym.c index 97386eb..8eb51cc 100644 --- a/src/sym.c +++ b/src/sym.c @@ -174,7 +174,7 @@ static int hashfunct (const char *str, int hash_size) /* ndinstal - install a name definition */ -void ndinstal (const char *name, unsigned char definition[]) +void ndinstal (const char *name, char definition[]) { if (addsym (xstrdup(name), -- cgit v1.2.3