From c6ac8d592b04f6f23b73f65a7de4502125d45e63 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Thu, 31 May 2007 15:34:21 +0000 Subject: [PATCH] 2007-05-31 17:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/common.mak ! added PCRE_LIB * harbour/bin/hb-func.sh ! fixed typo in last commit * harbour/source/hbpcre/pcredfa.c * harbour/source/hbpcre/pcreexec.c * harbour/source/hbpcre/pcrefind.c * harbour/source/hbpcre/pcreprni.c * harbour/source/hbpcre/pcrestud.c * harbour/source/hbpcre/pcretryf.c * cleaned some warnings --- harbour/ChangeLog | 15 +++++++++++++++ harbour/bin/hb-func.sh | 2 +- harbour/common.mak | 2 ++ harbour/source/hbpcre/ChangeLog | 9 +++++++++ harbour/source/hbpcre/pcredfa.c | 6 ------ harbour/source/hbpcre/pcreexec.c | 3 ++- harbour/source/hbpcre/pcrefind.c | 8 -------- harbour/source/hbpcre/pcreprni.c | 2 -- harbour/source/hbpcre/pcrestud.c | 2 +- harbour/source/hbpcre/pcretryf.c | 2 +- 10 files changed, 31 insertions(+), 20 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 464a61cd98..d4f10f291b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,21 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-05-31 17:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/common.mak + ! added PCRE_LIB + + * harbour/bin/hb-func.sh + ! fixed typo in last commit + + * harbour/source/hbpcre/pcredfa.c + * harbour/source/hbpcre/pcreexec.c + * harbour/source/hbpcre/pcrefind.c + * harbour/source/hbpcre/pcreprni.c + * harbour/source/hbpcre/pcrestud.c + * harbour/source/hbpcre/pcretryf.c + * cleaned some warnings + 2007-05-31 15:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/common.mak * harbour/makefile.bc diff --git a/harbour/bin/hb-func.sh b/harbour/bin/hb-func.sh index ffdeb31786..78c901a45b 100644 --- a/harbour/bin/hb-func.sh +++ b/harbour/bin/hb-func.sh @@ -121,7 +121,7 @@ mk_hbtools() if [ "${C_USR//-DHB_PCRE_REGEX/}" != "${C_USR}" ]; then HB_SYS_LIBS="-lpcre ${HB_SYS_LIBS}" hb_libs="${hb_libs//hbpcre/}" - elif [ "${C_USR//-DHB_POSIX_REGEX/}" = "${C_USR}" ]; then + elif [ "${C_USR//-DHB_POSIX_REGEX/}" != "${C_USR}" ]; then hb_libs="${hb_libs//hbpcre/}" fi if [ "${HB_COMPILER}" = "mingw32" ]; then diff --git a/harbour/common.mak b/harbour/common.mak index 3390c75200..945e375d66 100644 --- a/harbour/common.mak +++ b/harbour/common.mak @@ -142,6 +142,7 @@ MACRO_LIB = $(LIB_DIR)\macro.lib DEBUG_LIB = $(LIB_DIR)\debug.lib LANG_LIB = $(LIB_DIR)\lang.lib CODEPAGE_LIB = $(LIB_DIR)\codepage.lib +PCRE_LIB = $(LIB_DIR)\pcre.lib RDD_LIB = $(LIB_DIR)\rdd.lib NULSYS_LIB = $(LIB_DIR)\nulsys.lib DBFNTX_LIB = $(LIB_DIR)\dbfntx.lib @@ -965,6 +966,7 @@ HB_BUILD_TARGETS = \ $(DEBUG_LIB) \ $(LANG_LIB) \ $(CODEPAGE_LIB) \ + $(PCRE_LIB) \ $(RDD_LIB) \ $(NULSYS_LIB) \ $(DBFNTX_LIB) \ diff --git a/harbour/source/hbpcre/ChangeLog b/harbour/source/hbpcre/ChangeLog index 17300c0761..1d7d1b9394 100644 --- a/harbour/source/hbpcre/ChangeLog +++ b/harbour/source/hbpcre/ChangeLog @@ -18,6 +18,15 @@ * */ +2007-05-31 17:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/hbpcre/pcredfa.c + * harbour/source/hbpcre/pcreexec.c + * harbour/source/hbpcre/pcrefind.c + * harbour/source/hbpcre/pcreprni.c + * harbour/source/hbpcre/pcrestud.c + * harbour/source/hbpcre/pcretryf.c + * cleaned some warnings + 2007-05-31 15:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * initial upload to Harbour CVS * filenames changed to keep 8.3 DOS format diff --git a/harbour/source/hbpcre/pcredfa.c b/harbour/source/hbpcre/pcredfa.c index ba394a4bd2..e87e2a1f67 100644 --- a/harbour/source/hbpcre/pcredfa.c +++ b/harbour/source/hbpcre/pcredfa.c @@ -1578,12 +1578,6 @@ for (;;) ptr += clen; /* Advance to next subject character */ } /* Loop to move along the subject string */ - -/* Control never gets here, but we must keep the compiler happy. */ - -DPRINTF(("%.*s+++ Unexpected end of internal_dfa_exec %d +++\n" - "%.*s---------------------\n\n", rlevel*2-2, SP, rlevel, rlevel*2-2, SP)); -return PCRE_ERROR_NOMATCH; } diff --git a/harbour/source/hbpcre/pcreexec.c b/harbour/source/hbpcre/pcreexec.c index 6eebb49d8e..e38b06b705 100644 --- a/harbour/source/hbpcre/pcreexec.c +++ b/harbour/source/hbpcre/pcreexec.c @@ -1798,6 +1798,7 @@ for (;;) length = 1; ecode++; GETCHARLEN(fc, ecode, length); + ( void ) fc; if (length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); while (length-- > 0) if (*ecode++ != *eptr++) RRETURN(MATCH_NOMATCH); } @@ -3209,7 +3210,7 @@ int rc, resetcount, ocount; int first_byte = -1; int req_byte = -1; int req_byte2 = -1; -unsigned long int ims = 0; +unsigned long int ims; BOOL using_temporary_offsets = FALSE; BOOL anchored; BOOL startline; diff --git a/harbour/source/hbpcre/pcrefind.c b/harbour/source/hbpcre/pcrefind.c index f1d5679818..c9e37dbe01 100644 --- a/harbour/source/hbpcre/pcrefind.c +++ b/harbour/source/hbpcre/pcrefind.c @@ -101,7 +101,6 @@ switch ((*type_ptr = ((node->f0 & f0_typemask) >> f0_typeshift))) case ucp_Co: case ucp_Cs: return ucp_C; - break; case ucp_Ll: case ucp_Lu: @@ -115,19 +114,16 @@ switch ((*type_ptr = ((node->f0 & f0_typemask) >> f0_typeshift))) case ucp_Lt: *case_ptr = 0; return ucp_L; - break; case ucp_Mc: case ucp_Me: case ucp_Mn: return ucp_M; - break; case ucp_Nd: case ucp_Nl: case ucp_No: return ucp_N; - break; case ucp_Pc: case ucp_Pd: @@ -137,24 +133,20 @@ switch ((*type_ptr = ((node->f0 & f0_typemask) >> f0_typeshift))) case ucp_Ps: case ucp_Po: return ucp_P; - break; case ucp_Sc: case ucp_Sk: case ucp_Sm: case ucp_So: return ucp_S; - break; case ucp_Zl: case ucp_Zp: case ucp_Zs: return ucp_Z; - break; default: /* "Should never happen" */ return -1; - break; } } diff --git a/harbour/source/hbpcre/pcreprni.c b/harbour/source/hbpcre/pcreprni.c index f4c53d37ec..e8386210cf 100644 --- a/harbour/source/hbpcre/pcreprni.c +++ b/harbour/source/hbpcre/pcreprni.c @@ -188,7 +188,6 @@ for(;;) fprintf(f, "\n"); continue; } - break; case OP_CHARNC: { @@ -202,7 +201,6 @@ for(;;) fprintf(f, "\n"); continue; } - break; case OP_KETRMAX: case OP_KETRMIN: diff --git a/harbour/source/hbpcre/pcrestud.c b/harbour/source/hbpcre/pcrestud.c index e4e6535292..a8a78f4423 100644 --- a/harbour/source/hbpcre/pcrestud.c +++ b/harbour/source/hbpcre/pcrestud.c @@ -159,7 +159,7 @@ do case OP_BRAMINZERO: if (!set_start_bits(++tcode, start_bits, caseless, utf8, cd)) return FALSE; - dummy = 1; + dummy = 1; (void)dummy; do tcode += GET(tcode,1); while (*tcode == OP_ALT); tcode += 1+LINK_SIZE; break; diff --git a/harbour/source/hbpcre/pcretryf.c b/harbour/source/hbpcre/pcretryf.c index 1dde37521a..9fbb15a8f8 100644 --- a/harbour/source/hbpcre/pcretryf.c +++ b/harbour/source/hbpcre/pcretryf.c @@ -98,7 +98,7 @@ EXPORT real_pcre * _pcre_try_flipped(const real_pcre *re, real_pcre *internal_re, const pcre_study_data *study, pcre_study_data *internal_study) { -if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER) +if ((unsigned long) byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER) return NULL; *internal_re = *re; /* To copy other fields */