diff --git a/jerry-core/ecma/base/ecma-globals.h b/jerry-core/ecma/base/ecma-globals.h index 32490c719..e11c3bcbe 100644 --- a/jerry-core/ecma/base/ecma-globals.h +++ b/jerry-core/ecma/base/ecma-globals.h @@ -567,7 +567,7 @@ typedef struct * Description of an ecma-number */ typedef float ecma_number_t; -#define DOUBLE_TO_ECMA_NUMBER_T(value) static_cast (value) +#define DOUBLE_TO_ECMA_NUMBER_T(value) (ecma_number_t) (value) /** * Maximum number of significant digits that ecma-number can store diff --git a/jerry-core/jerry.cpp b/jerry-core/jerry.cpp index 343a9b60b..5c7668bfd 100644 --- a/jerry-core/jerry.cpp +++ b/jerry-core/jerry.cpp @@ -460,7 +460,7 @@ jerry_api_convert_api_value_to_ecma_value (ecma_value_t *out_value_p, /**< out: case JERRY_API_DATA_TYPE_FLOAT32: { ecma_number_t *num = ecma_alloc_number (); - *num = static_cast (api_value_p->v_float32); + *num = (ecma_number_t) (api_value_p->v_float32); *out_value_p = ecma_make_number_value (num); @@ -469,7 +469,7 @@ jerry_api_convert_api_value_to_ecma_value (ecma_value_t *out_value_p, /**< out: case JERRY_API_DATA_TYPE_FLOAT64: { ecma_number_t *num = ecma_alloc_number (); - *num = static_cast (api_value_p->v_float64); + *num = (ecma_number_t) (api_value_p->v_float64); *out_value_p = ecma_make_number_value (num); @@ -478,7 +478,7 @@ jerry_api_convert_api_value_to_ecma_value (ecma_value_t *out_value_p, /**< out: case JERRY_API_DATA_TYPE_UINT32: { ecma_number_t *num = ecma_alloc_number (); - *num = static_cast (api_value_p->v_uint32); + *num = (ecma_number_t) (api_value_p->v_uint32); *out_value_p = ecma_make_number_value (num); diff --git a/jerry-core/mem/mem-allocator.h b/jerry-core/mem/mem-allocator.h index 3cc8c8736..65bbab645 100644 --- a/jerry-core/mem/mem-allocator.h +++ b/jerry-core/mem/mem-allocator.h @@ -77,7 +77,7 @@ typedef void (*mem_try_give_memory_back_callback_t) (mem_try_give_memory_back_se * Get value of pointer from specified non-null compressed pointer value */ #define MEM_CP_GET_NON_NULL_POINTER(type, cp_value) \ - (static_cast (mem_decompress_pointer (cp_value))) + ((type *) (mem_decompress_pointer (cp_value))) /** * Get value of pointer from specified compressed pointer value diff --git a/jerry-core/mem/mem-heap.h b/jerry-core/mem/mem-heap.h index 72c67dfce..d70231a48 100644 --- a/jerry-core/mem/mem-heap.h +++ b/jerry-core/mem/mem-heap.h @@ -110,7 +110,7 @@ extern void mem_heap_valgrind_freya_mempool_request (void); #define MEM_DEFINE_LOCAL_ARRAY(var_name, number, type) \ { \ size_t var_name ## ___size = (size_t) (number) * sizeof (type); \ - type *var_name = static_cast (mem_heap_alloc_block (var_name ## ___size, MEM_HEAP_ALLOC_SHORT_TERM)); + type *var_name = (type *) (mem_heap_alloc_block (var_name ## ___size, MEM_HEAP_ALLOC_SHORT_TERM)); /** * Free the previously defined local array variable, freeing corresponding block on the heap, diff --git a/jerry-core/parser/regexp/re-compiler.cpp b/jerry-core/parser/regexp/re-compiler.cpp index 8ccf227f1..5c50cc8f3 100644 --- a/jerry-core/parser/regexp/re-compiler.cpp +++ b/jerry-core/parser/regexp/re-compiler.cpp @@ -61,7 +61,7 @@ static uint8_t * re_realloc_regexp_bytecode_block (re_bytecode_ctx_t *bc_ctx_p) /**< RegExp bytecode context */ { JERRY_ASSERT (bc_ctx_p->block_end_p - bc_ctx_p->block_start_p >= 0); - size_t old_size = static_cast (bc_ctx_p->block_end_p - bc_ctx_p->block_start_p); + size_t old_size = (size_t) (bc_ctx_p->block_end_p - bc_ctx_p->block_start_p); /* If one of the members of RegExp bytecode context is NULL, then all member should be NULL * (it means first allocation), otherwise all of the members should be a non NULL pointer. */ @@ -70,13 +70,13 @@ re_realloc_regexp_bytecode_block (re_bytecode_ctx_t *bc_ctx_p) /**< RegExp bytec size_t new_block_size = old_size + REGEXP_BYTECODE_BLOCK_SIZE; JERRY_ASSERT (bc_ctx_p->current_p - bc_ctx_p->block_start_p >= 0); - size_t current_ptr_offset = static_cast (bc_ctx_p->current_p - bc_ctx_p->block_start_p); + size_t current_ptr_offset = (size_t) (bc_ctx_p->current_p - bc_ctx_p->block_start_p); uint8_t *new_block_start_p = (uint8_t *) mem_heap_alloc_block (new_block_size, MEM_HEAP_ALLOC_SHORT_TERM); if (bc_ctx_p->current_p) { - memcpy (new_block_start_p, bc_ctx_p->block_start_p, static_cast (current_ptr_offset)); + memcpy (new_block_start_p, bc_ctx_p->block_start_p, (size_t) (current_ptr_offset)); mem_heap_free_block (bc_ctx_p->block_start_p); } bc_ctx_p->block_start_p = new_block_start_p; diff --git a/targets/esp8266/include/jerry_extapi.h b/targets/esp8266/include/jerry_extapi.h index 77b73dade..f10d527fd 100644 --- a/targets/esp8266/include/jerry_extapi.h +++ b/targets/esp8266/include/jerry_extapi.h @@ -28,10 +28,10 @@ #define JS_VALUE_TO_NUMBER(val_p) \ ((val_p)->type == JERRY_API_DATA_TYPE_FLOAT32 ? \ - static_cast((val_p)->v_float32) : \ + (double) ((val_p)->v_float32) : \ (val_p)->type == JERRY_API_DATA_TYPE_FLOAT64 ? \ - static_cast((val_p)->v_float64) : \ - static_cast((val_p)->v_uint32)) + (double) ((val_p)->v_float64) : \ + (double) ((val_p)->v_uint32)) #ifdef __cplusplus diff --git a/targets/mbedk64f/source/jerry_extapi.h b/targets/mbedk64f/source/jerry_extapi.h index 2b8ac46c7..faa921812 100644 --- a/targets/mbedk64f/source/jerry_extapi.h +++ b/targets/mbedk64f/source/jerry_extapi.h @@ -30,10 +30,10 @@ #define JS_VALUE_TO_NUMBER(val_p) \ ((val_p)->type == JERRY_API_DATA_TYPE_FLOAT32 ? \ - static_cast((val_p)->v_float32) : \ + (double) ((val_p)->v_float32) : \ (val_p)->type == JERRY_API_DATA_TYPE_FLOAT64 ? \ - static_cast((val_p)->v_float64) : \ - static_cast((val_p)->v_uint32)) + (double) ((val_p)->v_float64) : \ + (double) ((val_p)->v_uint32)) void js_register_functions (void);