diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2014-05-21 17:53:49 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2014-05-21 17:53:49 +0000 |
commit | e540eaeb9acd54da2aee46fe9fbf02537b150e86 (patch) | |
tree | f9a5a455f0b317a2095881915d043e56689c029a | |
parent | 3186c9f8300387544ece2faee4c2d6076c0356e8 (diff) | |
download | pcre-e540eaeb9acd54da2aee46fe9fbf02537b150e86.tar.gz |
Casts and type changes for compiler warnings.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1477 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | pcre_compile.c | 12 | ||||
-rw-r--r-- | pcre_dfa_exec.c | 2 | ||||
-rw-r--r-- | pcre_exec.c | 2 |
4 files changed, 11 insertions, 8 deletions
@@ -22,6 +22,9 @@ Version 8.36 xx-xxx-2014 5. Fixed an issue, which occures when nested alternatives are optimized with table jumps. + +6. Inserted two casts and changed some ints to size_t in the light of some + reported 64-bit compiler warnings (Bugzilla 1477). Version 8.35 04-April-2014 diff --git a/pcre_compile.c b/pcre_compile.c index ae0027b..5386fd9 100644 --- a/pcre_compile.c +++ b/pcre_compile.c @@ -3035,7 +3035,7 @@ switch(c) end += 1 + 2 * IMM2_SIZE; break; } - list[2] = end - code; + list[2] = (pcre_uint32)(end - code); return end; } return NULL; /* Opcode not accepted */ @@ -4860,7 +4860,7 @@ for (;; ptr++) if (lengthptr != NULL && class_uchardata > class_uchardata_base) { xclass = TRUE; - *lengthptr += class_uchardata - class_uchardata_base; + *lengthptr += (int)(class_uchardata - class_uchardata_base); class_uchardata = class_uchardata_base; } #endif @@ -6005,8 +6005,8 @@ for (;; ptr++) while (cd->hwm > cd->start_workspace + cd->workspace_size - WORK_SIZE_SAFETY_MARGIN - (this_hwm - save_hwm)) { - int save_offset = save_hwm - cd->start_workspace; - int this_offset = this_hwm - cd->start_workspace; + size_t save_offset = save_hwm - cd->start_workspace; + size_t this_offset = this_hwm - cd->start_workspace; *errorcodeptr = expand_workspace(cd); if (*errorcodeptr != 0) goto FAILED; save_hwm = (pcre_uchar *)cd->start_workspace + save_offset; @@ -6087,8 +6087,8 @@ for (;; ptr++) while (cd->hwm > cd->start_workspace + cd->workspace_size - WORK_SIZE_SAFETY_MARGIN - (this_hwm - save_hwm)) { - int save_offset = save_hwm - cd->start_workspace; - int this_offset = this_hwm - cd->start_workspace; + size_t save_offset = save_hwm - cd->start_workspace; + size_t this_offset = this_hwm - cd->start_workspace; *errorcodeptr = expand_workspace(cd); if (*errorcodeptr != 0) goto FAILED; save_hwm = (pcre_uchar *)cd->start_workspace + save_offset; diff --git a/pcre_dfa_exec.c b/pcre_dfa_exec.c index fb0c7e8..87f4aef 100644 --- a/pcre_dfa_exec.c +++ b/pcre_dfa_exec.c @@ -3242,7 +3242,7 @@ md->callout_data = NULL; if (extra_data != NULL) { - unsigned int flags = extra_data->flags; + unsigned long int flags = extra_data->flags; if ((flags & PCRE_EXTRA_STUDY_DATA) != 0) study = (const pcre_study_data *)extra_data->study_data; if ((flags & PCRE_EXTRA_MATCH_LIMIT) != 0) return PCRE_ERROR_DFA_UMLIMIT; diff --git a/pcre_exec.c b/pcre_exec.c index 9bb17f7..55952dc 100644 --- a/pcre_exec.c +++ b/pcre_exec.c @@ -6490,7 +6490,7 @@ tables = re->tables; if (extra_data != NULL) { - register unsigned int flags = extra_data->flags; + unsigned long int flags = extra_data->flags; if ((flags & PCRE_EXTRA_STUDY_DATA) != 0) study = (const pcre_study_data *)extra_data->study_data; if ((flags & PCRE_EXTRA_MATCH_LIMIT) != 0) |