Skip to content

Commit

Permalink
Warning fixes.
Browse files Browse the repository at this point in the history
Passing argument 1 of ‘strncmp’ from incompatible pointer type.
Assignments from incompatible pointer types.
Passing argument or initialization discards ‘const’ qualifier from pointer target type.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka [email protected]
  • Loading branch information
robertsipka committed Mar 7, 2016
1 parent d4650bc commit cfdeeb9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion jerry-core/lit/lit-literal.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ lit_find_literal_by_utf8_string (const lit_utf8_byte_t *str_p, /**< a string to
continue;
}

if (!strncmp (rec_p + 1, (const char *) str_p, str_size))
if (!strncmp ((const char *) (rec_p + 1), (const char *) str_p, str_size))
{
return lit;
}
Expand Down
2 changes: 1 addition & 1 deletion jerry-core/mem/mem-heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void *mem_heap_alloc_block_internal (const size_t size)
}
else
{
JERRY_ASSERT (MEM_HEAP_GET_ADDR_FROM_OFFSET (mem_heap.first.next_offset)->size > MEM_ALIGNMENT);
JERRY_ASSERT (data_space_p->size > MEM_ALIGNMENT);
mem_heap_free_t *const remaining_p = MEM_HEAP_GET_ADDR_FROM_OFFSET (mem_heap.first.next_offset) + 1;

VALGRIND_DEFINED_SPACE (remaining_p, sizeof (mem_heap_free_t));
Expand Down
4 changes: 2 additions & 2 deletions jerry-core/mem/mem-poolman.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
/**
* Node for free chunk list
*/
typedef struct
typedef struct mem_pools_chunk
{
struct mem_pools_chunk_t *next_p; /* pointer to next pool chunk */
struct mem_pools_chunk *next_p; /* pointer to next pool chunk */
#ifndef MEM_HEAP_PTR_64
uint32_t dummy; /* dummy member for alignment */
#endif
Expand Down
12 changes: 6 additions & 6 deletions jerry-core/parser/regexp/re-compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ re_parse_alternative (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context

ECMA_TRY_CATCH (empty,
re_parse_char_class (re_ctx_p->parser_ctx_p,
re_append_char_class,
(re_char_class_callback) re_append_char_class,
re_ctx_p,
&(re_ctx_p->current_token)),
ret_value);
Expand Down Expand Up @@ -461,7 +461,7 @@ re_find_bytecode_in_cache (ecma_string_t *pattern_str_p, /**< pattern string */

for (*idx = 0u; *idx < RE_CACHE_SIZE; (*idx)++)
{
re_compiled_code_t *cached_bytecode_p = re_cache[*idx];
re_compiled_code_t *cached_bytecode_p = (re_compiled_code_t *) re_cache[*idx];

if (cached_bytecode_p != NULL)
{
Expand All @@ -472,7 +472,7 @@ re_find_bytecode_in_cache (ecma_string_t *pattern_str_p, /**< pattern string */
&& ecma_compare_ecma_strings (cached_pattern_str_p, pattern_str_p))
{
JERRY_DDLOG ("RegExp is found in cache\n");
return re_cache[*idx];
return (re_compiled_code_t *) re_cache[*idx];
}
}
else
Expand All @@ -495,13 +495,13 @@ re_cache_gc_run ()
{
for (uint32_t i = 0u; i < RE_CACHE_SIZE; i++)
{
re_compiled_code_t *cached_bytecode_p = re_cache[i];
re_compiled_code_t *cached_bytecode_p = (re_compiled_code_t *) re_cache[i];

if (cached_bytecode_p != NULL
&& (cached_bytecode_p->flags >> ECMA_BYTECODE_REF_SHIFT) == 1)
{ /* Only the cache has reference for the bytecode */

ecma_bytecode_deref (cached_bytecode_p);
ecma_bytecode_deref ((ecma_compiled_code_t *) cached_bytecode_p);
re_cache[i] = NULL;
}
}
Expand Down Expand Up @@ -604,7 +604,7 @@ re_compile_bytecode (re_compiled_code_t **out_bytecode_p, /**< [out] pointer to

if (cache_idx < RE_CACHE_SIZE)
{
ecma_bytecode_ref (*out_bytecode_p);
ecma_bytecode_ref ((ecma_compiled_code_t *) *out_bytecode_p);
re_cache[cache_idx] = *out_bytecode_p;
}
else
Expand Down

0 comments on commit cfdeeb9

Please sign in to comment.