/[pcre]/code/branches/pcre16/pcre_printint.src
ViewVC logotype

Diff of /code/branches/pcre16/pcre_printint.src

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 763 by ph10, Mon Nov 21 10:48:42 2011 UTC revision 764 by zherczeg, Wed Nov 23 17:23:20 2011 UTC
# Line 90  if (!utf8 || (c & 0xc0) != 0xc0) Line 90  if (!utf8 || (c & 0xc0) != 0xc0)
90  else  else
91    {    {
92    int i;    int i;
93    int a = _pcre_utf8_table4[c & 0x3f];  /* Number of additional bytes */    int a = PRIV(utf8_table4)[c & 0x3f];  /* Number of additional bytes */
94    int s = 6*a;    int s = 6*a;
95    c = (c & _pcre_utf8_table3[a]) << s;    c = (c & PRIV(utf8_table3)[a]) << s;
96    for (i = 1; i <= a; i++)    for (i = 1; i <= a; i++)
97      {      {
98      /* This is a check for malformed UTF-8; it should only occur if the sanity      /* This is a check for malformed UTF-8; it should only occur if the sanity
# Line 127  get_ucpname(int ptype, int pvalue) Line 127  get_ucpname(int ptype, int pvalue)
127  {  {
128  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
129  int i;  int i;
130  for (i = _pcre_utt_size - 1; i >= 0; i--)  for (i = PRIV(utt_size) - 1; i >= 0; i--)
131    {    {
132    if (ptype == _pcre_utt[i].type && pvalue == _pcre_utt[i].value) break;    if (ptype == PRIV(utt)[i].type && pvalue == PRIV(utt)[i].value) break;
133    }    }
134  return (i >= 0)? _pcre_utt_names + _pcre_utt[i].name_offset : "??";  return (i >= 0)? PRIV(utt_names) + PRIV(utt)[i].name_offset : "??";
135  #else  #else
136  /* It gets harder and harder to shut off unwanted compiler warnings. */  /* It gets harder and harder to shut off unwanted compiler warnings. */
137  ptype = ptype * pvalue;  ptype = ptype * pvalue;
# Line 193  for(;;) Line 193  for(;;)
193      {      {
194  /* ========================================================================== */  /* ========================================================================== */
195        /* These cases are never obeyed. This is a fudge that causes a compile-        /* These cases are never obeyed. This is a fudge that causes a compile-
196        time error if the vectors OP_names or _pcre_OP_lengths, which are indexed        time error if the vectors OP_names or PRIV(OP_lengths), which are indexed
197        by opcode, are not the correct length. It seems to be the only way to do        by opcode, are not the correct length. It seems to be the only way to do
198        such a check at compile time, as the sizeof() operator does not work in        such a check at compile time, as the sizeof() operator does not work in
199        the C preprocessor. We do this while compiling pcretest, because that        the C preprocessor. We do this while compiling pcretest, because that
200        #includes pcre_tables.c, which holds _pcre_OP_lengths. We can't do this        #includes pcre_tables.c, which holds PRIV(OP_lengths). We can't do this
201        when building pcre_compile.c with PCRE_DEBUG set, because it doesn't then        when building pcre_compile.c with PCRE_DEBUG set, because it doesn't then
202        know the size of _pcre_OP_lengths. */        know the size of PRIV(OP_lengths). */
203    
204  #ifdef COMPILING_PCRETEST  #ifdef COMPILING_PCRETEST
205        case OP_TABLE_LENGTH:        case OP_TABLE_LENGTH:
206        case OP_TABLE_LENGTH +        case OP_TABLE_LENGTH +
207          ((sizeof(OP_names)/sizeof(const char *) == OP_TABLE_LENGTH) &&          ((sizeof(OP_names)/sizeof(const char *) == OP_TABLE_LENGTH) &&
208          (sizeof(_pcre_OP_lengths) == OP_TABLE_LENGTH)):          (sizeof(PRIV(OP_lengths)) == OP_TABLE_LENGTH)):
209        break;        break;
210  #endif  #endif
211  /* ========================================================================== */  /* ========================================================================== */
# Line 445  for(;;) Line 445  for(;;)
445      /* Fall through */      /* Fall through */
446      case OP_REF:      case OP_REF:
447      fprintf(f, " %s \\%d", flag, GET2(code,1));      fprintf(f, " %s \\%d", flag, GET2(code,1));
448      ccode = code + _pcre_OP_lengths[*code];      ccode = code + PRIV(OP_lengths)[*code];
449      goto CLASS_REF_REPEAT;      goto CLASS_REF_REPEAT;
450    
451      case OP_CALLOUT:      case OP_CALLOUT:
# Line 558  for(;;) Line 558  for(;;)
558          case OP_CRQUERY:          case OP_CRQUERY:
559          case OP_CRMINQUERY:          case OP_CRMINQUERY:
560          fprintf(f, "%s", OP_names[*ccode]);          fprintf(f, "%s", OP_names[*ccode]);
561          extra += _pcre_OP_lengths[*ccode];          extra += PRIV(OP_lengths)[*ccode];
562          break;          break;
563    
564          case OP_CRRANGE:          case OP_CRRANGE:
# Line 568  for(;;) Line 568  for(;;)
568          if (max == 0) fprintf(f, "{%d,}", min);          if (max == 0) fprintf(f, "{%d,}", min);
569          else fprintf(f, "{%d,%d}", min, max);          else fprintf(f, "{%d,%d}", min, max);
570          if (*ccode == OP_CRMINRANGE) fprintf(f, "?");          if (*ccode == OP_CRMINRANGE) fprintf(f, "?");
571          extra += _pcre_OP_lengths[*ccode];          extra += PRIV(OP_lengths)[*ccode];
572          break;          break;
573    
574          /* Do nothing if it's not a repeat; this code stops picky compilers          /* Do nothing if it's not a repeat; this code stops picky compilers
# Line 608  for(;;) Line 608  for(;;)
608      break;      break;
609      }      }
610    
611    code += _pcre_OP_lengths[*code] + extra;    code += PRIV(OP_lengths)[*code] + extra;
612    fprintf(f, "\n");    fprintf(f, "\n");
613    }    }
614  }  }

Legend:
Removed from v.763  
changed lines
  Added in v.764

  ViewVC Help
Powered by ViewVC 1.1.5