aboutsummaryrefslogtreecommitdiff
path: root/jerry-core
diff options
context:
space:
mode:
authorRoland Takacs <rtakacs.u-szeged@partner.samsung.com>2016-02-02 16:13:17 +0100
committerLászló Langó <llango.u-szeged@partner.samsung.com>2016-02-05 12:59:14 +0100
commitefc994b112e30cd0a20f8a2365ea94c84bec0eec (patch)
tree5909f823baf8d7dd6e459cbdbdddd3f43aabc712 /jerry-core
parent764d74561d3ba3b9254acac4d13e0ab56e5b1900 (diff)
Use C type casting instead of static_cast.
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
Diffstat (limited to 'jerry-core')
-rw-r--r--jerry-core/ecma/base/ecma-globals.h2
-rw-r--r--jerry-core/jerry.cpp6
-rw-r--r--jerry-core/mem/mem-allocator.h2
-rw-r--r--jerry-core/mem/mem-heap.h2
-rw-r--r--jerry-core/parser/regexp/re-compiler.cpp6
5 files changed, 9 insertions, 9 deletions
diff --git a/jerry-core/ecma/base/ecma-globals.h b/jerry-core/ecma/base/ecma-globals.h
index 32490c71..e11c3bcb 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<ecma_number_t> (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 343a9b60..5c7668bf 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<ecma_number_t> (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<ecma_number_t> (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<ecma_number_t> (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 3cc8c873..65bbab64 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<type *> (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 72c67dfc..d70231a4 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 <type *> (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 8ccf227f..5c50cc8f 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<size_t> (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<size_t> (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<size_t> (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;