diff options
author | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2011-10-01 06:42:38 +0000 |
---|---|---|
committer | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2011-10-01 06:42:38 +0000 |
commit | b77d63d3165d1678324a4bf4531fb881103f6012 (patch) | |
tree | 40173eb87abf322c5597627ba012ed81bc393668 | |
parent | 34a1e623a83919f8bc9cea44418862a979142fdf (diff) | |
download | pcre-b77d63d3165d1678324a4bf4531fb881103f6012.tar.gz |
A fix for signed/unsigned comparison warnings reported by Visual C++ in the JIT compiler
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@715 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | pcre_jit_compile.c | 8 | ||||
-rw-r--r-- | sljit/sljitExecAllocator.c | 4 | ||||
-rw-r--r-- | sljit/sljitLir.h | 2 | ||||
-rw-r--r-- | sljit/sljitUtils.c | 6 |
4 files changed, 11 insertions, 9 deletions
diff --git a/pcre_jit_compile.c b/pcre_jit_compile.c index ddbeaf1..42e5978 100644 --- a/pcre_jit_compile.c +++ b/pcre_jit_compile.c @@ -1246,7 +1246,7 @@ if (topbracket > 1) /* 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 @@ uschar *ccbegin; #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); diff --git a/sljit/sljitExecAllocator.c b/sljit/sljitExecAllocator.c index fecdb29..f3567b2 100644 --- a/sljit/sljitExecAllocator.c +++ b/sljit/sljitExecAllocator.c @@ -237,14 +237,14 @@ void sljit_free_exec(void* ptr) 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); diff --git a/sljit/sljitLir.h b/sljit/sljitLir.h index 6e26d06..ddf775f 100644 --- a/sljit/sljitLir.h +++ b/sljit/sljitLir.h @@ -705,7 +705,7 @@ void SLJIT_CALL sljit_free_stack(struct sljit_stack* stack); 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) */ diff --git a/sljit/sljitUtils.c b/sljit/sljitUtils.c index 13904b8..6656bf4 100644 --- a/sljit/sljitUtils.c +++ b/sljit/sljitUtils.c @@ -203,10 +203,10 @@ void SLJIT_CALL sljit_free_stack(struct sljit_stack* stack) 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; |