diff options
author | László Langó <llango.u-szeged@partner.samsung.com> | 2016-02-17 14:59:36 +0000 |
---|---|---|
committer | László Langó <llango.u-szeged@partner.samsung.com> | 2016-02-18 13:27:54 +0000 |
commit | a7715a5d78dd5e685c61dedf77b55368bdd0a570 (patch) | |
tree | b54a8d0aa7ea994fa5b2984b51a4eff33046b01e | |
parent | db26cb2b79410f64c3fd31e8f4607c38e08fd15a (diff) |
Fix style issues and improve vera++ rules.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
35 files changed, 232 insertions, 172 deletions
diff --git a/jerry-core/ecma/base/ecma-alloc.c b/jerry-core/ecma/base/ecma-alloc.c index d28c2a29..05748b3a 100644 --- a/jerry-core/ecma/base/ecma-alloc.c +++ b/jerry-core/ecma/base/ecma-alloc.c @@ -69,7 +69,7 @@ JERRY_STATIC_ASSERT (sizeof (ecma_getter_setter_pointers_t) <= sizeof (uint64_t) #define DEALLOC(ecma_type) void \ ecma_dealloc_ ## ecma_type (ecma_ ## ecma_type ## _t *p ## ecma_type) \ { \ - mem_pools_free ((uint8_t*) p ## ecma_type); \ + mem_pools_free ((uint8_t *) p ## ecma_type); \ } /** diff --git a/jerry-core/ecma/base/ecma-gc.c b/jerry-core/ecma/base/ecma-gc.c index a993feee..49fdaa59 100644 --- a/jerry-core/ecma/base/ecma-gc.c +++ b/jerry-core/ecma/base/ecma-gc.c @@ -117,7 +117,7 @@ ecma_gc_set_object_refs (ecma_object_t *object_p, /**< object */ /** * Get next object in list of objects with same generation. */ -static ecma_object_t* +static ecma_object_t * ecma_gc_get_object_next (ecma_object_t *object_p) /**< object */ { JERRY_ASSERT (object_p != NULL); diff --git a/jerry-core/ecma/base/ecma-globals.h b/jerry-core/ecma/base/ecma-globals.h index be9d57e7..4c5276ef 100644 --- a/jerry-core/ecma/base/ecma-globals.h +++ b/jerry-core/ecma/base/ecma-globals.h @@ -592,54 +592,54 @@ typedef double ecma_number_t; * * See also: ECMA_262 v5, 15.7.3.2 */ -# define ECMA_NUMBER_MAX_VALUE ((ecma_number_t)1.7976931348623157e+308) +# define ECMA_NUMBER_MAX_VALUE ((ecma_number_t) 1.7976931348623157e+308) /** * Number.MIN_VALUE * * See also: ECMA_262 v5, 15.7.3.3 */ -# define ECMA_NUMBER_MIN_VALUE ((ecma_number_t)5e-324) +# define ECMA_NUMBER_MIN_VALUE ((ecma_number_t) 5e-324) #endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */ /** * Euler number */ -#define ECMA_NUMBER_E ((ecma_number_t)2.7182818284590452354) +#define ECMA_NUMBER_E ((ecma_number_t) 2.7182818284590452354) /** * Natural logarithm of 10 */ -#define ECMA_NUMBER_LN10 ((ecma_number_t)2.302585092994046) +#define ECMA_NUMBER_LN10 ((ecma_number_t) 2.302585092994046) /** * Natural logarithm of 2 */ -#define ECMA_NUMBER_LN2 ((ecma_number_t)0.6931471805599453) +#define ECMA_NUMBER_LN2 ((ecma_number_t) 0.6931471805599453) /** * Logarithm base 2 of the Euler number */ -#define ECMA_NUMBER_LOG2E ((ecma_number_t)1.4426950408889634) +#define ECMA_NUMBER_LOG2E ((ecma_number_t) 1.4426950408889634) /** * Logarithm base 10 of the Euler number */ -#define ECMA_NUMBER_LOG10E ((ecma_number_t)0.4342944819032518) +#define ECMA_NUMBER_LOG10E ((ecma_number_t) 0.4342944819032518) /** * Pi number */ -#define ECMA_NUMBER_PI ((ecma_number_t)3.1415926535897932) +#define ECMA_NUMBER_PI ((ecma_number_t) 3.1415926535897932) /** * Square root of 0.5 */ -#define ECMA_NUMBER_SQRT_1_2 ((ecma_number_t)0.7071067811865476) +#define ECMA_NUMBER_SQRT_1_2 ((ecma_number_t) 0.7071067811865476) /** * Square root of 2 */ -#define ECMA_NUMBER_SQRT2 ((ecma_number_t)1.4142135623730951) +#define ECMA_NUMBER_SQRT2 ((ecma_number_t) 1.4142135623730951) /** * Maximum number of characters in string representation of ecma-number diff --git a/jerry-core/ecma/base/ecma-helpers-conversion.c b/jerry-core/ecma/base/ecma-helpers-conversion.c index ad6fa56e..581f50dd 100644 --- a/jerry-core/ecma/base/ecma-helpers-conversion.c +++ b/jerry-core/ecma/base/ecma-helpers-conversion.c @@ -1278,7 +1278,7 @@ ecma_number_to_decimal (ecma_number_t num, /**< ecma-number */ } const int32_t int_part_shift = dot_shift; - const uint32_t frac_part_mask = ((((uint32_t)1) << int_part_shift) - 1); + const uint32_t frac_part_mask = ((((uint32_t) 1) << int_part_shift) - 1); uint32_t int_part = fraction >> int_part_shift; uint32_t frac_part = fraction & frac_part_mask; diff --git a/jerry-core/ecma/base/ecma-helpers-string.c b/jerry-core/ecma/base/ecma-helpers-string.c index f989dcb4..d475b8a4 100644 --- a/jerry-core/ecma/base/ecma-helpers-string.c +++ b/jerry-core/ecma/base/ecma-helpers-string.c @@ -59,7 +59,7 @@ ecma_init_ecma_string_from_magic_string_ex_id (ecma_string_t *string_p, * * @return pointer to the collection's header */ -static ecma_collection_header_t* +static ecma_collection_header_t * ecma_new_chars_collection (const lit_utf8_byte_t chars_buffer[], /**< utf-8 chars */ lit_utf8_size_t chars_size) /**< size of buffer with chars */ { @@ -220,7 +220,7 @@ ecma_compare_chars_collection (const ecma_collection_header_t *header1_p, /**< f * * @return pointer to collection copy */ -static ecma_collection_header_t* +static ecma_collection_header_t * ecma_copy_chars_collection (const ecma_collection_header_t *collection_p) /**< collection's header */ { JERRY_ASSERT (collection_p != NULL); @@ -464,7 +464,7 @@ ecma_new_ecma_string_from_uint32 (uint32_t uint32_number) /**< UInt32-represente * * @return pointer to ecma-string descriptor */ -ecma_string_t* +ecma_string_t * ecma_new_ecma_string_from_number (ecma_number_t num) /**< ecma-number */ { uint32_t uint32_num = ecma_number_to_uint32 (num); @@ -506,7 +506,7 @@ ecma_new_ecma_string_from_number (ecma_number_t num) /**< ecma-number */ * * @return pointer to ecma-string descriptor */ -ecma_string_t* +ecma_string_t * ecma_new_ecma_string_from_lit_cp (lit_cpointer_t lit_cp) /**< index in the literal table */ { ecma_string_t *string_desc_p = ecma_alloc_string (); @@ -521,7 +521,7 @@ ecma_new_ecma_string_from_lit_cp (lit_cpointer_t lit_cp) /**< index in the liter * * @return pointer to ecma-string descriptor */ -ecma_string_t* +ecma_string_t * ecma_new_ecma_string_from_magic_string_id (lit_magic_string_id_t id) /**< identifier of magic string */ { JERRY_ASSERT (id < LIT_MAGIC_STRING__COUNT); @@ -537,7 +537,7 @@ ecma_new_ecma_string_from_magic_string_id (lit_magic_string_id_t id) /**< identi * * @return pointer to ecma-string descriptor */ -ecma_string_t* +ecma_string_t * ecma_new_ecma_string_from_magic_string_ex_id (lit_magic_string_ex_id_t id) /**< identifier of externl magic string */ { JERRY_ASSERT (id < lit_get_magic_string_ex_count ()); @@ -553,7 +553,7 @@ ecma_new_ecma_string_from_magic_string_ex_id (lit_magic_string_ex_id_t id) /**< * * @return concatenation of two ecma-strings */ -ecma_string_t* +ecma_string_t * ecma_concat_ecma_strings (ecma_string_t *string1_p, /**< first ecma-string */ ecma_string_t *string2_p) /**< second ecma-string */ { @@ -593,7 +593,7 @@ ecma_concat_ecma_strings (ecma_string_t *string1_p, /**< first ecma-string */ ecma_string_t *str_concat_p = ecma_new_ecma_string_from_utf8 (str_p, buffer_size); - mem_heap_free_block ((void*) str_p); + mem_heap_free_block ((void *) str_p); return str_concat_p; } /* ecma_concat_ecma_strings */ @@ -603,7 +603,7 @@ ecma_concat_ecma_strings (ecma_string_t *string1_p, /**< first ecma-string */ * * @return pointer to copy of ecma-string with reference counter set to 1 */ -static ecma_string_t* +static ecma_string_t * ecma_copy_ecma_string (ecma_string_t *string_desc_p) /**< string descriptor */ { JERRY_ASSERT (string_desc_p != NULL); @@ -668,7 +668,7 @@ ecma_copy_ecma_string (ecma_string_t *string_desc_p) /**< string descriptor */ * @return pointer to same ecma-string descriptor with increased reference counter * or the ecma-string's copy with reference counter set to 1 */ -ecma_string_t* +ecma_string_t * ecma_copy_or_ref_ecma_string (ecma_string_t *string_desc_p) /**< string descriptor */ { JERRY_ASSERT (string_desc_p != NULL); @@ -719,7 +719,7 @@ ecma_deref_ecma_string (ecma_string_t *string_p) /**< ecma-string */ return; } - switch ((ecma_string_container_t)string_p->container) + switch ((ecma_string_container_t) string_p->container) { case ECMA_STRING_CONTAINER_HEAP_CHUNKS: { @@ -786,7 +786,7 @@ ecma_string_to_number (const ecma_string_t *str_p) /**< ecma-string */ { JERRY_ASSERT (str_p != NULL); - switch ((ecma_string_container_t)str_p->container) + switch ((ecma_string_container_t) str_p->container) { case ECMA_STRING_CONTAINER_UINT32_IN_DESC: { @@ -894,7 +894,7 @@ ecma_string_to_utf8_string (const ecma_string_t *string_desc_p, /**< ecma-string return -required_buffer_size; } - switch ((ecma_string_container_t)string_desc_p->container) + switch ((ecma_string_container_t) string_desc_p->container) { case ECMA_STRING_CONTAINER_HEAP_CHUNKS: { @@ -1205,12 +1205,12 @@ ecma_compare_ecma_strings_relational (const ecma_string_t *string1_p, /**< ecma- if (is_utf8_string1_on_heap) { - mem_heap_free_block ((void*) utf8_string1_p); + mem_heap_free_block ((void *) utf8_string1_p); } if (is_utf8_string2_on_heap) { - mem_heap_free_block ((void*) utf8_string2_p); + mem_heap_free_block ((void *) utf8_string2_p); } return is_first_less_than_second; @@ -1356,7 +1356,7 @@ ecma_string_get_size (const ecma_string_t *string_p) /**< ecma-string */ } default: { - JERRY_ASSERT ((ecma_string_container_t)string_p->container == ECMA_STRING_CONTAINER_HEAP_CHUNKS); + JERRY_ASSERT ((ecma_string_container_t) string_p->container == ECMA_STRING_CONTAINER_HEAP_CHUNKS); const ecma_collection_header_t *collection_header_p = ECMA_GET_NON_NULL_POINTER (ecma_collection_header_t, string_p->u.collection_cp); @@ -1424,7 +1424,7 @@ ecma_string_get_byte_at_pos (const ecma_string_t *string_p, /**< ecma-string */ * * @return ecma-string containing specified magic string */ -ecma_string_t* +ecma_string_t * ecma_get_magic_string (lit_magic_string_id_t id) /**< magic string id */ { return ecma_new_ecma_string_from_magic_string_id (id); @@ -1435,7 +1435,7 @@ ecma_get_magic_string (lit_magic_string_id_t id) /**< magic string id */ * * @return ecma-string containing specified external magic string */ -ecma_string_t* +ecma_string_t * ecma_get_magic_string_ex (lit_magic_string_ex_id_t id) /**< external magic string id */ { return ecma_new_ecma_string_from_magic_string_ex_id (id); diff --git a/jerry-core/ecma/base/ecma-helpers.c b/jerry-core/ecma/base/ecma-helpers.c index bb178067..22646a79 100644 --- a/jerry-core/ecma/base/ecma-helpers.c +++ b/jerry-core/ecma/base/ecma-helpers.c @@ -39,7 +39,7 @@ * * @return pointer to the object's descriptor */ -ecma_object_t* +ecma_object_t * ecma_create_object (ecma_object_t *prototype_object_p, /**< pointer to prototybe of the object (or NULL) */ bool is_extensible, /**< value of extensible attribute */ ecma_object_type_t type) /**< object type */ @@ -88,7 +88,7 @@ ecma_create_object (ecma_object_t *prototype_object_p, /**< pointer to prototybe * * @return pointer to the descriptor of lexical environment */ -ecma_object_t* +ecma_object_t * ecma_create_decl_lex_env (ecma_object_t *outer_lexical_environment_p) /**< outer lexical environment */ { ecma_object_t *new_lexical_environment_p = ecma_alloc_object (); @@ -138,7 +138,7 @@ ecma_create_decl_lex_env (ecma_object_t *outer_lexical_environment_p) /**< outer * * @return pointer to the descriptor of lexical environment */ -ecma_object_t* +ecma_object_t * ecma_create_object_lex_env (ecma_object_t *outer_lexical_environment_p, /**< outer lexical environment */ ecma_object_t *binding_obj_p, /**< binding object */ bool provide_this) /**< provideThis flag */ @@ -430,7 +430,7 @@ ecma_get_lex_env_binding_object (const ecma_object_t *object_p) /**< object-boun * * @return pointer to newly created property */ -ecma_property_t* +ecma_property_t * ecma_create_internal_property (ecma_object_t *object_p, /**< the object */ ecma_internal_property_id_t property_id) /**< internal property identifier */ { @@ -459,7 +459,7 @@ ecma_create_internal_property (ecma_object_t *object_p, /**< the object */ * @return pointer to the property, if it is found, * NULL - otherwise. */ -ecma_property_t* +ecma_property_t * ecma_find_internal_property (ecma_object_t *object_p, /**< object descriptor */ ecma_internal_property_id_t property_id) /**< internal property identifier */ { @@ -492,7 +492,7 @@ ecma_find_internal_property (ecma_object_t *object_p, /**< object descriptor */ * * @return pointer to the property */ -ecma_property_t* +ecma_property_t * ecma_get_internal_property (ecma_object_t *object_p, /**< object descriptor */ ecma_internal_property_id_t property_id) /**< internal property identifier */ { @@ -509,7 +509,7 @@ ecma_get_internal_property (ecma_object_t *object_p, /**< object descriptor */ * * @return pointer to newly created property */ -ecma_property_t* +ecma_property_t * ecma_create_named_data_property (ecma_object_t *obj_p, /**< object */ ecma_string_t *name_p, /**< property name */ bool is_writable, /**< 'Writable' attribute */ @@ -553,7 +553,7 @@ ecma_create_named_data_property (ecma_object_t *obj_p, /**< object */ * * @return pointer to newly created property */ -ecma_property_t* +ecma_property_t * ecma_create_named_accessor_property (ecma_object_t *obj_p, /**< object */ ecma_string_t *name_p, /**< property name */ ecma_object_t *get_p, /**< getter */ @@ -606,7 +606,7 @@ ecma_create_named_accessor_property (ecma_object_t *obj_p, /**< object */ * @return pointer to the property, if it is found, * NULL - otherwise. */ -ecma_property_t* +ecma_property_t * ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in */ ecma_string_t *name_p) /**< property's name */ { @@ -663,7 +663,7 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in * @return pointer to the property, if it is found, * NULL - otherwise. */ -ecma_property_t* +ecma_property_t * ecma_get_named_property (ecma_object_t *obj_p, /**< object to find property in */ ecma_string_t *name_p) /**< property's name */ { @@ -686,7 +686,7 @@ ecma_get_named_property (ecma_object_t *obj_p, /**< object to find property in * * @return pointer to the property, if it is found, * NULL - otherwise. */ -ecma_property_t* +ecma_property_t * ecma_get_named_data_property (ecma_object_t *obj_p, /**< object to find property in */ ecma_string_t *name_p) /**< property's name */ { @@ -1009,7 +1009,7 @@ ecma_named_data_property_assign_value (ecma_object_t *obj_p, /**< object */ * * @return pointer to object - getter of the property */ -ecma_object_t* +ecma_object_t * ecma_get_named_accessor_property_getter (const ecma_property_t *prop_p) /**< named accessor property */ { JERRY_ASSERT (prop_p->type == ECMA_PROPERTY_NAMEDACCESSOR); @@ -1026,7 +1026,7 @@ ecma_get_named_accessor_property_getter (const ecma_property_t *prop_p) /**< nam * * @return pointer to object - setter of the property */ -ecma_object_t* +ecma_object_t * ecma_get_named_accessor_property_setter (const ecma_property_t *prop_p) /**< named accessor property */ { JERRY_ASSERT (prop_p->type == ECMA_PROPERTY_NAMEDACCESSOR); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c index d3b0cad0..139576fa 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c @@ -482,7 +482,7 @@ ecma_builtin_helper_string_index_normalize (ecma_number_t index, /**< index */ * - The String.prototype.indexOf routine. * - The String.prototype.lastIndexOf routine. * - * @return uint32_t - (last)index of search string + * @return uint32_t - (last) index of search string */ ecma_value_t ecma_builtin_helper_string_prototype_object_index_of (ecma_value_t this_arg, /**< this argument */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtins.c b/jerry-core/ecma/builtin-objects/ecma-builtins.c index 033eacd9..01a3bad5 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtins.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtins.c @@ -71,7 +71,7 @@ ecma_builtin_is (ecma_object_t *obj_p, /**< pointer to an object */ * * @return pointer to the object's instance */ -ecma_object_t* +ecma_object_t * ecma_builtin_get (ecma_builtin_id_t builtin_id) /**< id of built-in to check on */ { JERRY_ASSERT (builtin_id < ECMA_BUILTIN_ID__COUNT); @@ -94,7 +94,7 @@ ecma_builtin_get (ecma_builtin_id_t builtin_id) /**< id of built-in to check on * * @return pointer to the object */ -static ecma_object_t* +static ecma_object_t * ecma_builtin_init_object (ecma_builtin_id_t obj_builtin_id, /**< built-in ID */ ecma_object_t *prototype_obj_p, /**< prototype object */ ecma_object_type_t obj_type, /**< object's type */ @@ -284,7 +284,7 @@ ecma_finalize_builtins (void) * @return pointer property, if one was instantiated, * NULL - otherwise. */ -ecma_property_t* +ecma_property_t * ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object */ ecma_string_t *string_p) /**< property's name */ { @@ -461,7 +461,7 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in * * @return pointer to constructed Function object */ -ecma_object_t* +ecma_object_t * ecma_builtin_make_function_object_for_routine (ecma_builtin_id_t builtin_id, /**< identifier of built-in object that initially contains property with the routine */ diff --git a/jerry-core/ecma/operations/ecma-conversion.c b/jerry-core/ecma/operations/ecma-conversion.c index 7e0d06fb..4145be83 100644 --- a/jerry-core/ecma/operations/ecma-conversion.c +++ b/jerry-core/ecma/operations/ecma-conversion.c @@ -435,7 +435,7 @@ ecma_op_to_object (ecma_value_t value) /**< ecma value */ * * @return constructed object */ -ecma_object_t* +ecma_object_t * ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_desc_p) /**< property descriptor */ { // 2. diff --git a/jerry-core/ecma/operations/ecma-exceptions.c b/jerry-core/ecma/operations/ecma-exceptions.c index 69fc256f..05d2ef52 100644 --- a/jerry-core/ecma/operations/ecma-exceptions.c +++ b/jerry-core/ecma/operations/ecma-exceptions.c @@ -35,7 +35,7 @@ * @return pointer to ecma-object representing specified error * with reference counter set to one. */ -ecma_object_t* +ecma_object_t * ecma_new_standard_error (ecma_standard_error_t error_type) /**< native error type */ { #ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS @@ -112,7 +112,7 @@ ecma_new_standard_error (ecma_standard_error_t error_type) /**< native error typ * @return pointer to ecma-object representing specified error * with reference counter set to one. */ -ecma_object_t* +ecma_object_t * ecma_new_standard_error_with_message (ecma_standard_error_t error_type, /**< native error type */ ecma_string_t *message_string_p) /**< message string */ { diff --git a/jerry-core/ecma/operations/ecma-function-object.c b/jerry-core/ecma/operations/ecma-function-object.c index fc568933..7e5779bb 100644 --- a/jerry-core/ecma/operations/ecma-function-object.c +++ b/jerry-core/ecma/operations/ecma-function-object.c @@ -133,7 +133,7 @@ ecma_function_bind_merge_arg_lists (ecma_value_t *merged_args_list_p, /**< desti * * @return pointer to newly created Function object */ -ecma_object_t* +ecma_object_t * ecma_op_create_function_object (ecma_object_t *scope_p, /**< function's scope */ bool is_decl_in_strict_mode, /**< is function declared in strict mode code? */ const ecma_compiled_code_t *bytecode_data_p) /**< byte-code array */ @@ -377,7 +377,7 @@ ecma_op_function_try_lazy_instantiate_property (ecma_object_t *obj_p, /**< the f * current invocation, * NULL (i.e. ecma-undefined) - otherwise. */ -ecma_property_t* +ecma_property_t * ecma_op_function_object_get_own_property (ecma_object_t *obj_p, /**< the function object */ ecma_string_t *property_name_p) /**< property name */ { @@ -413,7 +413,7 @@ ecma_op_function_object_get_own_property (ecma_object_t *obj_p, /**< the functio * * @return pointer to newly created external function object */ -ecma_object_t* +ecma_object_t * ecma_op_create_external_function_object (ecma_external_pointer_t code_p) /**< pointer to external native handler */ { ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE); diff --git a/jerry-core/ecma/operations/ecma-lex-env.c b/jerry-core/ecma/operations/ecma-lex-env.c index 522d79bc..d43057d2 100644 --- a/jerry-core/ecma/operations/ecma-lex-env.c +++ b/jerry-core/ecma/operations/ecma-lex-env.c @@ -76,7 +76,7 @@ ecma_finalize_environment (void) * * @return pointer to the object's instance */ -ecma_object_t* +ecma_object_t * ecma_get_global_environment (void) { ecma_ref_object (ecma_global_lex_env_p); diff --git a/jerry-core/ecma/operations/ecma-objects-arguments.c b/jerry-core/ecma/operations/ecma-objects-arguments.c index 6ac990c2..5fe8d724 100644 --- a/jerry-core/ecma/operations/ecma-objects-arguments.c +++ b/jerry-core/ecma/operations/ecma-objects-arguments.c @@ -347,7 +347,7 @@ ecma_op_arguments_object_get (ecma_object_t *obj_p, /**< the object */ * @return ecma value * Returned value must be freed with ecma_free_value */ -ecma_property_t* +ecma_property_t * ecma_op_arguments_object_get_own_property (ecma_object_t *obj_p, /**< the object */ ecma_string_t *property_name_p) /**< property name */ { diff --git a/jerry-core/ecma/operations/ecma-objects-general.c b/jerry-core/ecma/operations/ecma-objects-general.c index 7c64575a..b88576ff 100644 --- a/jerry-core/ecma/operations/ecma-objects-general.c +++ b/jerry-core/ecma/operations/ecma-objects-general.c @@ -57,7 +57,7 @@ ecma_reject (bool is_throw) /**< Throw flag */ * * @return pointer to newly created 'Object' object */ -ecma_object_t* +ecma_object_t * ecma_op_create_object_object_noarg (void) { ecma_object_t *object_prototype_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE); @@ -110,7 +110,7 @@ ecma_op_create_object_object_arg (ecma_value_t value) /**< argument of construct * * @return pointer to newly created object */ -ecma_object_t* +ecma_object_t * ecma_op_create_object_object_noarg_and_set_prototype (ecma_object_t *object_prototype_p) /**< pointer to prototype of the object (can be NULL) */ @@ -192,7 +192,7 @@ ecma_op_general_object_get (ecma_object_t *obj_p, /**< the object */ * @return pointer to a property - if it exists, * NULL (i.e. ecma-undefined) - otherwise. */ -ecma_property_t* +ecma_property_t * ecma_op_general_object_get_own_property (ecma_object_t *obj_p, /**< the object */ ecma_string_t *property_name_p) /**< property name */ { @@ -213,7 +213,7 @@ ecma_op_general_object_get_own_property (ecma_object_t *obj_p, /**< the object * * @return pointer to a property - if it exists, * NULL (i.e. ecma-undefined) - otherwise. */ -ecma_property_t* +ecma_property_t * ecma_op_general_object_get_property (ecma_object_t *obj_p, /**< the object */ ecma_string_t *property_name_p) /**< property name */ { diff --git a/jerry-core/ecma/operations/ecma-objects.c b/jerry-core/ecma/operations/ecma-objects.c index 5b429852..929ebcf6 100644 --- a/jerry-core/ecma/operations/ecma-objects.c +++ b/jerry-core/ecma/operations/ecma-objects.c @@ -97,7 +97,7 @@ ecma_op_object_get (ecma_object_t *obj_p, /**< the object */ * @return pointer to a property - if it exists, * NULL (i.e. ecma-undefined) - otherwise. */ -static __attr_noinline___ ecma_property_t* +static ecma_property_t * __attr_noinline___ ecma_op_object_get_own_property_longpath (ecma_object_t *obj_p, /**< the object */ ecma_string_t *property_name_p) /**< property name */ { @@ -163,7 +163,7 @@ ecma_op_object_get_own_property_longpath (ecma_object_t *obj_p, /**< the object * @return pointer to a property - if it exists, * NULL (i.e. ecma-undefined) - otherwise. */ -ecma_property_t* +ecma_property_t * ecma_op_object_get_own_property (ecma_object_t *obj_p, /**< the object */ ecma_string_t *property_name_p) /**< property name */ { @@ -192,7 +192,7 @@ ecma_op_object_get_own_property (ecma_object_t *obj_p, /**< the object */ * @return pointer to a property - if it exists, * NULL (i.e. ecma-undefined) - otherwise. */ -ecma_property_t* +ecma_property_t * ecma_op_object_get_property (ecma_object_t *obj_p, /**< the object */ ecma_string_t *property_name_p) /**< property name */ { @@ -204,7 +204,7 @@ ecma_op_object_get_property (ecma_object_t *obj_p, /**< the object */ ecma_assert_object_type_is_valid (type); /* - * typedef ecma_property_t* (*get_property_ptr_t) (ecma_object_t *, ecma_string_t *); + * typedef ecma_property_t * (*get_property_ptr_t) (ecma_object_t *, ecma_string_t *); * static const get_property_ptr_t get_property [ECMA_OBJECT_TYPE__COUNT] = * { * [ECMA_OBJECT_TYPE_GENERAL] = &ecma_op_general_object_get_property, @@ -246,7 +246,7 @@ ecma_op_object_put (ecma_object_t *obj_p, /**< the object */ ecma_assert_object_type_is_valid (type); /* - * typedef ecma_property_t* (*put_ptr_t) (ecma_object_t *, ecma_string_t *); + * typedef ecma_property_t * (*put_ptr_t) (ecma_object_t *, ecma_string_t *); * static const put_ptr_t put [ECMA_OBJECT_TYPE__COUNT] = * { * [ECMA_OBJECT_TYPE_GENERAL] = &ecma_op_general_object_put, @@ -286,7 +286,7 @@ ecma_op_object_can_put (ecma_object_t *obj_p, /**< the object */ ecma_assert_object_type_is_valid (type); /* - * typedef ecma_property_t* (*can_put_ptr_t) (ecma_object_t *, ecma_string_t *); + * typedef ecma_property_t * (*can_put_ptr_t) (ecma_object_t *, ecma_string_t *); * static const can_put_ptr_t can_put [ECMA_OBJECT_TYPE__COUNT] = * { * [ECMA_OBJECT_TYPE_GENERAL] = &ecma_op_general_object_can_put, @@ -374,7 +374,7 @@ ecma_op_object_default_value (ecma_object_t *obj_p, /**< the object */ ecma_assert_object_type_is_valid (type); /* - * typedef ecma_property_t* (*default_value_ptr_t) (ecma_object_t *, ecma_string_t *); + * typedef ecma_property_t * (*default_value_ptr_t) (ecma_object_t *, ecma_string_t *); * static const default_value_ptr_t default_value [ECMA_OBJECT_TYPE__COUNT] = * { * [ECMA_OBJECT_TYPE_GENERAL] = &ecma_op_general_object_default_value, diff --git a/jerry-core/ecma/operations/ecma-reference.c b/jerry-core/ecma/operations/ecma-reference.c index 9071e42d..bb2ed011 100644 --- a/jerry-core/ecma/operations/ecma-reference.c +++ b/jerry-core/ecma/operations/ecma-reference.c @@ -36,7 +36,7 @@ * pointer to lexical environment - reference's base, * else - NULL. */ -ecma_object_t* +ecma_object_t * ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, /**< starting lexical environment */ ecma_string_t *name_p) /**< identifier's name */ { diff --git a/jerry-core/ecma/operations/ecma-string-object.c b/jerry-core/ecma/operations/ecma-string-object.c index c6aca1e7..416a1c74 100644 --- a/jerry-core/ecma/operations/ecma-string-object.c +++ b/jerry-core/ecma/operations/ecma-string-object.c @@ -119,7 +119,7 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of * @return ecma value * Returned value must be freed with ecma_free_value */ -ecma_property_t* +ecma_property_t * ecma_op_string_object_get_own_property (ecma_object_t *obj_p, /**< a String object */ ecma_string_t *property_name_p) /**< property name */ { diff --git a/jerry-core/jerry.c b/jerry-core/jerry.c index 5999ffd2..7db16f18 100644 --- a/jerry-core/jerry.c +++ b/jerry-core/jerry.c @@ -575,7 +575,7 @@ jerry_api_string_to_char_buffer (const jerry_api_string_t *string_p, /**< string * * @return pointer that may be used outside of the engine */ -jerry_api_string_t* +jerry_api_string_t * jerry_api_acquire_string (jerry_api_string_t *string_p) /**< pointer passed to function */ { jerry_assert_api_available (); @@ -608,7 +608,7 @@ jerry_api_release_string (jerry_api_string_t *string_p) /**< pointer acquired th * * @return pointer that may be used outside of the engine */ -jerry_api_object_t* +jerry_api_object_t * jerry_api_acquire_object (jerry_api_object_t *object_p) /**< pointer passed to function */ { jerry_assert_api_available (); @@ -694,7 +694,7 @@ jerry_api_create_string_sz (const jerry_api_char_t *v, /**< string value */ * * @return pointer to created object */ -jerry_api_object_t* +jerry_api_object_t * jerry_api_create_object (void) { jerry_assert_api_available (); @@ -737,7 +737,7 @@ jerry_api_create_array_object (jerry_api_size_t size) /* size of array */ bool jerry_api_set_array_index_value (jerry_api_object_t *array_obj_p, /* array object */ jerry_api_length_t index, /* index to be written */ - jerry_api_value_t *value_p) /* value to set*/ + jerry_api_value_t *value_p) /* value to set */ { ecma_string_t *str_idx_p = ecma_new_ecma_string_from_uint32 ((uint32_t) index); ecma_value_t value; @@ -787,7 +787,7 @@ jerry_api_get_array_index_value (jerry_api_object_t *array_obj_p, /* array objec * * @return pointer to created error object */ -jerry_api_object_t* +jerry_api_object_t * jerry_api_create_error (jerry_api_error_t error_type, /**< type of error */ const jerry_api_char_t *message_p) /**< value of 'message' property * of constructed error object */ @@ -805,7 +805,7 @@ jerry_api_create_error (jerry_api_error_t error_type, /**< type of error */ * * @return pointer to created error object */ -jerry_api_object_t* +jerry_api_object_t * jerry_api_create_error_sz (jerry_api_error_t error_type, /**< type of error */ const jerry_api_char_t *message_p, /**< value of 'message' property * of constructed error object */ @@ -883,7 +883,7 @@ jerry_api_create_error_sz (jerry_api_error_t error_type, /**< type of error */ * * @return pointer to created external function object */ -jerry_api_object_t* +jerry_api_object_t * jerry_api_create_external_function (jerry_external_handler_t handler_p) /**< pointer to native handler * for the function */ { @@ -1553,7 +1553,7 @@ jerry_api_construct_object (jerry_api_object_t *function_object_p, /**< function * * @return pointer to the global object */ -jerry_api_object_t* +jerry_api_object_t * jerry_api_get_global (void) { jerry_assert_api_available (); @@ -1789,7 +1789,7 @@ jerry_run_simple (const jerry_api_char_t *script_source, /**< script source */ * * @return run context */ -jerry_ctx_t* +jerry_ctx_t * jerry_new_ctx (void) { jerry_assert_api_available (); diff --git a/jerry-core/jrt/jrt.h b/jerry-core/jrt/jrt.h index deb293da..77a7b516 100644 --- a/jerry-core/jrt/jrt.h +++ b/jerry-core/jrt/jrt.h @@ -192,7 +192,7 @@ extern void __noreturn jerry_fatal (jerry_fatal_code_t); /** * sizeof, offsetof, ... */ -#define JERRY_SIZE_OF_STRUCT_MEMBER(struct_name, member_name) sizeof (((struct_name *)NULL)->member_name) +#define JERRY_SIZE_OF_STRUCT_MEMBER(struct_name, member_name) sizeof (((struct_name *) NULL)->member_name) /** * Alignment diff --git a/jerry-core/mem/mem-allocator.c b/jerry-core/mem/mem-allocator.c index 473a1e68..5770e341 100644 --- a/jerry-core/mem/mem-allocator.c +++ b/jerry-core/mem/mem-allocator.c @@ -81,7 +81,7 @@ mem_compress_pointer (const void *pointer_p) /**< pointer to compress */ * * @return unpacked pointer */ -void* +void * mem_decompress_pointer (uintptr_t compressed_pointer) /**< pointer to decompress */ { return mem_heap_decompress_pointer (compressed_pointer); diff --git a/jerry-core/mem/mem-heap.c b/jerry-core/mem/mem-heap.c index 76554842..86fda97c 100644 --- a/jerry-core/mem/mem-heap.c +++ b/jerry-core/mem/mem-heap.c @@ -526,7 +526,7 @@ mem_heap_alloc_block_internal (size_t size_in_bytes, /**< size of region to allo * * @return pointer to allocated memory block */ -static void* +static void * mem_heap_alloc_block_try_give_memory_back (size_t size_in_bytes, /**< size of region to allocate in bytes */ mem_block_length_type_t length_type, /**< length type of the block * (one-chunked or general) */ @@ -582,7 +582,7 @@ mem_heap_alloc_block_try_give_memory_back (size_t size_in_bytes, /**< size of re * @return pointer to allocated memory block - if allocation is successful, * NULL - if requested region size is zero. */ -void* +void * mem_heap_alloc_block (size_t size_in_bytes, /**< size of region to allocate in bytes */ mem_heap_alloc_term_t alloc_term) /**< expected allocation term */ { @@ -613,7 +613,7 @@ mem_heap_alloc_block (size_t size_in_bytes, /**< size of region to a * * @return pointer to allocated memory block */ -void* +void * mem_heap_alloc_chunked_block (mem_heap_alloc_term_t alloc_term) /**< expected allocation term */ { return mem_heap_alloc_block_try_give_memory_back (mem_heap_get_chunked_block_data_size (), @@ -629,7 +629,7 @@ mem_heap_free_block (void *ptr) /**< pointer to beginning of data space of the b { VALGRIND_FREYA_CHECK_MEMPOOL_REQUEST; - uint8_t *uint8_ptr = (uint8_t*) ptr; + uint8_t *uint8_ptr = (uint8_t *) ptr; /* checking that uint8_ptr points to the heap */ JERRY_ASSERT (uint8_ptr >= mem_heap.area && uint8_ptr <= (uint8_t *) mem_heap.area + MEM_HEAP_AREA_SIZE); @@ -754,7 +754,7 @@ mem_heap_free_block (void *ptr) /**< pointer to beginning of data space of the b * * @return beginning of user data space of block identified by the pointer */ -void* +void * mem_heap_get_chunked_block_start (void *ptr) /**< pointer into a block */ { JERRY_STATIC_ASSERT ((MEM_HEAP_CHUNK_SIZE & (MEM_HEAP_CHUNK_SIZE - 1u)) == 0); @@ -768,11 +768,11 @@ mem_heap_get_chunked_block_start (void *ptr) /**< pointer into a block */ JERRY_ASSERT (uintptr >= uintptr_chunk_aligned); #ifndef JERRY_NDEBUG - size_t chunk_index = mem_heap_get_chunk_from_address ((void*) uintptr_chunk_aligned); + size_t chunk_index = mem_heap_get_chunk_from_address ((void *) uintptr_chunk_aligned); JERRY_ASSERT (mem_heap_length_types[chunk_index] == MEM_BLOCK_LENGTH_TYPE_ONE_CHUNKED); #endif /* !JERRY_NDEBUG */ - return (void*) uintptr_chunk_aligned; + return (void *) uintptr_chunk_aligned; } /* mem_heap_get_chunked_block_start */ /** @@ -825,7 +825,7 @@ mem_heap_compress_pointer (const void *pointer_p) /**< pointer to compress */ * * @return unpacked heap pointer */ -void* +void * mem_heap_decompress_pointer (uintptr_t compressed_pointer) /**< pointer to decompress */ { JERRY_ASSERT (compressed_pointer != MEM_CP_NULL); @@ -836,7 +836,7 @@ mem_heap_decompress_pointer (uintptr_t compressed_pointer) /**< pointer to decom int_ptr <<= MEM_ALIGNMENT_LOG; int_ptr += heap_start; - return (void*) int_ptr; + return (void *) int_ptr; } /* mem_heap_decompress_pointer */ #ifndef JERRY_NDEBUG @@ -852,7 +852,7 @@ mem_heap_decompress_pointer (uintptr_t compressed_pointer) /**< pointer to decom bool mem_is_heap_pointer (const void *pointer) /**< pointer */ { - uint8_t *uint8_pointer = (uint8_t*) pointer; + uint8_t *uint8_pointer = (uint8_t *) pointer; return (uint8_pointer >= mem_heap.area && uint8_pointer <= ((uint8_t *) mem_heap.area + MEM_HEAP_AREA_SIZE)); } /* mem_is_heap_pointer */ @@ -875,7 +875,7 @@ mem_heap_print_block (bool dump_block_data, /**< print block with data (true) if (dump_block_data) { - uint8_t *block_data_p = (uint8_t*) mem_heap.area; + uint8_t *block_data_p = (uint8_t *) mem_heap.area; uint8_t *block_data_end_p = block_data_p + start_chunk * MEM_HEAP_CHUNK_SIZE; #ifdef JERRY_VALGRIND diff --git a/jerry-core/mem/mem-poolman.c b/jerry-core/mem/mem-poolman.c index ab210d19..033d1611 100644 --- a/jerry-core/mem/mem-poolman.c +++ b/jerry-core/mem/mem-poolman.c @@ -552,7 +552,7 @@ mem_pools_alloc_longpath (void) JERRY_ASSERT (MEM_POOL_CHUNKS_NUMBER >= 1); MEM_HEAP_VALGRIND_FREYA_MEMPOOL_REQUEST (); - mem_pool_chunk_t *pool_start_p = (mem_pool_chunk_t*) mem_heap_alloc_chunked_block (MEM_HEAP_ALLOC_LONG_TERM); + mem_pool_chunk_t *pool_start_p = (mem_pool_chunk_t *) mem_heap_alloc_chunked_block (MEM_HEAP_ALLOC_LONG_TERM); if (mem_free_chunk_p != NULL) { diff --git a/jerry-core/parser/js/js-parser-internal.h b/jerry-core/parser/js/js-parser-internal.h index e6e82d9c..1ebfd170 100644 --- a/jerry-core/parser/js/js-parser-internal.h +++ b/jerry-core/parser/js/js-parser-internal.h @@ -61,10 +61,10 @@ /* The maximum of PARSER_CBC_STREAM_PAGE_SIZE is 127. */ #define PARSER_CBC_STREAM_PAGE_SIZE \ - ((uint32_t) (64 - sizeof (void*))) + ((uint32_t) (64 - sizeof (void *))) #define PARSER_STACK_PAGE_SIZE \ - ((uint32_t) (((sizeof (void*) > 4) ? 128 : 64) - sizeof (void*))) + ((uint32_t) (((sizeof (void *) > 4) ? 128 : 64) - sizeof (void *))) /* Avoid compiler warnings for += operations. */ #define PARSER_PLUS_EQUAL_U16(base, value) (base) = (uint16_t) ((base) + (value)) diff --git a/jerry-core/parser/regexp/re-compiler.c b/jerry-core/parser/regexp/re-compiler.c index fe1535d1..ab9d2ede 100644 --- a/jerry-core/parser/regexp/re-compiler.c +++ b/jerry-core/parser/regexp/re-compiler.c @@ -146,7 +146,7 @@ static void re_append_opcode (re_bytecode_ctx_t *bc_ctx_p, /**< RegExp bytecode context */ re_opcode_t opcode) /**< input opcode */ { - re_bytecode_list_append (bc_ctx_p, (uint8_t*) &opcode, sizeof (uint8_t)); + re_bytecode_list_append (bc_ctx_p, (uint8_t *) &opcode, sizeof (uint8_t)); } /* re_append_opcode */ /** @@ -156,7 +156,7 @@ static void re_append_u32 (re_bytecode_ctx_t *bc_ctx_p, /**< RegExp bytecode context */ uint32_t value) /**< input value */ { - re_bytecode_list_append (bc_ctx_p, (uint8_t*) &value, sizeof (uint32_t)); + re_bytecode_list_append (bc_ctx_p, (uint8_t *) &value, sizeof (uint32_t)); } /* re_append_u32 */ /** @@ -178,7 +178,7 @@ re_insert_opcode (re_bytecode_ctx_t *bc_ctx_p, /**< RegExp bytecode context */ uint32_t offset, /**< distance from the start of the container */ re_opcode_t opcode) /**< input opcode */ { - re_bytecode_list_insert (bc_ctx_p, offset, (uint8_t*) &opcode, sizeof (uint8_t)); + re_bytecode_list_insert (bc_ctx_p, offset, (uint8_t *) &opcode, sizeof (uint8_t)); } /* re_insert_opcode */ /** @@ -189,7 +189,7 @@ re_insert_u32 (re_bytecode_ctx_t *bc_ctx_p, /**< RegExp bytecode context */ uint32_t offset, /**< distance from the start of the container */ uint32_t value) /**< input value */ { - re_bytecode_list_insert (bc_ctx_p, offset, (uint8_t*) &value, sizeof (uint32_t)); + re_bytecode_list_insert (bc_ctx_p, offset, (uint8_t *) &value, sizeof (uint32_t)); } /* re_insert_u32 */ /** @@ -209,7 +209,7 @@ re_get_opcode (uint8_t **bc_p) /**< pointer to bytecode start */ uint32_t re_get_value (uint8_t **bc_p) /**< pointer to bytecode start */ { - uint32_t value = *((uint32_t*) *bc_p); + uint32_t value = *((uint32_t *) *bc_p); (*bc_p) += sizeof (uint32_t); return value; } /* re_get_value */ @@ -223,7 +223,7 @@ re_append_char_class (void *re_ctx_p, /**< RegExp compiler context */ uint32_t end) /**< character class range to */ { /* FIXME: Handle ignore case flag and add unicode support. */ - re_compiler_ctx_t *ctx_p = (re_compiler_ctx_t*) re_ctx_p; + re_compiler_ctx_t *ctx_p = (re_compiler_ctx_t *) re_ctx_p; re_append_u32 (ctx_p->bytecode_ctx_p, start); re_append_u32 (ctx_p->bytecode_ctx_p, end); ctx_p->parser_ctx_p->num_of_classes++; diff --git a/jerry-core/rcs/rcs-chunked-list.c b/jerry-core/rcs/rcs-chunked-list.c index b1a855f5..2ad6b2da 100644 --- a/jerry-core/rcs/rcs-chunked-list.c +++ b/jerry-core/rcs/rcs-chunked-list.c @@ -155,7 +155,7 @@ rcs_chunked_list_cleanup (rcs_chunked_list_t *cl_p) /**< the chunked_list */ * * @return pointer to the first node */ -rcs_chunked_list_node_t* +rcs_chunked_list_node_t * rcs_chunked_list_get_first (rcs_chunked_list_t *cl_p) /**< the chunked_list */ { return cl_p->head_p; @@ -167,7 +167,7 @@ rcs_chunked_list_get_first (rcs_chunked_list_t *cl_p) /**< the chunked_list */ * * @return pointer to the last node */ -rcs_chunked_list_node_t* +rcs_chunked_list_node_t * rcs_chunked_list_get_last (rcs_chunked_list_t *cl_p) /**< the chunked_list */ { return cl_p->tail_p; @@ -178,7 +178,7 @@ rcs_chunked_list_get_last (rcs_chunked_list_t *cl_p) /**< the chunked_list */ * * @return pointer to previous node */ -rcs_chunked_list_node_t* +rcs_chunked_list_node_t * rcs_chunked_list_get_prev (rcs_chunked_list_node_t *node_p) /**< the node in the chunked_list */ { JERRY_ASSERT (node_p != NULL); @@ -191,7 +191,7 @@ rcs_chunked_list_get_prev (rcs_chunked_list_node_t *node_p) /**< the node in the * * @return pointer to next node */ -rcs_chunked_list_node_t* +rcs_chunked_list_node_t * rcs_chunked_list_get_next (rcs_chunked_list_node_t *node_p) /**< the node in the chunked_list */ { JERRY_ASSERT (node_p != NULL); @@ -203,12 +203,12 @@ rcs_chunked_list_get_next (rcs_chunked_list_node_t *node_p) /**< the node in the * * @return pointer to the new node */ -rcs_chunked_list_node_t* +rcs_chunked_list_node_t * rcs_chunked_list_append_new (rcs_chunked_list_t *cl_p) /**< the chunked_list */ { rcs_assert_chunked_list_is_correct (cl_p); rcs_chunked_list_node_t *node_p = - (rcs_chunked_list_node_t*) mem_heap_alloc_chunked_block (MEM_HEAP_ALLOC_LONG_TERM); + (rcs_chunked_list_node_t *) mem_heap_alloc_chunked_block (MEM_HEAP_ALLOC_LONG_TERM); rcs_chunked_list_set_prev (node_p, cl_p->tail_p); rcs_chunked_list_set_next (node_p, NULL); @@ -234,13 +234,13 @@ rcs_chunked_list_append_new (rcs_chunked_list_t *cl_p) /**< the chunked_list */ * * @return pointer to the new node */ -rcs_chunked_list_node_t* +rcs_chunked_list_node_t * rcs_chunked_list_insert_new (rcs_chunked_list_t *cl_p, /**< the chunked_list */ rcs_chunked_list_node_t *after_p) /**< the node to insert the new node after */ { rcs_assert_chunked_list_is_correct (cl_p); rcs_chunked_list_node_t *node_p = - (rcs_chunked_list_node_t*) mem_heap_alloc_chunked_block (MEM_HEAP_ALLOC_LONG_TERM); + (rcs_chunked_list_node_t *) mem_heap_alloc_chunked_block (MEM_HEAP_ALLOC_LONG_TERM); JERRY_ASSERT (cl_p->head_p != NULL); JERRY_ASSERT (cl_p->tail_p != NULL); rcs_assert_chunked_list_node_is_correct (cl_p, after_p); @@ -302,11 +302,11 @@ rcs_chunked_list_remove (rcs_chunked_list_t *cl_p, /**< the chunked_list */ * * @return pointer to the node that contains the pointed area */ -rcs_chunked_list_node_t* +rcs_chunked_list_node_t * rcs_chunked_list_get_node_from_pointer (rcs_chunked_list_t *cl_p, /**< the chunked_list */ void *ptr) /**< the pointer value */ { - rcs_chunked_list_node_t *node_p = (rcs_chunked_list_node_t*) mem_heap_get_chunked_block_start (ptr); + rcs_chunked_list_node_t *node_p = (rcs_chunked_list_node_t *) mem_heap_get_chunked_block_start (ptr); rcs_assert_chunked_list_node_is_correct (cl_p, node_p); diff --git a/jerry-core/rcs/rcs-iterator.c b/jerry-core/rcs/rcs-iterator.c index 17c3ca04..31bf0b73 100644 --- a/jerry-core/rcs/rcs-iterator.c +++ b/jerry-core/rcs/rcs-iterator.c @@ -126,11 +126,11 @@ rcs_iterator_access (rcs_iterator_t *ctx_p, /**< iterator context */ if (access_type == RCS_ITERATOR_ACCESS_READ) { - memcpy ((uint8_t *)data + first_chunk_size, next_node_data_space_p, size - first_chunk_size); + memcpy ((uint8_t *) data + first_chunk_size, next_node_data_space_p, size - first_chunk_size); } else if (access_type == RCS_ITERATOR_ACCESS_WRITE) { - memcpy (next_node_data_space_p, (uint8_t *)data + first_chunk_size, size - first_chunk_size); + memcpy (next_node_data_space_p, (uint8_t *) data + first_chunk_size, size - first_chunk_size); } else { diff --git a/jerry-core/vm/vm.c b/jerry-core/vm/vm.c index 6e61d4b8..0e051c9f 100644 --- a/jerry-core/vm/vm.c +++ b/jerry-core/vm/vm.c @@ -1987,7 +1987,7 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */ if (vm_stack_find_finally (frame_ctx_p, &stack_top_p, VM_CONTEXT_FINALLY_JUMP, - (uint32_t)branch_offset)) + (uint32_t) branch_offset)) { JERRY_ASSERT (VM_GET_CONTEXT_TYPE (stack_top_p[-1]) == VM_CONTEXT_FINALLY_JUMP); byte_code_p = frame_ctx_p->byte_code_p; diff --git a/jerry-libc/jerry-libc-printf.c b/jerry-libc/jerry-libc-printf.c index fb2e8055..339f75e6 100644 --- a/jerry-libc/jerry-libc-printf.c +++ b/jerry-libc/jerry-libc-printf.c @@ -120,7 +120,7 @@ libc_printf_justified_string_output (FILE *stream, /**< stream pointer */ /** * printf helper function that converts unsigned integer to string */ -static char* +static char * libc_printf_uint_to_string (uintmax_t value, /**< integer value */ char *buffer_p, /**< buffer for output string */ size_t buffer_size, /**< buffer size */ @@ -205,57 +205,57 @@ libc_printf_write_d_i (FILE *stream, /**< stream pointer */ /* true - positive, false - negative */ bool sign = true; const size_t bits_in_byte = 8; - const uintmax_t value_sign_mask = ((uintmax_t)1) << (sizeof (value) * bits_in_byte - 1); + const uintmax_t value_sign_mask = ((uintmax_t) 1) << (sizeof (value) * bits_in_byte - 1); switch (length) { case LIBC_PRINTF_ARG_LENGTH_TYPE_NONE: { - value = (uintmax_t)va_arg (*args_list_p, int); + value = (uintmax_t) va_arg (*args_list_p, int); break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_HH: { - value = (uintmax_t)va_arg (*args_list_p, int); /* char is promoted to int */ + value = (uintmax_t) va_arg (*args_list_p, int); /* char is promoted to int */ break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_H: { - value = (uintmax_t)va_arg (*args_list_p, int); /* short int is promoted to int */ + value = (uintmax_t) va_arg (*args_list_p, int); /* short int is promoted to int */ break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_L: { - value = (uintmax_t)va_arg (*args_list_p, long int); + value = (uintmax_t) va_arg (*args_list_p, long int); break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_LL: { - value = (uintmax_t)va_arg (*args_list_p, long long int); + value = (uintmax_t) va_arg (*args_list_p, long long int); break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_J: { - value = (uintmax_t)va_arg (*args_list_p, intmax_t); + value = (uintmax_t) va_arg (*args_list_p, intmax_t); break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_Z: { is_signed = false; - value = (uintmax_t)va_arg (*args_list_p, size_t); + value = (uintmax_t) va_arg (*args_list_p, size_t); break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_T: { is_signed = false; - value = (uintmax_t)va_arg (*args_list_p, ptrdiff_t); + value = (uintmax_t) va_arg (*args_list_p, ptrdiff_t); break; } @@ -325,49 +325,49 @@ libc_printf_write_u_o_x_X (FILE *stream, /**< stream pointer */ { case LIBC_PRINTF_ARG_LENGTH_TYPE_NONE: { - value = (uintmax_t)va_arg (*args_list_p, unsigned int); + value = (uintmax_t) va_arg (*args_list_p, unsigned int); break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_HH: { - value = (uintmax_t)va_arg (*args_list_p, unsigned int); /* char is promoted to int */ + value = (uintmax_t) va_arg (*args_list_p, unsigned int); /* char is promoted to int */ break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_H: { - value = (uintmax_t)va_arg (*args_list_p, unsigned int); /* short int is promoted to int */ + value = (uintmax_t) va_arg (*args_list_p, unsigned int); /* short int is promoted to int */ break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_L: { - value = (uintmax_t)va_arg (*args_list_p, unsigned long int); + value = (uintmax_t) va_arg (*args_list_p, unsigned long int); break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_LL: { - value = (uintmax_t)va_arg (*args_list_p, unsigned long long int); + value = (uintmax_t) va_arg (*args_list_p, unsigned long long int); break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_J: { - value = (uintmax_t)va_arg (*args_list_p, uintmax_t); + value = (uintmax_t) va_arg (*args_list_p, uintmax_t); break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_Z: { - value = (uintmax_t)va_arg (*args_list_p, size_t); + value = (uintmax_t) va_arg (*args_list_p, size_t); break; } case LIBC_PRINTF_ARG_LENGTH_TYPE_T: { - value = (uintmax_t)va_arg (*args_list_p, ptrdiff_t); + value = (uintmax_t) va_arg (*args_list_p, ptrdiff_t); break; } @@ -656,7 +656,7 @@ vfprintf (FILE *stream, /**< stream pointer */ { char str[2] = { - (char)va_arg (args_copy, int), /* char is promoted to int */ + (char) va_arg (args_copy, int), /* char is promoted to int */ '\0' }; @@ -678,7 +678,7 @@ vfprintf (FILE *stream, /**< stream pointer */ } else { - char *str_p = va_arg (args_copy, char*); + char *str_p = va_arg (args_copy, char *); libc_printf_justified_string_output (stream, str_p, @@ -693,7 +693,7 @@ vfprintf (FILE *stream, /**< stream pointer */ { va_list args_copy2; va_copy (args_copy2, args_copy); - void *value = va_arg (args_copy2, void*); + void *value = va_arg (args_copy2, void *); va_end (args_copy2); if (value == NULL) diff --git a/jerry-libc/jerry-libc.c b/jerry-libc/jerry-libc.c index 1d0be31f..8c8813de 100644 --- a/jerry-libc/jerry-libc.c +++ b/jerry-libc/jerry-libc.c @@ -32,9 +32,9 @@ static unsigned int libc_random_gen_state[4] = { 1455997910, 1999515274, 1234451 /** * Standard file descriptors */ -FILE *stdin = (FILE*) 0; -FILE *stdout = (FILE*) 1; -FILE *stderr = (FILE*) 2; +FILE *stdin = (FILE *) 0; +FILE *stdout = (FILE *) 1; +FILE *stderr = (FILE *) 2; #ifdef __GNUC__ /* diff --git a/jerry-libc/target/darwin/jerry-libc-target.c b/jerry-libc/target/darwin/jerry-libc-target.c index 6004af15..8657c99b 100644 --- a/jerry-libc/target/darwin/jerry-libc-target.c +++ b/jerry-libc/target/darwin/jerry-libc-target.c @@ -149,9 +149,9 @@ puts (const char *s) /**< string to print */ void __attr_noreturn___ __attr_used___ exit (int status) /**< status code */ { - syscall_1 (SYS_close, (long int)stdin); - syscall_1 (SYS_close, (long int)stdout); - syscall_1 (SYS_close, (long int)stderr); + syscall_1 (SYS_close, (long int) stdin); + syscall_1 (SYS_close, (long int) stdout); + syscall_1 (SYS_close, (long int) stderr); syscall_1 (SYS_exit, status); @@ -168,9 +168,9 @@ exit (int status) /**< status code */ void __attr_noreturn___ __attr_used___ abort (void) { - syscall_1 (SYS_close, (long int)stdin); - syscall_1 (SYS_close, (long int)stdout); - syscall_1 (SYS_close, (long int)stderr); + syscall_1 (SYS_close, (long int) stdin); + syscall_1 (SYS_close, (long int) stdout); + syscall_1 (SYS_close, (long int) stderr); syscall_2 (SYS_kill, syscall_0 (SYS_getpid), SIGABRT); @@ -186,7 +186,7 @@ abort (void) * @return FILE pointer - upon successful completion, * NULL - otherwise */ -FILE* +FILE * fopen (const char *path, /**< file path */ const char *mode) /**< file open mode */ { @@ -267,7 +267,7 @@ fopen (const char *path, /**< file path */ long int ret = syscall_3 (SYS_open, (long int) path, flags, access); - return (void*) (uintptr_t) (ret); + return (void *) (uintptr_t) (ret); } /* fopen */ /** @@ -289,7 +289,7 @@ rewind (FILE *stream) /**< stream pointer */ int fclose (FILE *fp) /**< stream pointer */ { - syscall_2 (SYS_close, (long int)fp, 0); + syscall_2 (SYS_close, (long int) fp, 0); return 0; } /* fclose */ @@ -303,7 +303,7 @@ fseek (FILE * fp, /**< stream pointer */ int whence) /**< specifies position type * to add offset to */ { - syscall_3 (SYS_lseek, (long int)fp, offset, whence); + syscall_3 (SYS_lseek, (long int) fp, offset, whence); return 0; } /* fseek */ @@ -314,7 +314,7 @@ fseek (FILE * fp, /**< stream pointer */ long ftell (FILE * fp) /**< stream pointer */ { - long int ret = syscall_3 (SYS_lseek, (long int)fp, 0, SEEK_CUR); + long int ret = syscall_3 (SYS_lseek, (long int) fp, 0, SEEK_CUR); return ret; } /* ftell */ @@ -342,10 +342,10 @@ fread (void *ptr, /**< address of buffer to read to */ { ret = syscall_3 (SYS_read, (long int) stream, - (long int) ((uint8_t*) ptr + bytes_read), + (long int) ((uint8_t *) ptr + bytes_read), (long int) (size * nmemb - bytes_read)); - bytes_read += (size_t)ret; + bytes_read += (size_t) ret; } while (bytes_read != size * nmemb && ret != 0); @@ -374,10 +374,10 @@ fwrite (const void *ptr, /**< data to write */ { long int ret = syscall_3 (SYS_write, (long int) stream, - (long int) ((uint8_t*) ptr + bytes_written), + (long int) ((uint8_t *) ptr + bytes_written), (long int) (size * nmemb - bytes_written)); - bytes_written += (size_t)ret; + bytes_written += (size_t) ret; } while (bytes_written != size * nmemb); diff --git a/jerry-libc/target/linux/jerry-libc-target.c b/jerry-libc/target/linux/jerry-libc-target.c index 11ee90ec..c948a2db 100644 --- a/jerry-libc/target/linux/jerry-libc-target.c +++ b/jerry-libc/target/linux/jerry-libc-target.c @@ -149,9 +149,9 @@ puts (const char *s) /**< string to print */ void __attr_noreturn___ __attr_used___ exit (int status) /**< status code */ { - syscall_1 (__NR_close, (long int)stdin); - syscall_1 (__NR_close, (long int)stdout); - syscall_1 (__NR_close, (long int)stderr); + syscall_1 (__NR_close, (long int) stdin); + syscall_1 (__NR_close, (long int) stdout); + syscall_1 (__NR_close, (long int) stderr); syscall_1 (__NR_exit_group, status); @@ -168,9 +168,9 @@ exit (int status) /**< status code */ void __attr_noreturn___ __attr_used___ abort (void) { - syscall_1 (__NR_close, (long int)stdin); - syscall_1 (__NR_close, (long int)stdout); - syscall_1 (__NR_close, (long int)stderr); + syscall_1 (__NR_close, (long int) stdin); + syscall_1 (__NR_close, (long int) stdout); + syscall_1 (__NR_close, (long int) stderr); syscall_2 (__NR_kill, syscall_0 (__NR_getpid), SIGABRT); @@ -186,7 +186,7 @@ abort (void) * @return FILE pointer - upon successful completion, * NULL - otherwise */ -FILE* +FILE * fopen (const char *path, /**< file path */ const char *mode) /**< file open mode */ { @@ -267,7 +267,7 @@ fopen (const char *path, /**< file path */ long int ret = syscall_3 (__NR_open, (long int) path, flags, access); - return (void*) (uintptr_t) (ret); + return (void *) (uintptr_t) (ret); } /* fopen */ /** @@ -289,7 +289,7 @@ rewind (FILE *stream) /**< stream pointer */ int fclose (FILE *fp) /**< stream pointer */ { - syscall_2 (__NR_close, (long int)fp, 0); + syscall_2 (__NR_close, (long int) fp, 0); return 0; } /* fclose */ @@ -303,7 +303,7 @@ fseek (FILE * fp, /**< stream pointer */ int whence) /**< specifies position type * to add offset to */ { - syscall_3 (__NR_lseek, (long int)fp, offset, whence); + syscall_3 (__NR_lseek, (long int) fp, offset, whence); return 0; } /* fseek */ @@ -314,7 +314,7 @@ fseek (FILE * fp, /**< stream pointer */ long ftell (FILE * fp) /**< stream pointer */ { - long int ret = syscall_3 (__NR_lseek, (long int)fp, 0, SEEK_CUR); + long int ret = syscall_3 (__NR_lseek, (long int) fp, 0, SEEK_CUR); return ret; } /* ftell */ @@ -342,10 +342,10 @@ fread (void *ptr, /**< address of buffer to read to */ { ret = syscall_3 (__NR_read, (long int) stream, - (long int) ((uint8_t*) ptr + bytes_read), + (long int) ((uint8_t *) ptr + bytes_read), (long int) (size * nmemb - bytes_read)); - bytes_read += (size_t)ret; + bytes_read += (size_t) ret; } while (bytes_read != size * nmemb && ret != 0); @@ -374,10 +374,10 @@ fwrite (const void *ptr, /**< data to write */ { long int ret = syscall_3 (__NR_write, (long int) stream, - (long int) ((uint8_t*) ptr + bytes_written), + (long int) ((uint8_t *) ptr + bytes_written), (long int) (size * nmemb - bytes_written)); - bytes_written += (size_t)ret; + bytes_written += (size_t) ret; } while (bytes_written != size * nmemb); diff --git a/main-unix.c b/main-unix.c index 29b066a7..977b6ce8 100644 --- a/main-unix.c +++ b/main-unix.c @@ -74,7 +74,7 @@ read_sources (const char *script_file_names[], rewind (file); - const size_t current_source_size = (size_t)script_len; + const size_t current_source_size = (size_t) script_len; if (source_buffer_tail + current_source_size >= buffer + sizeof (buffer)) { diff --git a/tools/vera++/profiles/jerry b/tools/vera++/profiles/jerry index df35d059..23fa0975 100644 --- a/tools/vera++/profiles/jerry +++ b/tools/vera++/profiles/jerry @@ -2,7 +2,6 @@ set rules { jerry_always_curly jerry_braces_on_separate_line jerry_braces_same_line_or_column - jerry_dereference_operator_always_on_right jerry_comment_function_end jerry_funcname_space_parentheses jerry_identifier_no_space_bracket @@ -12,5 +11,7 @@ set rules { jerry_no_space_before_closing_parentheses jerry_no_tabs jerry_no_trailing_spaces + jerry_pointer_declarator_space jerry_switch_case + jerry_typecast_space_parentheses } diff --git a/tools/vera++/scripts/rules/jerry_dereference_operator_always_on_right.tcl b/tools/vera++/scripts/rules/jerry_pointer_declarator_space.tcl index 445e6a08..a2768972 100644 --- a/tools/vera++/scripts/rules/jerry_dereference_operator_always_on_right.tcl +++ b/tools/vera++/scripts/rules/jerry_pointer_declarator_space.tcl @@ -18,8 +18,10 @@ foreach f [getSourceFileNames] { set lineNumber 1 foreach line [getAllLines $f] { - if {[regexp {\w\*\s\w+} $line]} { - report $f $lineNumber "pointer dereference operator always should be aligned to right." + if {[regexp {\w\*\s\w+} $line] + || [regexp {\w\*\)} $line] + || [regexp {\w\*$} $line]} { + report $f $lineNumber "there should be a space between the referenced type and the pointer declarator." } incr lineNumber } diff --git a/tools/vera++/scripts/rules/jerry_typecast_space_parentheses.tcl b/tools/vera++/scripts/rules/jerry_typecast_space_parentheses.tcl new file mode 100644 index 00000000..71212433 --- /dev/null +++ b/tools/vera++/scripts/rules/jerry_typecast_space_parentheses.tcl @@ -0,0 +1,57 @@ +#!/usr/bin/tclsh + +# Copyright 2016 Samsung Electronics Co., Ltd. +# Copyright 2016 University of Szeged. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +proc check_part_of_the_file {file line_num col_start col_end} { + if {$col_start == $col_end} { + return + } + + set line [getLine $file $line_num] + set line [string range $line $col_start $col_end] + + if {[regexp {\)\w} $line]} { + report $file $line_num "there should be exactly one space after right parentheses" + } +} + +foreach fileName [getSourceFileNames] { + set checkLine 1 + set checkColStart 0 + set seenOmitToken false + foreach token [getTokens $fileName 1 0 -1 -1 {}] { + set lineNumber [lindex $token 1] + set colNumber [lindex $token 2] + set tokenType [lindex $token 3] + + if {$checkLine != $lineNumber} { + if {!$seenOmitToken} { + check_part_of_the_file $fileName $checkLine $checkColStart end + } + set checkColStart $colNumber + set checkLine $lineNumber + } elseif {$seenOmitToken} { + set checkColStart $colNumber + } + + if {$tokenType in {ccomment cppcomment stringlit}} { + check_part_of_the_file $fileName $checkLine $checkColStart $colNumber + set seenOmitToken true + } else { + set seenOmitToken false + } + } +} |