summaryrefslogtreecommitdiff
path: root/src/flexdef.h
diff options
context:
space:
mode:
authorMightyjo <mightyjo@gmail.com>2015-11-27 21:38:23 -0500
committerWill Estes <westes575@gmail.com>2015-11-29 17:20:22 -0500
commita97cf48486226d538797ef721c62a80b9327c43f (patch)
tree9744e98330df3c31dbeced82f7ad128bb5268221 /src/flexdef.h
parent45db9033fefa30cdc263db6ede60807da7da89c5 (diff)
Replaced CHAR macro with unsigned char type.
Thanks to Michael McConville for pointing out that the old Char macro causes problems with static analysis. The macro has been removed and replaced with 'unsigned char' throughout the flex sources. The macro is not needed at best and was confusing at worst. It was not used in any of the example files nor was it mentioned in the manual at all.
Diffstat (limited to 'src/flexdef.h')
-rw-r--r--src/flexdef.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/flexdef.h b/src/flexdef.h
index 496e34c..ede6a93 100644
--- a/src/flexdef.h
+++ b/src/flexdef.h
@@ -109,7 +109,6 @@ char *alloca ();
/* Always be prepared to generate an 8-bit scanner. */
#define CSIZE 256
-#define Char unsigned char
/* Size of input alphabet - should be size of ASCII set. */
#ifndef DEFAULT_CSIZE
@@ -647,7 +646,7 @@ extern int end_of_buffer_state;
extern int lastccl, *cclmap, *ccllen, *cclng, cclreuse;
extern int current_maxccls, current_max_ccl_tbl_size;
-extern Char *ccltbl;
+extern unsigned char *ccltbl;
/* Variables for miscellaneous information:
@@ -721,10 +720,10 @@ void flex_free PROTO ((void *));
(char *) reallocate_array( (void *) array, size, sizeof( char ) )
#define allocate_Character_array(size) \
- (Char *) allocate_array( size, sizeof( Char ) )
+ (unsigned char *) allocate_array( size, sizeof( unsigned char ) )
#define reallocate_Character_array(array,size) \
- (Char *) reallocate_array( (void *) array, size, sizeof( Char ) )
+ (unsigned char *) reallocate_array( (void *) array, size, sizeof( unsigned char ) )
/* Used to communicate between scanner and parser. The type should really
@@ -777,7 +776,7 @@ extern void ccl2ecl PROTO ((void));
extern int cre8ecs PROTO ((int[], int[], int));
/* Update equivalence classes based on character class transitions. */
-extern void mkeccl PROTO ((Char[], int, int[], int[], int, int));
+extern void mkeccl PROTO ((unsigned char[], int, int[], int[], int, int));
/* Create equivalence class for single character. */
extern void mkechar PROTO ((int, int[], int[]));
@@ -856,13 +855,13 @@ extern int intcmp PROTO ((const void *, const void *));
extern void check_char PROTO ((int c));
/* Replace upper-case letter to lower-case. */
-extern Char clower PROTO ((int));
+extern unsigned char clower PROTO ((int));
/* Returns a dynamically allocated copy of a string. */
extern char *copy_string PROTO ((const char *));
/* Returns a dynamically allocated copy of a (potentially) unsigned string. */
-extern Char *copy_unsigned_string PROTO ((Char *));
+extern unsigned char *copy_unsigned_string PROTO ((unsigned char *));
/* Compare two characters for use by qsort with '\0' sorting last. */
extern int cclcmp PROTO ((const void *, const void *));
@@ -901,7 +900,7 @@ extern void flexfatal PROTO ((const char *));
#endif /* ! HAVE_DECL___func__ */
/* Convert a hexadecimal digit string to an integer value. */
-extern int htoi PROTO ((Char[]));
+extern int htoi PROTO ((unsigned char[]));
/* Report an error message formatted */
extern void lerr PROTO ((const char *, ...))
@@ -937,10 +936,10 @@ extern void mkdata PROTO ((int)); /* generate a data statement */
extern int myctoi PROTO ((const char *));
/* Return character corresponding to escape sequence. */
-extern Char myesc PROTO ((Char[]));
+extern unsigned char myesc PROTO ((unsigned char[]));
/* Convert an octal digit string to an integer value. */
-extern int otoi PROTO ((Char[]));
+extern int otoi PROTO ((unsigned char[]));
/* Output a (possibly-formatted) string to the generated scanner. */
extern void out PROTO ((const char *));
@@ -1056,13 +1055,13 @@ extern int yywrap PROTO ((void));
/* from file sym.c */
/* Save the text of a character class. */
-extern void cclinstal PROTO ((Char[], int));
+extern void cclinstal PROTO ((unsigned char[], int));
/* Lookup the number associated with character class. */
-extern int ccllookup PROTO ((Char[]));
+extern int ccllookup PROTO ((unsigned char[]));
-extern void ndinstal PROTO ((const char *, Char[])); /* install a name definition */
-extern Char *ndlookup PROTO ((const char *)); /* lookup a name definition */
+extern void ndinstal PROTO ((const char *, unsigned char[])); /* install a name definition */
+extern unsigned char *ndlookup PROTO ((const char *)); /* lookup a name definition */
/* Increase maximum number of SC's. */
extern void scextend PROTO ((void));