summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2016-05-21 13:41:24 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2016-05-21 13:41:24 +0000
commit21af07971a8002b36894dcada0d59d5e4edd05a0 (patch)
treefd70a790bfbd7d1c1a9c0a8db522b2b2da4faa05
parent15ab7c4b287ea6f617f04e9396a00bd90fb22b05 (diff)
downloadpcre2-21af07971a8002b36894dcada0d59d5e4edd05a0.tar.gz
Minor refactor to avoid "left shift of negative number" warning.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@516 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r--ChangeLog1
-rw-r--r--src/pcre2_jit_compile.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 87ceb27..f7e74ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -111,6 +111,7 @@ been re-factored and no longer includes pcre2_internal.h.
26. Minor code refactor to avoid "array subscript is below array bounds"
compiler warning.
+27. Minor code refactor to avoid "left shift of negative number" warning.
Version 10.21 12-January-2016
diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
index 3927d2c..5349475 100644
--- a/src/pcre2_jit_compile.c
+++ b/src/pcre2_jit_compile.c
@@ -539,12 +539,12 @@ the start pointers when the end of the capturing group has not yet reached. */
#define MOV_UCHAR SLJIT_MOV_U16
#define MOVU_UCHAR SLJIT_MOVU_U16
#define UCHAR_SHIFT (1)
-#define IN_UCHARS(x) ((x) << UCHAR_SHIFT)
+#define IN_UCHARS(x) ((x) * 2)
#elif PCRE2_CODE_UNIT_WIDTH == 32
#define MOV_UCHAR SLJIT_MOV_U32
#define MOVU_UCHAR SLJIT_MOVU_U32
#define UCHAR_SHIFT (2)
-#define IN_UCHARS(x) ((x) << UCHAR_SHIFT)
+#define IN_UCHARS(x) ((x) * 4)
#else
#error Unsupported compiling mode
#endif