Skip to content

Fix style issues and improve vera++ rules. #896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jerry-core/ecma/base/ecma-alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
}

/**
Expand Down
2 changes: 1 addition & 1 deletion jerry-core/ecma/base/ecma-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
20 changes: 10 additions & 10 deletions jerry-core/ecma/base/ecma-globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion jerry-core/ecma/base/ecma-helpers-conversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
36 changes: 18 additions & 18 deletions jerry-core/ecma/base/ecma-helpers-string.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 ();
Expand All @@ -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);
Expand All @@ -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 ());
Expand All @@ -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 */
{
Expand Down Expand Up @@ -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 */
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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:
{
Expand Down Expand Up @@ -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:
{
Expand Down Expand Up @@ -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:
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
26 changes: 13 additions & 13 deletions jerry-core/ecma/base/ecma-helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 ();
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
{
Expand Down Expand Up @@ -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 */
{
Expand Down Expand Up @@ -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 */
{
Expand All @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
{
Expand Down Expand Up @@ -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 */
{
Expand All @@ -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 */
{
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Loading