diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-01-23 17:30:49 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-01-23 17:30:49 +0000 |
commit | 6d006dba3ccf59347e2eec0b2d60f6d4a1254a33 (patch) | |
tree | a7e364bd593a3a7e3a43b38697836ff8b1a87e7f | |
parent | ec7abfc6da4749a0deda01d514b353a43bdf39db (diff) | |
download | pcre-6d006dba3ccf59347e2eec0b2d60f6d4a1254a33.tar.gz |
Additional casts to avoid compiler warnings, originally from a MS compiler, but
also given by gcc if you turn on enough warnings.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@904 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | pcre_compile.c | 6 | ||||
-rw-r--r-- | pcre_dfa_exec.c | 4 | ||||
-rw-r--r-- | pcre_exec.c | 12 | ||||
-rw-r--r-- | pcre_fullinfo.c | 2 | ||||
-rw-r--r-- | pcre_ord2utf8.c | 2 | ||||
-rw-r--r-- | pcregrep.c | 2 | ||||
-rw-r--r-- | pcreposix.c | 2 | ||||
-rw-r--r-- | pcretest.c | 5 |
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--) { @@ -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; } @@ -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); |