diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2007-04-17 15:07:29 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2007-04-17 15:07:29 +0000 |
commit | 3c36bde64832e5c3b8a89b19680bf408fa98a0b7 (patch) | |
tree | 6def2dca0441cfc9b5ca0525b8df8b7cb0589b81 | |
parent | c2ca0181556e8224559ea493ebe08ad3ab1e986d (diff) | |
download | pcre-3c36bde64832e5c3b8a89b19680bf408fa98a0b7.tar.gz |
Tidies: added some casts and some missing #ifdefs.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@151 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | pcre_dfa_exec.c | 11 | ||||
-rw-r--r-- | pcregrep.c | 8 | ||||
-rw-r--r-- | pcretest.c | 4 |
4 files changed, 21 insertions, 8 deletions
@@ -142,6 +142,12 @@ Version 7.1 12-Mar-07 21. Added PCRE_NEWLINE_ANYCRLF which is like ANY, but matches only CR, LF, or CRLF as a newline sequence. + +22. Code for handling Unicode properties in pcre_dfa_exec() wasn't being cut + out by #ifdef SUPPORT_UCP. This did no harm, as it could never be used, but + I have nevertheless tidied it up. + +23. Added some casts to kill warnings from HP-UX ia64 compiler. Version 7.0 19-Dec-06 diff --git a/pcre_dfa_exec.c b/pcre_dfa_exec.c index 93ac1fd..ba31ecc 100644 --- a/pcre_dfa_exec.c +++ b/pcre_dfa_exec.c @@ -500,7 +500,9 @@ for (;;) const uschar *code; int state_offset = current_state->offset; int count, codevalue; +#ifdef SUPPORT_UCP int chartype, script; +#endif #ifdef DEBUG printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset); @@ -783,13 +785,12 @@ for (;;) break; -#ifdef SUPPORT_UCP - /*-----------------------------------------------------------------*/ /* Check the next character by Unicode property. We will get here only if the support is in the binary; otherwise a compile-time error occurs. */ +#ifdef SUPPORT_UCP case OP_PROP: case OP_NOTPROP: if (clen > 0) @@ -970,6 +971,7 @@ for (;;) argument. It keeps the code above fast for the other cases. The argument is in the d variable. */ +#ifdef SUPPORT_UCP case OP_PROP_EXTRA + OP_TYPEPLUS: case OP_PROP_EXTRA + OP_TYPEMINPLUS: case OP_PROP_EXTRA + OP_TYPEPOSPLUS: @@ -1049,6 +1051,7 @@ for (;;) ADD_NEW_DATA(-state_offset, count, ncount); } break; +#endif /*-----------------------------------------------------------------*/ case OP_ANYNL_EXTRA + OP_TYPEPLUS: @@ -1085,6 +1088,7 @@ for (;;) break; /*-----------------------------------------------------------------*/ +#ifdef SUPPORT_UCP case OP_PROP_EXTRA + OP_TYPEQUERY: case OP_PROP_EXTRA + OP_TYPEMINQUERY: case OP_PROP_EXTRA + OP_TYPEPOSQUERY: @@ -1182,6 +1186,7 @@ for (;;) ADD_NEW_DATA(-(state_offset + count), 0, ncount); } break; +#endif /*-----------------------------------------------------------------*/ case OP_ANYNL_EXTRA + OP_TYPEQUERY: @@ -1226,6 +1231,7 @@ for (;;) break; /*-----------------------------------------------------------------*/ +#ifdef SUPPORT_UCP case OP_PROP_EXTRA + OP_TYPEEXACT: case OP_PROP_EXTRA + OP_TYPEUPTO: case OP_PROP_EXTRA + OP_TYPEMINUPTO: @@ -1313,6 +1319,7 @@ for (;;) { ADD_NEW_DATA(-state_offset, count, ncount); } } break; +#endif /*-----------------------------------------------------------------*/ case OP_ANYNL_EXTRA + OP_TYPEEXACT: @@ -280,7 +280,7 @@ for (;;) if (strcmp(dent->d_name, ".") != 0 && strcmp(dent->d_name, "..") != 0) return dent->d_name; } -return NULL; /* Keep compiler happy; never executed */ +/* Control never reaches here */ } static void @@ -1525,7 +1525,7 @@ if ((process_options & PO_FIXED_STRINGS) != 0) char *p = end_of_line(pattern, eop, &ellength); if (ellength == 0) return compile_single_pattern(pattern, options, filename, count); - sprintf(buffer, "%.*s", p - pattern - ellength, pattern); + sprintf(buffer, "%.*s", (int)(p - pattern - ellength), pattern); pattern = p; if (!compile_single_pattern(buffer, options, filename, count)) return FALSE; @@ -1644,8 +1644,8 @@ for (i = 1; i < argc; i++) char buff2[24]; int baselen = opbra - op->long_name; sprintf(buff1, "%.*s", baselen, op->long_name); - sprintf(buff2, "%s%.*s", buff1, strlen(op->long_name) - baselen - 2, - opbra + 1); + sprintf(buff2, "%s%.*s", buff1, + (int)strlen(op->long_name) - baselen - 2, opbra + 1); if (strcmp(arg, buff1) == 0 || strcmp(arg, buff2) == 0) break; } @@ -890,7 +890,7 @@ offsets = (int *)malloc(size_offsets_max * sizeof(int)); if (offsets == NULL) { printf("** Failed to get %d bytes of memory for offsets vector\n", - size_offsets_max * sizeof(int)); + (int)(size_offsets_max * sizeof(int))); yield = 1; goto EXIT; } @@ -1852,7 +1852,7 @@ while (!done) if (offsets == NULL) { printf("** Failed to get %d bytes of memory for offsets vector\n", - size_offsets_max * sizeof(int)); + (int)(size_offsets_max * sizeof(int))); yield = 1; goto EXIT; } |