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

index ed65f05a11431599a14e46a76f1abed8adb08523..d879d92eb98aa14e5a815769c07fd48cd7946894 100644 (file)
@@ -991,10 +991,10 @@ extern void set_input_file(char *);
 /* from file sym.c */
 
 /* Save the text of a character class. */
-extern void cclinstal(unsigned char[], int);
+extern void cclinstal(char[], int);
 
 /* Lookup the number associated with character class. */
-extern int ccllookup(unsigned char[]);
+extern int ccllookup(char[]);
 
 extern void ndinstal(const char *, unsigned char[]);   /* install a name definition */
 extern unsigned char *ndlookup(const char *);  /* lookup a name definition */
index 263613d1cd52f930aebafc4b3c958d5e36328645..7b8215c6c8e865782f543c9308e7c3789524cf23 100644 (file)
@@ -628,7 +628,7 @@ M4QEND      "]]"
                    * The reason it was disabled is so yacc/bison can parse
                    * ccl operations, such as ccl difference and union.
                    */
-                &&  (cclval = ccllookup( (unsigned char *) nmstr )) != 0 )
+                &&  (cclval = ccllookup( nmstr )) != 0 )
                                {
                                if ( input() != ']' )
                                        synerr( _( "bad character class" ) );
@@ -642,7 +642,7 @@ M4QEND      "]]"
                                /* We fudge a bit.  We know that this ccl will
                                 * soon be numbered as lastccl + 1 by cclinit.
                                 */
-                               cclinstal( (unsigned char *) nmstr, lastccl + 1 );
+                               cclinstal( nmstr, lastccl + 1 );
 
                                /* Push back everything but the leading bracket
                                 * so the ccl can be rescanned.
index 241256ef10479cf8655f2edce227127574858659..97386ebb47a90161a1e8ee6390f2b3f748cf64d9 100644 (file)
--- a/src/sym.c
+++ b/src/sym.c
@@ -111,7 +111,7 @@ static int addsym (char sym[], char *str_def, int int_def, hash_table table, int
 
 /* cclinstal - save the text of a character class */
 
-void    cclinstal (unsigned char ccltxt[], int cclnum)
+void    cclinstal (char ccltxt[], int cclnum)
 {
        /* We don't bother checking the return status because we are not
         * called unless the symbol is new.
@@ -127,9 +127,9 @@ void    cclinstal (unsigned char ccltxt[], int cclnum)
  * Returns 0 if there's no CCL associated with the text.
  */
 
-int     ccllookup (unsigned char ccltxt[])
+int     ccllookup (char ccltxt[])
 {
-       return findsym ((char *) ccltxt, ccltab, CCL_HASH_SIZE)->int_val;
+       return findsym (ccltxt, ccltab, CCL_HASH_SIZE)->int_val;
 }