]> granicus.if.org Git - flex/commitdiff
ndinstal(), char *, to get rid of casts and warnings
authorrlar <rlar>
Sun, 28 Feb 2016 19:11:49 +0000 (20:11 +0100)
committerWill Estes <westes575@gmail.com>
Tue, 1 Mar 2016 01:07:58 +0000 (20:07 -0500)
src/flexdef.h
src/scan.l
src/sym.c

index d879d92eb98aa14e5a815769c07fd48cd7946894..0b966645930574116f27b735a6ff307c59a7f261 100644 (file)
@@ -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. */
index 7b8215c6c8e865782f543c9308e7c3789524cf23..5314268e76fb38754188e75f150157c02ad84520 100644 (file)
@@ -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];
 
 
 <INITIAL>{
@@ -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 )
                                ;
index 97386ebb47a90161a1e8ee6390f2b3f748cf64d9..8eb51ccada91f52db6991b31f458c34e32391aed 100644 (file)
--- 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),