summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2016-05-21 13:34:44 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2016-05-21 13:34:44 +0000
commit5e10ce8642fc9e4862d0717a8171c7b6483befea (patch)
tree6b9ed021799cecdd55a462652c568b820a58ea40
parent166adb37b3b516b4a629030ef39f1b5da32bc185 (diff)
downloadpcre-5e10ce8642fc9e4862d0717a8171c7b6483befea.tar.gz
Minor refactor to avoid "left shift of negative value" warning.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1649 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog4
-rw-r--r--pcre_internal.h4
2 files changed, 5 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c2c3921..fc32ecf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -82,7 +82,9 @@ Version 8.39 xx-xxxxxx-201x
20. A racing condition is fixed in JIT reported by Mozilla.
21. Minor code refactor to avoid "array subscript is below array bounds"
-compiler warning.
+ compiler warning.
+
+22. Minor code refactor to avoid "left shift of negative number" warning.
Version 8.38 23-November-2015
diff --git a/pcre_internal.h b/pcre_internal.h
index dbfe80e..2923b29 100644
--- a/pcre_internal.h
+++ b/pcre_internal.h
@@ -275,7 +275,7 @@ pcre.h(.in) and disable (comment out) this message. */
typedef pcre_uint16 pcre_uchar;
#define UCHAR_SHIFT (1)
-#define IN_UCHARS(x) ((x) << UCHAR_SHIFT)
+#define IN_UCHARS(x) ((x) * 2)
#define MAX_255(c) ((c) <= 255u)
#define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))
@@ -283,7 +283,7 @@ typedef pcre_uint16 pcre_uchar;
typedef pcre_uint32 pcre_uchar;
#define UCHAR_SHIFT (2)
-#define IN_UCHARS(x) ((x) << UCHAR_SHIFT)
+#define IN_UCHARS(x) ((x) * 4)
#define MAX_255(c) ((c) <= 255u)
#define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))