summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcre_compile.c6
-rw-r--r--pcre_dfa_exec.c4
-rw-r--r--pcre_exec.c12
-rw-r--r--pcre_fullinfo.c2
-rw-r--r--pcre_ord2utf8.c2
-rw-r--r--pcregrep.c2
-rw-r--r--pcreposix.c2
-rw-r--r--pcretest.c5
8 files changed, 18 insertions, 17 deletions
diff --git a/pcre_compile.c b/pcre_compile.c
index dbb5419..4c3d73b 100644
--- a/pcre_compile.c
+++ b/pcre_compile.c
@@ -3067,7 +3067,7 @@ if (next >= 0) switch(op_code)
}
else
#endif /* SUPPORT_UTF */
- return (c != TABLE_GET(next, cd->fcc, next)); /* Non-UTF-8 mode */
+ return (c != TABLE_GET((unsigned int)next, cd->fcc, next)); /* Non-UTF-8 mode */
/* For OP_NOT and OP_NOTI, the data is always a single-byte character. These
opcodes are not used for multi-byte characters, because they are coded using
@@ -3092,7 +3092,7 @@ if (next >= 0) switch(op_code)
}
else
#endif /* SUPPORT_UTF */
- return (c == TABLE_GET(next, cd->fcc, next)); /* Non-UTF-8 mode */
+ return (c == (int)(TABLE_GET((unsigned int)next, cd->fcc, next))); /* Non-UTF-8 mode */
/* Note that OP_DIGIT etc. are generated only when PCRE_UCP is *not* set.
When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */
@@ -4571,7 +4571,7 @@ for (;; ptr++)
#endif
{
unsigned int othercase;
- if ((othercase = UCD_OTHERCASE(c)) != c)
+ if ((int)(othercase = UCD_OTHERCASE(c)) != c)
{
*class_uchardata++ = XCL_SINGLE;
class_uchardata += PRIV(ord2utf)(othercase, class_uchardata);
diff --git a/pcre_dfa_exec.c b/pcre_dfa_exec.c
index c751a42..21d7be6 100644
--- a/pcre_dfa_exec.c
+++ b/pcre_dfa_exec.c
@@ -3209,7 +3209,7 @@ if (!anchored)
if ((re->flags & PCRE_FIRSTSET) != 0)
{
has_first_char = TRUE;
- first_char = first_char2 = re->first_char;
+ first_char = first_char2 = (pcre_uchar)(re->first_char);
if ((re->flags & PCRE_FCH_CASELESS) != 0)
{
first_char2 = TABLE_GET(first_char, md->tables + fcc_offset, first_char);
@@ -3233,7 +3233,7 @@ character" set. */
if ((re->flags & PCRE_REQCHSET) != 0)
{
has_req_char = TRUE;
- req_char = req_char2 = re->req_char;
+ req_char = req_char2 = (pcre_uchar)(re->req_char);
if ((re->flags & PCRE_RCH_CASELESS) != 0)
{
req_char2 = TABLE_GET(req_char, md->tables + fcc_offset, req_char);
diff --git a/pcre_exec.c b/pcre_exec.c
index dcab5aa..b715353 100644
--- a/pcre_exec.c
+++ b/pcre_exec.c
@@ -3508,7 +3508,7 @@ for (;;)
GETCHARINCTEST(c, eptr);
if (op == OP_NOTI) /* The caseless case */
{
- register int ch, och;
+ register unsigned int ch, och;
ch = *ecode++;
#ifdef COMPILE_PCRE8
/* ch must be < 128 if UTF is enabled. */
@@ -3654,7 +3654,7 @@ for (;;)
RRETURN(MATCH_NOMATCH);
}
GETCHARINC(d, eptr);
- if (fc == d || foc == d) RRETURN(MATCH_NOMATCH);
+ if (fc == d || (unsigned int) foc == d) RRETURN(MATCH_NOMATCH);
}
}
else
@@ -3692,7 +3692,7 @@ for (;;)
RRETURN(MATCH_NOMATCH);
}
GETCHARINC(d, eptr);
- if (fc == d || foc == d) RRETURN(MATCH_NOMATCH);
+ if (fc == d || (unsigned int)foc == d) RRETURN(MATCH_NOMATCH);
}
}
else
@@ -3735,7 +3735,7 @@ for (;;)
break;
}
GETCHARLEN(d, eptr, len);
- if (fc == d || foc == d) break;
+ if (fc == d || (unsigned int)foc == d) break;
eptr += len;
}
if (possessive) continue;
@@ -6496,7 +6496,7 @@ if (!anchored)
if ((re->flags & PCRE_FIRSTSET) != 0)
{
has_first_char = TRUE;
- first_char = first_char2 = re->first_char;
+ first_char = first_char2 = (pcre_uchar)(re->first_char);
if ((re->flags & PCRE_FCH_CASELESS) != 0)
{
first_char2 = TABLE_GET(first_char, md->fcc, first_char);
@@ -6518,7 +6518,7 @@ character" set. */
if ((re->flags & PCRE_REQCHSET) != 0)
{
has_req_char = TRUE;
- req_char = req_char2 = re->req_char;
+ req_char = req_char2 = (pcre_uchar)(re->req_char);
if ((re->flags & PCRE_RCH_CASELESS) != 0)
{
req_char2 = TABLE_GET(req_char, md->fcc, req_char);
diff --git a/pcre_fullinfo.c b/pcre_fullinfo.c
index 7bf27cd..a3d1198 100644
--- a/pcre_fullinfo.c
+++ b/pcre_fullinfo.c
@@ -148,7 +148,7 @@ switch (what)
case PCRE_INFO_MINLENGTH:
*((int *)where) =
(study != NULL && (study->flags & PCRE_STUDY_MINLEN) != 0)?
- study->minlength : -1;
+ (int)(study->minlength) : -1;
break;
case PCRE_INFO_JIT:
diff --git a/pcre_ord2utf8.c b/pcre_ord2utf8.c
index 6865e14..50fca95 100644
--- a/pcre_ord2utf8.c
+++ b/pcre_ord2utf8.c
@@ -75,7 +75,7 @@ if ((cvalue & 0xf800) == 0xd800 || cvalue >= 0x110000)
cvalue = 0xfffe;
for (i = 0; i < PRIV(utf8_table1_size); i++)
- if (cvalue <= PRIV(utf8_table1)[i]) break;
+ if ((int)cvalue <= PRIV(utf8_table1)[i]) break;
buffer += i;
for (j = i; j > 0; j--)
{
diff --git a/pcregrep.c b/pcregrep.c
index 10504be..02cfc1f 100644
--- a/pcregrep.c
+++ b/pcregrep.c
@@ -625,7 +625,7 @@ Arguments:
Returns: the number of characters read, zero at end of file
*/
-static int
+static unsigned int
read_one_line(char *buffer, int length, FILE *f)
{
int c;
diff --git a/pcreposix.c b/pcreposix.c
index 808c9da..c1a9d1c 100644
--- a/pcreposix.c
+++ b/pcreposix.c
@@ -274,7 +274,7 @@ should not happen, but we all make mistakes), return REG_BADPAT. */
if (preg->re_pcre == NULL)
{
- return (errorcode < sizeof(eint)/sizeof(const int))?
+ return (errorcode < (int)(sizeof(eint)/sizeof(const int)))?
eint[errorcode] : REG_BADPAT;
}
diff --git a/pcretest.c b/pcretest.c
index 6b733bd..d41f3f9 100644
--- a/pcretest.c
+++ b/pcretest.c
@@ -1271,7 +1271,7 @@ pcre_uint8 *here = start;
for (;;)
{
- int rlen = (int)(buffer_size - (here - buffer));
+ size_t rlen = (size_t)(buffer_size - (here - buffer));
if (rlen > 1000)
{
@@ -4293,7 +4293,8 @@ while (!done)
break;
default:
- if (count < 0 && (-count) < sizeof(errtexts)/sizeof(const char *))
+ if (count < 0 &&
+ (-count) < (int)(sizeof(errtexts)/sizeof(const char *)))
fprintf(outfile, "Error %d (%s)\n", count, errtexts[-count]);
else
fprintf(outfile, "Error %d (Unexpected value)\n", count);