Print this page
11972 resync smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/char.c
          +++ new/usr/src/tools/smatch/src/char.c
↓ open down ↓ 76 lines elided ↑ open up ↑
  77   77                  p = token->string->data;
  78   78                  end = p + token->string->length - 1;
  79   79                  break;
  80   80          case TOKEN_CHAR_EMBEDDED_0 ... TOKEN_CHAR_EMBEDDED_3:
  81   81                  end = p + type - TOKEN_CHAR;
  82   82                  break;
  83   83          default:
  84   84                  end = p + type - TOKEN_WIDE_CHAR;
  85   85          }
  86   86          p = parse_escape(p, &v, end,
  87      -                        type < TOKEN_WIDE_CHAR ? bits_in_char : bits_in_wchar, token->pos);
       87 +                        type < TOKEN_WIDE_CHAR ? bits_in_char : wchar_ctype->bit_size, token->pos);
  88   88          if (p != end)
  89   89                  warning(token->pos,
  90   90                          "multi-character character constant");
  91   91          *val = v;
  92   92  }
  93   93  
  94   94  struct token *get_string_constant(struct token *token, struct expression *expr)
  95   95  {
  96   96          struct string *string = token->string;
  97   97          struct token *next = token->next, *done = NULL;
↓ open down ↓ 8 lines elided ↑ open up ↑
 106  106                  switch (token_type(next)) {
 107  107                  case TOKEN_WIDE_STRING:
 108  108                          is_wide = 1;
 109  109                  case TOKEN_STRING:
 110  110                          next = next->next;
 111  111                          break;
 112  112                  default:
 113  113                          done = next;
 114  114                  }
 115  115          }
 116      -        bits = is_wide ? bits_in_wchar : bits_in_char;
      116 +        bits = is_wide ? wchar_ctype->bit_size: bits_in_char;
 117  117          while (token != done) {
 118  118                  unsigned v;
 119  119                  const char *p = token->string->data;
 120  120                  const char *end = p + token->string->length - 1;
 121  121                  while (p < end) {
 122  122                          if (*p == '\\')
 123  123                                  esc_count++;
 124  124                          p = parse_escape(p, &v, end, bits, token->pos);
 125  125                          if (len < MAX_STRING)
 126  126                                  buffer[len] = v;
↓ open down ↓ 20 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX