Fix style issues and improve vera++ rules.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2016-02-17 14:59:36 +00:00
parent db26cb2b79
commit a7715a5d78
35 changed files with 232 additions and 172 deletions
+1 -1
View File
@@ -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); \
}
/**
+1 -1
View File
@@ -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);
+10 -10
View File
@@ -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
@@ -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;
+18 -18
View File
@@ -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);
+13 -13
View File
@@ -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);