Skip to content

Commit cfdeeb9

Browse files
committed
Warning fixes.
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]
1 parent d4650bc commit cfdeeb9

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

jerry-core/lit/lit-literal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ lit_find_literal_by_utf8_string (const lit_utf8_byte_t *str_p, /**< a string to
129129
continue;
130130
}
131131

132-
if (!strncmp (rec_p + 1, (const char *) str_p, str_size))
132+
if (!strncmp ((const char *) (rec_p + 1), (const char *) str_p, str_size))
133133
{
134134
return lit;
135135
}

jerry-core/mem/mem-heap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ void *mem_heap_alloc_block_internal (const size_t size)
260260
}
261261
else
262262
{
263-
JERRY_ASSERT (MEM_HEAP_GET_ADDR_FROM_OFFSET (mem_heap.first.next_offset)->size > MEM_ALIGNMENT);
263+
JERRY_ASSERT (data_space_p->size > MEM_ALIGNMENT);
264264
mem_heap_free_t *const remaining_p = MEM_HEAP_GET_ADDR_FROM_OFFSET (mem_heap.first.next_offset) + 1;
265265

266266
VALGRIND_DEFINED_SPACE (remaining_p, sizeof (mem_heap_free_t));

jerry-core/mem/mem-poolman.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
/**
3838
* Node for free chunk list
3939
*/
40-
typedef struct
40+
typedef struct mem_pools_chunk
4141
{
42-
struct mem_pools_chunk_t *next_p; /* pointer to next pool chunk */
42+
struct mem_pools_chunk *next_p; /* pointer to next pool chunk */
4343
#ifndef MEM_HEAP_PTR_64
4444
uint32_t dummy; /* dummy member for alignment */
4545
#endif

jerry-core/parser/regexp/re-compiler.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ re_parse_alternative (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context
388388

389389
ECMA_TRY_CATCH (empty,
390390
re_parse_char_class (re_ctx_p->parser_ctx_p,
391-
re_append_char_class,
391+
(re_char_class_callback) re_append_char_class,
392392
re_ctx_p,
393393
&(re_ctx_p->current_token)),
394394
ret_value);
@@ -461,7 +461,7 @@ re_find_bytecode_in_cache (ecma_string_t *pattern_str_p, /**< pattern string */
461461

462462
for (*idx = 0u; *idx < RE_CACHE_SIZE; (*idx)++)
463463
{
464-
re_compiled_code_t *cached_bytecode_p = re_cache[*idx];
464+
re_compiled_code_t *cached_bytecode_p = (re_compiled_code_t *) re_cache[*idx];
465465

466466
if (cached_bytecode_p != NULL)
467467
{
@@ -472,7 +472,7 @@ re_find_bytecode_in_cache (ecma_string_t *pattern_str_p, /**< pattern string */
472472
&& ecma_compare_ecma_strings (cached_pattern_str_p, pattern_str_p))
473473
{
474474
JERRY_DDLOG ("RegExp is found in cache\n");
475-
return re_cache[*idx];
475+
return (re_compiled_code_t *) re_cache[*idx];
476476
}
477477
}
478478
else
@@ -495,13 +495,13 @@ re_cache_gc_run ()
495495
{
496496
for (uint32_t i = 0u; i < RE_CACHE_SIZE; i++)
497497
{
498-
re_compiled_code_t *cached_bytecode_p = re_cache[i];
498+
re_compiled_code_t *cached_bytecode_p = (re_compiled_code_t *) re_cache[i];
499499

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

504-
ecma_bytecode_deref (cached_bytecode_p);
504+
ecma_bytecode_deref ((ecma_compiled_code_t *) cached_bytecode_p);
505505
re_cache[i] = NULL;
506506
}
507507
}
@@ -604,7 +604,7 @@ re_compile_bytecode (re_compiled_code_t **out_bytecode_p, /**< [out] pointer to
604604

605605
if (cache_idx < RE_CACHE_SIZE)
606606
{
607-
ecma_bytecode_ref (*out_bytecode_p);
607+
ecma_bytecode_ref ((ecma_compiled_code_t *) *out_bytecode_p);
608608
re_cache[cache_idx] = *out_bytecode_p;
609609
}
610610
else

0 commit comments

Comments
 (0)