Skip to content

Commit db36e94

Browse files
committed
Avoid (void) and use JERRY_UNUSED
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss [email protected]
1 parent cad9ba1 commit db36e94

File tree

10 files changed

+21
-21
lines changed

10 files changed

+21
-21
lines changed

jerry-core/ecma/base/ecma-helpers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,8 +1038,8 @@ ecma_assert_object_contains_the_property (const ecma_object_t *object_p, /**< ec
10381038
JERRY_UNREACHABLE ();
10391039

10401040
#else /* JERRY_NDEBUG */
1041-
(void) object_p;
1042-
(void) prop_p;
1041+
JERRY_UNUSED (object_p);
1042+
JERRY_UNUSED (prop_p);
10431043
#endif /* !JERRY_NDEBUG */
10441044
} /* ecma_assert_object_contains_the_property */
10451045

jerry-core/ecma/base/ecma-property-hashmap.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ ecma_property_hashmap_create (ecma_object_t *object_p) /**< object */
209209
prop_iter_p->next_property_cp);
210210
}
211211
#else /* CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
212-
(void) object_p;
212+
JERRY_UNUSED (object_p);
213213
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
214214
} /* ecma_property_hashmap_create */
215215

@@ -234,7 +234,7 @@ ecma_property_hashmap_free (ecma_object_t *object_p) /**< object */
234234
jmem_heap_free_block (hashmap_p,
235235
ECMA_PROPERTY_HASHMAP_GET_TOTAL_SIZE (hashmap_p->max_property_count));
236236
#else /* CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
237-
(void) object_p;
237+
JERRY_UNUSED (object_p);
238238
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
239239
} /* ecma_property_hashmap_free */
240240

@@ -315,10 +315,10 @@ ecma_property_hashmap_insert (ecma_object_t *object_p, /**< object */
315315
*bits_p = (uint8_t) ((*bits_p) | mask);
316316
}
317317
#else /* CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
318-
(void) object_p;
319-
(void) name_p;
320-
(void) property_pair_p;
321-
(void) property_index;
318+
JERRY_UNUSED (object_p);
319+
JERRY_UNUSED (name_p);
320+
JERRY_UNUSED (property_pair_p);
321+
JERRY_UNUSED (property_index);
322322
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
323323
} /* ecma_property_hashmap_insert */
324324

@@ -394,9 +394,9 @@ ecma_property_hashmap_delete (ecma_object_t *object_p, /**< object */
394394
#endif /* !JERRY_NDEBUG */
395395
}
396396
#else /* CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
397-
(void) object_p;
398-
(void) name_p;
399-
(void) property_p;
397+
JERRY_UNUSED (object_p);
398+
JERRY_UNUSED (name_p);
399+
JERRY_UNUSED (property_p);
400400
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
401401
} /* ecma_property_hashmap_delete */
402402

jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ DISPATCH_ROUTINE_ROUTINE_NAME (uint16_t builtin_routine_id, /**< built-in wide r
124124
arguments' list */
125125
{
126126
/* the arguments may be unused for some built-ins */
127-
(void) this_arg_value;
128-
(void) arguments_list;
129-
(void) arguments_number;
127+
JERRY_UNUSED (this_arg_value);
128+
JERRY_UNUSED (arguments_list);
129+
JERRY_UNUSED (arguments_number);
130130

131131
switch (builtin_routine_id)
132132
{

jerry-core/ecma/builtin-objects/ecma-builtins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
567567
&& ecma_builtin_function_is_routine (object_p))
568568
{
569569
ecma_collection_header_t *for_enumerable_p = main_collection_p;
570-
(void) for_enumerable_p;
570+
JERRY_UNUSED (for_enumerable_p);
571571

572572
ecma_collection_header_t *for_non_enumerable_p = separate_enumerable ? non_enum_collection_p : main_collection_p;
573573

jerry-core/ecma/operations/ecma-exceptions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ ecma_new_standard_error (ecma_standard_error_t error_type) /**< native error typ
8585
}
8686
}
8787
#else
88-
(void) error_type;
88+
JERRY_UNUSED (error_type);
8989
ecma_builtin_id_t prototype_id = ECMA_BUILTIN_ID_ERROR_PROTOTYPE;
9090
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
9191

jerry-core/ecma/operations/ecma-function-object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ ecma_op_function_list_lazy_property_names (bool separate_enumerable, /**< true -
248248
* collection */
249249
{
250250
ecma_collection_header_t *for_enumerable_p = main_collection_p;
251-
(void) for_enumerable_p;
251+
JERRY_UNUSED (for_enumerable_p);
252252

253253
ecma_collection_header_t *for_non_enumerable_p = separate_enumerable ? non_enum_collection_p : main_collection_p;
254254

jerry-core/ecma/operations/ecma-string-object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ ecma_op_string_list_lazy_property_names (ecma_object_t *obj_p, /**< a String obj
233233
ecma_collection_header_t *for_enumerable_p = main_collection_p;
234234

235235
ecma_collection_header_t *for_non_enumerable_p = separate_enumerable ? main_collection_p : non_enum_collection_p;
236-
(void) for_non_enumerable_p;
236+
JERRY_UNUSED (for_non_enumerable_p);
237237

238238
ecma_property_t *prim_value_prop_p = ecma_get_internal_property (obj_p,
239239
ECMA_INTERNAL_PROPERTY_ECMA_VALUE);

jerry-core/jmem/jmem-allocator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jmem_finalize (bool is_show_mem_stats) /**< show heap memory stats
5151
jmem_stats_print ();
5252
}
5353
#else /* !JMEM_STATS */
54-
(void) is_show_mem_stats;
54+
JERRY_UNUSED (is_show_mem_stats);
5555
#endif /* JMEM_STATS */
5656

5757
jmem_heap_finalize ();

jerry-core/parser/js/js-lexer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,7 @@ lexer_construct_regexp_object (parser_context_t *context_p, /**< context */
18361836
context_p->lit_object.index = (uint16_t) (context_p->literal_count - 1);
18371837
context_p->lit_object.type = LEXER_LITERAL_OBJECT_ANY;
18381838
#else /* CONFIG_DISABLE_REGEXP_BUILTIN */
1839-
(void) parse_only;
1839+
JERRY_UNUSED (parse_only);
18401840
parser_raise_error (context_p, PARSER_ERR_UNSUPPORTED_REGEXP);
18411841
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
18421842
} /* lexer_construct_regexp_object */

jerry-core/parser/js/js-parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2235,7 +2235,7 @@ parser_set_show_instrs (int show_instrs) /**< flag indicating whether to dump by
22352235
#ifdef PARSER_DUMP_BYTE_CODE
22362236
parser_show_instrs = show_instrs;
22372237
#else /* !PARSER_DUMP_BYTE_CODE */
2238-
(void) show_instrs;
2238+
JERRY_UNUSED (show_instrs);
22392239
#endif /* PARSER_DUMP_BYTE_CODE */
22402240
} /* parser_set_show_instrs */
22412241

0 commit comments

Comments
 (0)