[Pcre-svn] [516] code/trunk: Minor refactor to avoid "left s…

Inizio della pagina
Delete this message
Autore: Subversion repository
Data:  
To: pcre-svn
Oggetto: [Pcre-svn] [516] code/trunk: Minor refactor to avoid "left shift of negative number" warning.
Revision: 516
          http://www.exim.org/viewvc/pcre2?view=rev&revision=516
Author:   ph10
Date:     2016-05-21 14:41:24 +0100 (Sat, 21 May 2016)
Log Message:
-----------
Minor refactor to avoid "left shift of negative number" warning.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/src/pcre2_jit_compile.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2016-05-20 10:47:42 UTC (rev 515)
+++ code/trunk/ChangeLog    2016-05-21 13:41:24 UTC (rev 516)
@@ -111,6 +111,7 @@
 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

Modified: code/trunk/src/pcre2_jit_compile.c
===================================================================
--- code/trunk/src/pcre2_jit_compile.c    2016-05-20 10:47:42 UTC (rev 515)
+++ code/trunk/src/pcre2_jit_compile.c    2016-05-21 13:41:24 UTC (rev 516)
@@ -539,12 +539,12 @@
 #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