cppexp.c (struct op, [...]): Replace U_CHAR with uchar.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Sun, 21 Apr 2002 18:46:42 +0000 (18:46 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Sun, 21 Apr 2002 18:46:42 +0000 (18:46 +0000)
* 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

gcc/ChangeLog
gcc/cppexp.c
gcc/cppfiles.c
gcc/cpphash.h
gcc/cppinit.c
gcc/cpplex.c
gcc/cpplib.c
gcc/cppmacro.c

index f7a6c68907de6881a997bc31893c6e81055ff0fa..2b09952dac8d94fd648b9fdca1253ab16d8435ea 100644 (file)
@@ -1,3 +1,18 @@
+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
index e5b5ef7ae60d364e848fc68ca646ae0d96022f57..b62741b30daf7a1a3910dcd64c1fc8a5e107af62 100644 (file)
@@ -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;
index c1e6bfc6c173c150012bb7b59b2c1b2dbd7ae85b..38780ad24a13c1fee0e2853f51937e1b5e702d1d 100644 (file)
@@ -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)
        {
index 11483b0edef1506047a539c2627dcefb1bb9a91b..e101bb3ef904f0e5de2b45d2b3f1adb9654755c7 100644 (file)
@@ -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);
index a9092edf429c4e2ef867282e258f0f14a525f26d..8caf2ed11e8f6111d994479a86f6d969ec9b8f08 100644 (file)
@@ -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;
index 47b1bcf86402020457b6bf0c8bdbf24b1416b483..eed9ffda2115f59b982f38c90bf62b2b0d554432 100644 (file)
@@ -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);
index 52c394055c8030ff511fff3df11214ab864555e6..dddf86a86af0440f9dd3d17cf0693cdc2acecc67 100644 (file)
@@ -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;
index d39bd45ff255af7731a9653d309112cfddadd974..aa2e58bf02d686a19b8215169eb1e97ab0833945 100644 (file)
@@ -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;
     }