Revision: 715
http://vcs.pcre.org/viewvc?view=rev&revision=715
Author: zherczeg
Date: 2011-10-01 07:42:38 +0100 (Sat, 01 Oct 2011)
Log Message:
-----------
A fix for signed/unsigned comparison warnings reported by Visual C++ in the JIT compiler
Modified Paths:
--------------
code/trunk/pcre_jit_compile.c
code/trunk/sljit/sljitExecAllocator.c
code/trunk/sljit/sljitLir.h
code/trunk/sljit/sljitUtils.c
Modified: code/trunk/pcre_jit_compile.c
===================================================================
--- code/trunk/pcre_jit_compile.c 2011-09-28 17:40:47 UTC (rev 714)
+++ code/trunk/pcre_jit_compile.c 2011-10-01 06:42:38 UTC (rev 715)
@@ -1246,7 +1246,7 @@
/* OVECTOR(0) is never equal to SLJIT_GENERAL_REG3. */
loop = LABEL();
- OP1(SLJIT_MOVU, SLJIT_TEMPORARY_REG3, 0, SLJIT_MEM1(SLJIT_TEMPORARY_REG1), -(2 * sizeof(sljit_w)));
+ OP1(SLJIT_MOVU, SLJIT_TEMPORARY_REG3, 0, SLJIT_MEM1(SLJIT_TEMPORARY_REG1), -(2 * (sljit_w)sizeof(sljit_w)));
OP2(SLJIT_SUB, SLJIT_TEMPORARY_REG2, 0, SLJIT_TEMPORARY_REG2, 0, SLJIT_IMM, 1);
CMPTO(SLJIT_C_EQUAL, SLJIT_TEMPORARY_REG3, 0, SLJIT_GENERAL_REG3, 0, loop);
OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_TEMPORARY_REG2, 0);
@@ -2434,9 +2434,11 @@
#ifdef SUPPORT_UCP
BOOL needstype = FALSE, needsscript = FALSE, needschar = FALSE;
BOOL charsaved = FALSE;
-int typereg = TMP1, scriptreg = TMP1, typeoffset;
+int typereg = TMP1, scriptreg = TMP1;
+unsigned int typeoffset;
#endif
-int charoffset, invertcmp, numberofcmps;
+int invertcmp, numberofcmps;
+unsigned int charoffset;
/* Although SUPPORT_UTF8 must be defined, we are not necessary in utf8 mode. */
check_input_end(common, fallbacks);
Modified: code/trunk/sljit/sljitExecAllocator.c
===================================================================
--- code/trunk/sljit/sljitExecAllocator.c 2011-09-28 17:40:47 UTC (rev 714)
+++ code/trunk/sljit/sljitExecAllocator.c 2011-10-01 06:42:38 UTC (rev 715)
@@ -237,14 +237,14 @@
struct free_block* free_block;
allocator_grab_lock();
- header = AS_BLOCK_HEADER(ptr, -sizeof(struct block_header));
+ header = AS_BLOCK_HEADER(ptr, -(sljit_w)sizeof(struct block_header));
allocated_size -= header->size;
/* Connecting free blocks together if possible. */
/* If header->prev_size == 0, free_block will equal to header.
In this case, free_block->header.size will be > 0. */
- free_block = AS_FREE_BLOCK(header, -header->prev_size);
+ free_block = AS_FREE_BLOCK(header, -(sljit_w)header->prev_size);
if (SLJIT_UNLIKELY(!free_block->header.size)) {
free_block->size += header->size;
header = AS_BLOCK_HEADER(free_block, free_block->size);
Modified: code/trunk/sljit/sljitLir.h
===================================================================
--- code/trunk/sljit/sljitLir.h 2011-09-28 17:40:47 UTC (rev 714)
+++ code/trunk/sljit/sljitLir.h 2011-10-01 06:42:38 UTC (rev 715)
@@ -705,7 +705,7 @@
since the growth ratio can be added to the current limit, and sljit_stack_resize
will do all the necessary checks. The fields of the stack are not changed if
sljit_stack_resize fails. */
-sljit_w SLJIT_CALL sljit_stack_resize(struct sljit_stack* stack, sljit_w new_limit);
+sljit_w SLJIT_CALL sljit_stack_resize(struct sljit_stack* stack, sljit_uw new_limit);
#endif /* (defined SLJIT_UTIL_STACK && SLJIT_UTIL_STACK) */
Modified: code/trunk/sljit/sljitUtils.c
===================================================================
--- code/trunk/sljit/sljitUtils.c 2011-09-28 17:40:47 UTC (rev 714)
+++ code/trunk/sljit/sljitUtils.c 2011-10-01 06:42:38 UTC (rev 715)
@@ -203,10 +203,10 @@
SLJIT_FREE(stack);
}
-sljit_w SLJIT_CALL sljit_stack_resize(struct sljit_stack* stack, sljit_w new_limit)
+sljit_w SLJIT_CALL sljit_stack_resize(struct sljit_stack* stack, sljit_uw new_limit)
{
- sljit_w aligned_old_limit;
- sljit_w aligned_new_limit;
+ sljit_uw aligned_old_limit;
+ sljit_uw aligned_new_limit;
if ((new_limit > stack->max_limit) || (new_limit < stack->base))
return -1;