Skip to content

Commit 9763a93

Browse files
committed
Add new coding style rules and fix appeared issues.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov [email protected]
1 parent ca12c16 commit 9763a93

File tree

89 files changed

+1152
-626
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1152
-626
lines changed

jerry-core/ecma/base/ecma-alloc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ JERRY_STATIC_ASSERT (sizeof (ecma_getter_setter_pointers_t) <= sizeof (uint64_t)
7878
* Declaration of alloc/free routine for specified ecma-type.
7979
*/
8080
#define DECLARE_ROUTINES_FOR(ecma_type) \
81-
ALLOC(ecma_type) \
82-
DEALLOC(ecma_type)
81+
ALLOC (ecma_type) \
82+
DEALLOC (ecma_type)
8383

8484
DECLARE_ROUTINES_FOR (object)
8585
DECLARE_ROUTINES_FOR (property)

jerry-core/ecma/base/ecma-gc.cpp

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ typedef enum
5555
/**
5656
* List of marked (visited during current GC session) and umarked objects
5757
*/
58-
static ecma_object_t *ecma_gc_objects_lists [ECMA_GC_COLOR__COUNT];
58+
static ecma_object_t *ecma_gc_objects_lists[ECMA_GC_COLOR__COUNT];
5959

6060
/**
6161
* Current state of an object's visited flag that indicates whether the object is in visited state:
@@ -177,8 +177,8 @@ ecma_init_gc_info (ecma_object_t *object_p) /**< object */
177177
{
178178
ecma_gc_set_object_refs (object_p, 1);
179179

180-
ecma_gc_set_object_next (object_p, ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY]);
181-
ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY] = object_p;
180+
ecma_gc_set_object_next (object_p, ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY]);
181+
ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY] = object_p;
182182

183183
/* Should be set to false at the beginning of garbage collection */
184184
ecma_gc_set_object_visited (object_p, false);
@@ -199,7 +199,7 @@ ecma_ref_object (ecma_object_t *object_p) /**< object */
199199
void
200200
ecma_deref_object (ecma_object_t *object_p) /**< object */
201201
{
202-
JERRY_ASSERT(ecma_gc_get_object_refs (object_p) > 0);
202+
JERRY_ASSERT (ecma_gc_get_object_refs (object_p) > 0);
203203
ecma_gc_set_object_refs (object_p, ecma_gc_get_object_refs (object_p) - 1);
204204
} /* ecma_deref_object */
205205

@@ -209,8 +209,8 @@ ecma_deref_object (ecma_object_t *object_p) /**< object */
209209
void
210210
ecma_gc_init (void)
211211
{
212-
ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY] = NULL;
213-
ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK] = NULL;
212+
ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY] = NULL;
213+
ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK] = NULL;
214214
} /* ecma_gc_init */
215215

216216
/**
@@ -219,7 +219,7 @@ ecma_gc_init (void)
219219
void
220220
ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
221221
{
222-
JERRY_ASSERT(object_p != NULL);
222+
JERRY_ASSERT (object_p != NULL);
223223
JERRY_ASSERT (ecma_gc_is_object_visited (object_p));
224224

225225
bool traverse_properties = true;
@@ -302,7 +302,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
302302
case ECMA_INTERNAL_PROPERTY_NUMBER_INDEXED_ARRAY_VALUES: /* a collection of ecma-values */
303303
case ECMA_INTERNAL_PROPERTY_STRING_INDEXED_ARRAY_VALUES: /* a collection of ecma-values */
304304
{
305-
JERRY_UNIMPLEMENTED("Indexed array storage is not implemented yet.");
305+
JERRY_UNIMPLEMENTED ("Indexed array storage is not implemented yet.");
306306
}
307307

308308
case ECMA_INTERNAL_PROPERTY_PROTOTYPE: /* the property's value is located in ecma_object_t
@@ -312,7 +312,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
312312
case ECMA_INTERNAL_PROPERTY__COUNT: /* not a real internal property type,
313313
* but number of the real internal property types */
314314
{
315-
JERRY_UNREACHABLE();
315+
JERRY_UNREACHABLE ();
316316
}
317317

318318
case ECMA_INTERNAL_PROPERTY_FORMAL_PARAMETERS: /* a collection of strings */
@@ -336,7 +336,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
336336
case ECMA_INTERNAL_PROPERTY_SCOPE: /* a lexical environment */
337337
case ECMA_INTERNAL_PROPERTY_PARAMETERS_MAP: /* an object */
338338
{
339-
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER(ecma_object_t, property_value);
339+
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, property_value);
340340

341341
ecma_gc_set_object_visited (obj_p, true);
342342

@@ -357,9 +357,9 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
357357
void
358358
ecma_gc_sweep (ecma_object_t *object_p) /**< object to free */
359359
{
360-
JERRY_ASSERT(object_p != NULL
361-
&& !ecma_gc_is_object_visited (object_p)
362-
&& ecma_gc_get_object_refs (object_p) == 0);
360+
JERRY_ASSERT (object_p != NULL
361+
&& !ecma_gc_is_object_visited (object_p)
362+
&& ecma_gc_get_object_refs (object_p) == 0);
363363

364364
if (!ecma_is_lexical_environment (object_p))
365365
{
@@ -405,10 +405,10 @@ ecma_gc_sweep (ecma_object_t *object_p) /**< object to free */
405405
void
406406
ecma_gc_run (void)
407407
{
408-
JERRY_ASSERT (ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK] == NULL);
408+
JERRY_ASSERT (ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK] == NULL);
409409

410410
/* if some object is referenced from stack or globals (i.e. it is root), mark it */
411-
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY];
411+
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY];
412412
obj_iter_p != NULL;
413413
obj_iter_p = ecma_gc_get_object_next (obj_iter_p))
414414
{
@@ -445,7 +445,7 @@ ecma_gc_run (void)
445445
{
446446
marked_anything_during_current_iteration = false;
447447

448-
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY], *obj_prev_p = NULL, *obj_next_p;
448+
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY], *obj_prev_p = NULL, *obj_next_p;
449449
obj_iter_p != NULL;
450450
obj_iter_p = obj_next_p)
451451
{
@@ -454,8 +454,8 @@ ecma_gc_run (void)
454454
if (ecma_gc_is_object_visited (obj_iter_p))
455455
{
456456
/* Moving the object to list of marked objects */
457-
ecma_gc_set_object_next (obj_iter_p, ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK]);
458-
ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK] = obj_iter_p;
457+
ecma_gc_set_object_next (obj_iter_p, ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK]);
458+
ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK] = obj_iter_p;
459459

460460
if (likely (obj_prev_p != NULL))
461461
{
@@ -465,7 +465,7 @@ ecma_gc_run (void)
465465
}
466466
else
467467
{
468-
ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY] = obj_next_p;
468+
ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY] = obj_next_p;
469469
}
470470

471471
ecma_gc_mark (obj_iter_p);
@@ -476,10 +476,11 @@ ecma_gc_run (void)
476476
obj_prev_p = obj_iter_p;
477477
}
478478
}
479-
} while (marked_anything_during_current_iteration);
479+
}
480+
while (marked_anything_during_current_iteration);
480481

481482
/* Sweeping objects that are currently unmarked */
482-
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY], *obj_next_p;
483+
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY], *obj_next_p;
483484
obj_iter_p != NULL;
484485
obj_iter_p = obj_next_p)
485486
{
@@ -491,8 +492,8 @@ ecma_gc_run (void)
491492
}
492493

493494
/* Unmarking all objects */
494-
ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY] = ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK];
495-
ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK] = NULL;
495+
ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY] = ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK];
496+
ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK] = NULL;
496497

497498
ecma_gc_visited_flip_flag = !ecma_gc_visited_flip_flag;
498499
} /* ecma_gc_run */

0 commit comments

Comments
 (0)