aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2002-04-21 18:46:42 +0000
committerNeil Booth <neil@gcc.gnu.org>2002-04-21 18:46:42 +0000
commit562a5c27c266280971055d4066ce9cba9403158b (patch)
tree3ea24655d8eabfdaf624b6cb32ed7b761c98617f
parent9ac3b1bec7b58c6ad4a76782b1116dfb5f4cd0c6 (diff)
downloadgcc-562a5c27c266280971055d4066ce9cba9403158b.zip
gcc-562a5c27c266280971055d4066ce9cba9403158b.tar.gz
gcc-562a5c27c266280971055d4066ce9cba9403158b.tar.bz2
cppexp.c (struct op, [...]): Replace U_CHAR with uchar.
* cppexp.c (struct op, parse_number): Replace U_CHAR with uchar. * cppfiles.c (read_include_file): Similarly. * cpphash.h (DSC, U_CHAR, ustrcmp, ustrncmp, ustrlen, uxstrdup ustrchr, ufputs): Similarly. * cppinit.c (TRIGRAPH_MAP, cpp_destroy): Similarly. * cpplex.c (parse_slow, unescaped_terminator_p, save_comment, cpp_ideq, parse_identifier, parse_number): Similarly. * cpplib.c (struct directive, dequote_string, D, run_directive, cpp_push_buffer): Similarly. * cppmacro.c (new_string_token, builtin_macro, cpp_quote_string, _cpp_create_definition, check_trad_stringification, cpp_macro_definition): Similarly. From-SVN: r52587
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/cppexp.c12
-rw-r--r--gcc/cppfiles.c10
-rw-r--r--gcc/cpphash.h38
-rw-r--r--gcc/cppinit.c6
-rw-r--r--gcc/cpplex.c22
-rw-r--r--gcc/cpplib.c28
-rw-r--r--gcc/cppmacro.c20
8 files changed, 83 insertions, 68 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f7a6c68..2b09952 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,20 @@
2002-04-21 Neil Booth <neil@daikokuya.demon.co.uk>
+ * cppexp.c (struct op, parse_number): Replace U_CHAR with uchar.
+ * cppfiles.c (read_include_file): Similarly.
+ * cpphash.h (DSC, U_CHAR, ustrcmp, ustrncmp, ustrlen,
+ uxstrdup ustrchr, ufputs): Similarly.
+ * cppinit.c (TRIGRAPH_MAP, cpp_destroy): Similarly.
+ * cpplex.c (parse_slow, unescaped_terminator_p, save_comment,
+ cpp_ideq, parse_identifier, parse_number): Similarly.
+ * cpplib.c (struct directive, dequote_string, D, run_directive,
+ cpp_push_buffer): Similarly.
+ * cppmacro.c (new_string_token, builtin_macro, cpp_quote_string,
+ _cpp_create_definition, check_trad_stringification,
+ cpp_macro_definition): Similarly.
+
+2002-04-21 Neil Booth <neil@daikokuya.demon.co.uk>
+
* cppmacro.c (funlike_invocation_p): Don't step back
over CPP_EOF.
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index e5b5ef7..b62741b 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -42,9 +42,9 @@ static const unsigned char *op_as_text PARAMS ((cpp_reader *, enum cpp_ttype));
struct op
{
enum cpp_ttype op;
- U_CHAR prio; /* Priority of op. */
- U_CHAR flags;
- U_CHAR unsignedp; /* True if value should be treated as unsigned. */
+ uchar prio; /* Priority of op. */
+ uchar flags;
+ uchar unsignedp; /* True if value should be treated as unsigned. */
HOST_WIDEST_INT value; /* The value logically "right" of op. */
};
@@ -91,9 +91,9 @@ parse_number (pfile, tok)
const cpp_token *tok;
{
struct op op;
- const U_CHAR *start = tok->val.str.text;
- const U_CHAR *end = start + tok->val.str.len;
- const U_CHAR *p = start;
+ const uchar *start = tok->val.str.text;
+ const uchar *end = start + tok->val.str.len;
+ const uchar *p = start;
int c = 0, i, nsuff;
unsigned HOST_WIDEST_INT n = 0, nd, MAX_over_base;
int base = 10;
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index c1e6bfc..38780ad 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -375,7 +375,7 @@ read_include_file (pfile, inc)
struct include_file *inc;
{
ssize_t size, offset, count;
- U_CHAR *buf;
+ uchar *buf;
#if MMAP_THRESHOLD
static int pagesize = -1;
#endif
@@ -404,15 +404,15 @@ read_include_file (pfile, inc)
if (SHOULD_MMAP (size, pagesize))
{
- buf = (U_CHAR *) mmap (0, size, PROT_READ, MAP_PRIVATE, inc->fd, 0);
- if (buf == (U_CHAR *)-1)
+ buf = (uchar *) mmap (0, size, PROT_READ, MAP_PRIVATE, inc->fd, 0);
+ if (buf == (uchar *)-1)
goto perror_fail;
inc->mapped = 1;
}
else
#endif
{
- buf = (U_CHAR *) xmalloc (size + 1);
+ buf = (uchar *) xmalloc (size + 1);
offset = 0;
while (offset < size)
{
@@ -447,7 +447,7 @@ read_include_file (pfile, inc)
bigger than the majority of C source files. */
size = 8 * 1024;
- buf = (U_CHAR *) xmalloc (size + 1);
+ buf = (uchar *) xmalloc (size + 1);
offset = 0;
while ((count = read (inc->fd, buf + offset, size - offset)) > 0)
{
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index 11483b0..e101bb3 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -411,7 +411,7 @@ extern void _cpp_do_file_change PARAMS ((cpp_reader *, enum lc_reason,
extern void _cpp_pop_buffer PARAMS ((cpp_reader *));
/* Utility routines and macros. */
-#define DSC(str) (const U_CHAR *)str, sizeof str - 1
+#define DSC(str) (const uchar *)str, sizeof str - 1
#define xnew(T) (T *) xmalloc (sizeof(T))
#define xcnew(T) (T *) xcalloc (1, sizeof(T))
#define xnewvec(T, N) (T *) xmalloc (sizeof(T) * (N))
@@ -420,27 +420,27 @@ extern void _cpp_pop_buffer PARAMS ((cpp_reader *));
/* These are inline functions instead of macros so we can get type
checking. */
-typedef unsigned char U_CHAR;
-#define U (const U_CHAR *) /* Intended use: U"string" */
+typedef unsigned char uchar;
+#define U (const uchar *) /* Intended use: U"string" */
-static inline int ustrcmp PARAMS ((const U_CHAR *, const U_CHAR *));
-static inline int ustrncmp PARAMS ((const U_CHAR *, const U_CHAR *,
+static inline int ustrcmp PARAMS ((const uchar *, const uchar *));
+static inline int ustrncmp PARAMS ((const uchar *, const uchar *,
size_t));
-static inline size_t ustrlen PARAMS ((const U_CHAR *));
-static inline U_CHAR *uxstrdup PARAMS ((const U_CHAR *));
-static inline U_CHAR *ustrchr PARAMS ((const U_CHAR *, int));
-static inline int ufputs PARAMS ((const U_CHAR *, FILE *));
+static inline size_t ustrlen PARAMS ((const uchar *));
+static inline uchar *uxstrdup PARAMS ((const uchar *));
+static inline uchar *ustrchr PARAMS ((const uchar *, int));
+static inline int ufputs PARAMS ((const uchar *, FILE *));
static inline int
ustrcmp (s1, s2)
- const U_CHAR *s1, *s2;
+ const uchar *s1, *s2;
{
return strcmp ((const char *)s1, (const char *)s2);
}
static inline int
ustrncmp (s1, s2, n)
- const U_CHAR *s1, *s2;
+ const uchar *s1, *s2;
size_t n;
{
return strncmp ((const char *)s1, (const char *)s2, n);
@@ -448,29 +448,29 @@ ustrncmp (s1, s2, n)
static inline size_t
ustrlen (s1)
- const U_CHAR *s1;
+ const uchar *s1;
{
return strlen ((const char *)s1);
}
-static inline U_CHAR *
+static inline uchar *
uxstrdup (s1)
- const U_CHAR *s1;
+ const uchar *s1;
{
- return (U_CHAR *) xstrdup ((const char *)s1);
+ return (uchar *) xstrdup ((const char *)s1);
}
-static inline U_CHAR *
+static inline uchar *
ustrchr (s1, c)
- const U_CHAR *s1;
+ const uchar *s1;
int c;
{
- return (U_CHAR *) strchr ((const char *)s1, c);
+ return (uchar *) strchr ((const char *)s1, c);
}
static inline int
ufputs (s, f)
- const U_CHAR *s;
+ const uchar *s;
FILE *f;
{
return fputs ((const char *)s, f);
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index a9092ed..8caf2ed 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -130,14 +130,14 @@ enum { BRACKET = 0, SYSTEM, AFTER };
#define init_trigraph_map() /* Nothing. */
#define TRIGRAPH_MAP \
-__extension__ const U_CHAR _cpp_trigraph_map[UCHAR_MAX + 1] = {
+__extension__ const uchar _cpp_trigraph_map[UCHAR_MAX + 1] = {
#define END };
#define s(p, v) [p] = v,
#else
-#define TRIGRAPH_MAP U_CHAR _cpp_trigraph_map[UCHAR_MAX + 1] = { 0 }; \
+#define TRIGRAPH_MAP uchar _cpp_trigraph_map[UCHAR_MAX + 1] = { 0 }; \
static void init_trigraph_map PARAMS ((void)) { \
unsigned char *x = _cpp_trigraph_map;
@@ -619,7 +619,7 @@ cpp_destroy (pfile)
Also, macros with CPLUS set in the flags field are entered only for C++. */
struct builtin
{
- const U_CHAR *name;
+ const uchar *name;
const char *value;
unsigned char builtin;
unsigned char operator;
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 47b1bcf..eed9ffd 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -77,13 +77,13 @@ static int skip_line_comment PARAMS ((cpp_reader *));
static void adjust_column PARAMS ((cpp_reader *));
static int skip_whitespace PARAMS ((cpp_reader *, cppchar_t));
static cpp_hashnode *parse_identifier PARAMS ((cpp_reader *));
-static U_CHAR *parse_slow PARAMS ((cpp_reader *, const U_CHAR *, int,
+static uchar *parse_slow PARAMS ((cpp_reader *, const uchar *, int,
unsigned int *));
static void parse_number PARAMS ((cpp_reader *, cpp_string *, int));
-static int unescaped_terminator_p PARAMS ((cpp_reader *, const U_CHAR *));
+static int unescaped_terminator_p PARAMS ((cpp_reader *, const uchar *));
static void parse_string PARAMS ((cpp_reader *, cpp_token *, cppchar_t));
static bool trigraph_p PARAMS ((cpp_reader *));
-static void save_comment PARAMS ((cpp_reader *, cpp_token *, const U_CHAR *,
+static void save_comment PARAMS ((cpp_reader *, cpp_token *, const uchar *,
cppchar_t));
static int name_p PARAMS ((cpp_reader *, const cpp_string *));
static int maybe_read_ucs PARAMS ((cpp_reader *, const unsigned char **,
@@ -105,7 +105,7 @@ cpp_ideq (token, string)
if (token->type != CPP_NAME)
return 0;
- return !ustrcmp (NODE_NAME (token->val.node), (const U_CHAR *) string);
+ return !ustrcmp (NODE_NAME (token->val.node), (const uchar *) string);
}
/* Call when meeting a newline, assumed to be in buffer->cur[-1].
@@ -421,7 +421,7 @@ parse_identifier (pfile)
cpp_reader *pfile;
{
cpp_hashnode *result;
- const U_CHAR *cur, *base;
+ const uchar *cur, *base;
/* Fast-path loop. Skim over a normal identifier.
N.B. ISIDNUM does not include $. */
@@ -473,15 +473,15 @@ parse_identifier (pfile)
1 if it's a number, and 2 if it has a leading period. Returns a
pointer to the token's NUL-terminated spelling in permanent
storage, and sets PLEN to its length. */
-static U_CHAR *
+static uchar *
parse_slow (pfile, cur, number_p, plen)
cpp_reader *pfile;
- const U_CHAR *cur;
+ const uchar *cur;
int number_p;
unsigned int *plen;
{
cpp_buffer *buffer = pfile->buffer;
- const U_CHAR *base = buffer->cur - 1;
+ const uchar *base = buffer->cur - 1;
struct obstack *stack = &pfile->hash_table->stack;
unsigned int c, prevc, saw_dollar = 0;
@@ -550,7 +550,7 @@ parse_number (pfile, number, leading_period)
cpp_string *number;
int leading_period;
{
- const U_CHAR *cur;
+ const uchar *cur;
/* Fast-path loop. Skim over a normal number.
N.B. ISIDNUM does not include $. */
@@ -563,8 +563,8 @@ parse_number (pfile, number, leading_period)
number->text = parse_slow (pfile, cur, 1 + leading_period, &number->len);
else
{
- const U_CHAR *base = pfile->buffer->cur - 1;
- U_CHAR *dest;
+ const uchar *base = pfile->buffer->cur - 1;
+ uchar *dest;
number->len = cur - base + leading_period;
dest = _cpp_unaligned_alloc (pfile, number->len + 1);
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 52c3940..dddf86a 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -82,7 +82,7 @@ typedef struct directive directive;
struct directive
{
directive_handler handler; /* Function to handle directive. */
- const U_CHAR *name; /* Name of directive. */
+ const uchar *name; /* Name of directive. */
unsigned short length; /* Length of name. */
unsigned char origin; /* Origin of directive. */
unsigned char flags; /* Flags describing this directive. */
@@ -103,9 +103,9 @@ static const cpp_token *parse_include PARAMS ((cpp_reader *));
static void push_conditional PARAMS ((cpp_reader *, int, int,
const cpp_hashnode *));
static unsigned int read_flag PARAMS ((cpp_reader *, unsigned int));
-static U_CHAR *dequote_string PARAMS ((cpp_reader *, const U_CHAR *,
+static uchar *dequote_string PARAMS ((cpp_reader *, const uchar *,
unsigned int));
-static int strtoul_for_line PARAMS ((const U_CHAR *, unsigned int,
+static int strtoul_for_line PARAMS ((const uchar *, unsigned int,
unsigned long *));
static void do_diagnostic PARAMS ((cpp_reader *, int, int));
static cpp_hashnode *lex_macro_node PARAMS ((cpp_reader *));
@@ -185,7 +185,7 @@ enum
/* Don't invoke CONCAT2 with any whitespace or K&R cc will fail. */
#define D(name, t, origin, flags) \
-{ CONCAT2(do_,name), (const U_CHAR *) STRINGX(name), \
+{ CONCAT2(do_,name), (const uchar *) STRINGX(name), \
sizeof STRINGX(name) - 1, origin, flags },
static const directive dtable[] =
{
@@ -429,7 +429,7 @@ run_directive (pfile, dir_no, buf, count)
const char *buf;
size_t count;
{
- cpp_push_buffer (pfile, (const U_CHAR *) buf, count,
+ cpp_push_buffer (pfile, (const uchar *) buf, count,
/* from_stage3 */ true, 1);
start_directive (pfile);
/* We don't want a leading # to be interpreted as a directive. */
@@ -717,15 +717,15 @@ read_flag (pfile, last)
/* Subroutine of do_line and do_linemarker. Returns a version of STR
which has a NUL terminator and all escape sequences converted to
their equivalents. Temporary, hopefully. */
-static U_CHAR *
+static uchar *
dequote_string (pfile, str, len)
cpp_reader *pfile;
- const U_CHAR *str;
+ const uchar *str;
unsigned int len;
{
- U_CHAR *result = _cpp_unaligned_alloc (pfile, len + 1);
- U_CHAR *dst = result;
- const U_CHAR *limit = str + len;
+ uchar *result = _cpp_unaligned_alloc (pfile, len + 1);
+ uchar *dst = result;
+ const uchar *limit = str + len;
unsigned int c;
unsigned HOST_WIDE_INT mask;
@@ -742,7 +742,7 @@ dequote_string (pfile, str, len)
if (c != '\\')
*dst++ = c;
else
- *dst++ = cpp_parse_escape (pfile, (const U_CHAR **)&str, limit, mask);
+ *dst++ = cpp_parse_escape (pfile, (const uchar **)&str, limit, mask);
}
*dst++ = '\0';
return result;
@@ -753,12 +753,12 @@ dequote_string (pfile, str, len)
number was well-formed, 1 if not. Temporary, hopefully. */
static int
strtoul_for_line (str, len, nump)
- const U_CHAR *str;
+ const uchar *str;
unsigned int len;
unsigned long *nump;
{
unsigned long reg = 0;
- U_CHAR c;
+ uchar c;
while (len--)
{
c = *str++;
@@ -1878,7 +1878,7 @@ cpp_set_callbacks (pfile, cb)
cpp_buffer *
cpp_push_buffer (pfile, buffer, len, from_stage3, return_at_eof)
cpp_reader *pfile;
- const U_CHAR *buffer;
+ const uchar *buffer;
size_t len;
int from_stage3;
int return_at_eof;
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index d39bd45..aa2e58b 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -64,7 +64,7 @@ static cpp_context *next_context PARAMS ((cpp_reader *));
static const cpp_token *padding_token
PARAMS ((cpp_reader *, const cpp_token *));
static void expand_arg PARAMS ((cpp_reader *, macro_arg *));
-static const cpp_token *new_string_token PARAMS ((cpp_reader *, U_CHAR *,
+static const cpp_token *new_string_token PARAMS ((cpp_reader *, uchar *,
unsigned int));
static const cpp_token *new_number_token PARAMS ((cpp_reader *, unsigned int));
static const cpp_token *stringify_arg PARAMS ((cpp_reader *, macro_arg *));
@@ -152,7 +152,7 @@ builtin_macro (pfile, node)
{
unsigned int len;
const char *name;
- U_CHAR *buf;
+ uchar *buf;
const struct line_map *map = pfile->map;
if (node->value.builtin == BT_BASE_FILE)
@@ -244,15 +244,15 @@ builtin_macro (pfile, node)
backslashes and double quotes. Non-printable characters are
converted to octal. DEST must be of sufficient size. Returns
a pointer to the end of the string. */
-U_CHAR *
+uchar *
cpp_quote_string (dest, src, len)
- U_CHAR *dest;
- const U_CHAR *src;
+ uchar *dest;
+ const uchar *src;
unsigned int len;
{
while (len--)
{
- U_CHAR c = *src++;
+ uchar c = *src++;
if (c == '\\' || c == '"')
{
@@ -1340,7 +1340,7 @@ _cpp_create_definition (pfile, node)
goto cleanup2;
/* Success. Commit the parameter array. */
- BUFF_FRONT (pfile->a_buff) = (U_CHAR *) &macro->params[macro->paramc];
+ BUFF_FRONT (pfile->a_buff) = (uchar *) &macro->params[macro->paramc];
macro->fun_like = 1;
}
else if (ctoken->type != CPP_EOF && !(ctoken->flags & PREV_WHITE))
@@ -1416,7 +1416,7 @@ _cpp_create_definition (pfile, node)
macro->expansion[0].flags &= ~PREV_WHITE;
/* Commit the memory. */
- BUFF_FRONT (pfile->a_buff) = (U_CHAR *) &macro->expansion[macro->count];
+ BUFF_FRONT (pfile->a_buff) = (uchar *) &macro->expansion[macro->count];
/* Implement the macro-defined-to-itself optimisation. */
if (macro->count == 1 && !macro->fun_like
@@ -1474,7 +1474,7 @@ check_trad_stringification (pfile, macro, string)
const cpp_string *string;
{
unsigned int i, len;
- const U_CHAR *p, *q, *limit = string->text + string->len;
+ const uchar *p, *q, *limit = string->text + string->len;
/* Loop over the string. */
for (p = string->text; p < limit; p = q)
@@ -1555,7 +1555,7 @@ cpp_macro_definition (pfile, node)
if (len > pfile->macro_buffer_len)
{
- pfile->macro_buffer = (U_CHAR *) xrealloc (pfile->macro_buffer, len);
+ pfile->macro_buffer = (uchar *) xrealloc (pfile->macro_buffer, len);
pfile->macro_buffer_len = len;
}