From ce905487a0ea3dabbfd6b5ade1bdaae5473ffaae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Borb=C3=A9ly?= Date: Thu, 9 Jun 2016 13:31:46 +0200 Subject: [PATCH] Introduce JERRY_UNUSED() instead of __attr_unused___ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com --- .../ecma/builtin-objects/ecma-builtin-array.c | 5 +- .../ecma-builtin-date-prototype.c | 3 +- .../ecma/builtin-objects/ecma-builtin-date.c | 15 ++++-- .../builtin-objects/ecma-builtin-global.c | 39 +++++++++----- .../ecma/builtin-objects/ecma-builtin-json.c | 6 ++- .../ecma/builtin-objects/ecma-builtin-math.c | 54 ++++++++++++------- .../builtin-objects/ecma-builtin-object.c | 36 ++++++++----- .../builtin-objects/ecma-builtin-string.c | 5 +- .../ecma/operations/ecma-try-catch-macro.h | 5 +- jerry-core/jmem/jmem-heap.c | 3 +- jerry-core/jrt/jrt.h | 8 +-- tests/unit/test-api.c | 10 ++-- tests/unit/test-date-helpers.c | 7 ++- tests/unit/test-heap.c | 3 +- tests/unit/test-libm.c | 3 +- tests/unit/test-lit-char-helpers.c | 5 +- tests/unit/test-literal-storage.c | 3 +- tests/unit/test-longjmp.c | 5 +- tests/unit/test-number-to-integer.c | 5 +- tests/unit/test-number-to-string.c | 5 +- tests/unit/test-poolman.c | 3 +- tests/unit/test-string-to-number.c | 3 +- tests/unit/test-strings.c | 3 +- 23 files changed, 137 insertions(+), 97 deletions(-) diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array.c b/jerry-core/ecma/builtin-objects/ecma-builtin-array.c index e15707c30..19f6ea92e 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-array.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array.c @@ -1,4 +1,4 @@ -/* Copyright 2014-2015 Samsung Electronics Co., Ltd. +/* Copyright 2014-2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,9 +54,10 @@ * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_array_object_is_array (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_array_object_is_array (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< first argument */ { + JERRY_UNUSED (this_arg); ecma_simple_value_t is_array = ECMA_SIMPLE_VALUE_FALSE; if (ecma_is_value_object (arg)) diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c index 05c179009..627f2ad1d 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c @@ -1166,8 +1166,9 @@ ecma_builtin_date_prototype_to_iso_string (ecma_value_t this_arg) /**< this argu */ static ecma_value_t ecma_builtin_date_prototype_to_json (ecma_value_t this_arg, /**< this argument */ - ecma_value_t arg __attr_unused___) /**< key */ + ecma_value_t arg) /**< key */ { + JERRY_UNUSED (arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); /* 1. */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-date.c b/jerry-core/ecma/builtin-objects/ecma-builtin-date.c index 6e3f8ffa7..be31df21f 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-date.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-date.c @@ -182,9 +182,10 @@ ecma_date_construct_helper (const ecma_value_t *args, /**< arguments passed to t * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_date_parse (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_date_parse (ecma_value_t this_arg, /**< this argument */ ecma_value_t arg) /**< string */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ecma_number_t date_num = ecma_number_make_nan (); @@ -398,10 +399,11 @@ ecma_builtin_date_parse (ecma_value_t this_arg __attr_unused___, /**< this argum * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_date_utc (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_date_utc (ecma_value_t this_arg, /**< this argument */ const ecma_value_t args[], /**< arguments list */ ecma_length_t args_number) /**< number of arguments */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); if (args_number < 2) @@ -433,8 +435,9 @@ ecma_builtin_date_utc (ecma_value_t this_arg __attr_unused___, /**< this argumen * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_date_now (ecma_value_t this_arg __attr_unused___) /**< this argument */ +ecma_builtin_date_now (ecma_value_t this_arg) /**< this argument */ { + JERRY_UNUSED (this_arg); return ecma_make_number_value (DOUBLE_TO_ECMA_NUMBER_T (jerry_port_get_current_time ())); } /* ecma_builtin_date_now */ @@ -447,9 +450,11 @@ ecma_builtin_date_now (ecma_value_t this_arg __attr_unused___) /**< this argumen * @return ecma value */ ecma_value_t -ecma_builtin_date_dispatch_call (const ecma_value_t *arguments_list_p __attr_unused___, /**< arguments list */ - ecma_length_t arguments_list_len __attr_unused___) /**< number of arguments */ +ecma_builtin_date_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ + ecma_length_t arguments_list_len) /**< number of arguments */ { + JERRY_UNUSED (arguments_list_p); + JERRY_UNUSED (arguments_list_len); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_TRY_CATCH (now_val, diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-global.c b/jerry-core/ecma/builtin-objects/ecma-builtin-global.c index 60e3eca22..48663d208 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-global.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-global.c @@ -61,10 +61,11 @@ * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_print (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_global_object_print (ecma_value_t this_arg, /**< this argument */ const ecma_value_t args[], /**< arguments list */ ecma_length_t args_number) /**< number of arguments */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); /* TODO: Move the 'print' routine out of engine core. */ @@ -148,9 +149,10 @@ ecma_builtin_global_object_print (ecma_value_t this_arg __attr_unused___, /**< t * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_eval (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_global_object_eval (ecma_value_t this_arg, /**< this argument */ ecma_value_t x) /**< routine's first argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); bool is_direct_eval = vm_is_direct_eval_form_call (); @@ -192,10 +194,11 @@ ecma_builtin_global_object_eval (ecma_value_t this_arg __attr_unused___, /**< th * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_parse_int (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_global_object_parse_int (ecma_value_t this_arg, /**< this argument */ ecma_value_t string, /**< routine's first argument */ ecma_value_t radix) /**< routine's second argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); /* 1. */ @@ -403,9 +406,10 @@ ecma_builtin_global_object_parse_int (ecma_value_t this_arg __attr_unused___, /* * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_parse_float (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_global_object_parse_float (ecma_value_t this_arg, /**< this argument */ ecma_value_t string) /**< routine's first argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); /* 1. */ @@ -621,9 +625,10 @@ ecma_builtin_global_object_parse_float (ecma_value_t this_arg __attr_unused___, * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_is_nan (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_global_object_is_nan (ecma_value_t this_arg, /**< this argument */ ecma_value_t arg) /**< routine's first argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -648,9 +653,10 @@ ecma_builtin_global_object_is_nan (ecma_value_t this_arg __attr_unused___, /**< * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_is_finite (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_global_object_is_finite (ecma_value_t this_arg, /**< this argument */ ecma_value_t arg) /**< routine's first argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -720,9 +726,10 @@ static const uint8_t unescaped_uri_component_set[16] = * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri __attr_unused___, /**< uri argument */ +ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri, /**< uri argument */ const uint8_t *reserved_uri_bitset) /**< reserved characters bitset */ { + JERRY_UNUSED (uri); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_TRY_CATCH (string, @@ -949,9 +956,10 @@ ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri __attr_unused___, * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_decode_uri (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_global_object_decode_uri (ecma_value_t this_arg, /**< this argument */ ecma_value_t encoded_uri) /**< routine's first argument */ { + JERRY_UNUSED (this_arg); return ecma_builtin_global_object_decode_uri_helper (encoded_uri, unescaped_uri_set); } /* ecma_builtin_global_object_decode_uri */ @@ -965,10 +973,11 @@ ecma_builtin_global_object_decode_uri (ecma_value_t this_arg __attr_unused___, / * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_decode_uri_component (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_global_object_decode_uri_component (ecma_value_t this_arg, /**< this argument */ ecma_value_t encoded_uri_component) /**< routine's * first argument */ { + JERRY_UNUSED (this_arg); return ecma_builtin_global_object_decode_uri_helper (encoded_uri_component, unescaped_uri_component_set); } /* ecma_builtin_global_object_decode_uri_component */ @@ -1159,9 +1168,10 @@ ecma_builtin_global_object_encode_uri_helper (ecma_value_t uri, /**< uri argumen * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_encode_uri (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_global_object_encode_uri (ecma_value_t this_arg, /**< this argument */ ecma_value_t uri) /**< routine's first argument */ { + JERRY_UNUSED (this_arg); return ecma_builtin_global_object_encode_uri_helper (uri, unescaped_uri_set); } /* ecma_builtin_global_object_encode_uri */ @@ -1175,9 +1185,10 @@ ecma_builtin_global_object_encode_uri (ecma_value_t this_arg __attr_unused___, / * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_encode_uri_component (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_global_object_encode_uri_component (ecma_value_t this_arg, /**< this argument */ ecma_value_t uri_component) /**< routine's first argument */ { + JERRY_UNUSED (this_arg); return ecma_builtin_global_object_encode_uri_helper (uri_component, unescaped_uri_component_set); } /* ecma_builtin_global_object_encode_uri_component */ @@ -1215,9 +1226,10 @@ static const uint8_t ecma_escape_set[16] = * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_escape (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_global_object_escape (ecma_value_t this_arg, /**< this argument */ ecma_value_t arg) /**< routine's first argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_TRY_CATCH (string, @@ -1335,9 +1347,10 @@ ecma_builtin_global_object_escape (ecma_value_t this_arg __attr_unused___, /**< * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_global_object_unescape (ecma_value_t this_arg __attr_unused___, /**< this argument */ +ecma_builtin_global_object_unescape (ecma_value_t this_arg, /**< this argument */ ecma_value_t arg) /**< routine's first argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); /* 1. */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-json.c b/jerry-core/ecma/builtin-objects/ecma-builtin-json.c index 4239e2aca..de299c928 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-json.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-json.c @@ -696,10 +696,11 @@ ecma_builtin_json_walk (ecma_object_t *reviver_p, /**< reviver function */ * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_json_parse (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_json_parse (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg1, /**< string argument */ ecma_value_t arg2) /**< reviver argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_TRY_CATCH (string, @@ -790,11 +791,12 @@ ecma_builtin_json_array (ecma_object_t *obj_p, ecma_json_stringify_context_t *co * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_json_stringify (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_json_stringify (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg1, /**< value */ ecma_value_t arg2, /**< replacer */ ecma_value_t arg3) /**< space */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ecma_json_stringify_context_t context; diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-math.c b/jerry-core/ecma/builtin-objects/ecma-builtin-math.c index cb57b39f2..de7361d36 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-math.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-math.c @@ -59,9 +59,10 @@ * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_abs (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_abs (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -83,9 +84,10 @@ ecma_builtin_math_object_abs (ecma_value_t this_arg __attr_unused___, /**< 'this * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_acos (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_acos (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -106,9 +108,10 @@ ecma_builtin_math_object_acos (ecma_value_t this_arg __attr_unused___, /**< 'thi * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_asin (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_asin (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -129,9 +132,10 @@ ecma_builtin_math_object_asin (ecma_value_t this_arg __attr_unused___, /**< 'thi * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_atan (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_atan (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -152,10 +156,11 @@ ecma_builtin_math_object_atan (ecma_value_t this_arg __attr_unused___, /**< 'thi * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_atan2 (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_atan2 (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg1, /**< first routine's argument */ ecma_value_t arg2) /**< second routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (x, arg1, ret_value); @@ -178,9 +183,10 @@ ecma_builtin_math_object_atan2 (ecma_value_t this_arg __attr_unused___, /**< 'th * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_ceil (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_ceil (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -201,9 +207,10 @@ ecma_builtin_math_object_ceil (ecma_value_t this_arg __attr_unused___, /**< 'thi * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_cos (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_cos (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -224,9 +231,10 @@ ecma_builtin_math_object_cos (ecma_value_t this_arg __attr_unused___, /**< 'this * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_exp (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_exp (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -248,9 +256,10 @@ ecma_builtin_math_object_exp (ecma_value_t this_arg __attr_unused___, /**< 'this * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_floor (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_floor (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -271,9 +280,10 @@ ecma_builtin_math_object_floor (ecma_value_t this_arg __attr_unused___, /**< 'th * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_log (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_log (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -295,10 +305,11 @@ ecma_builtin_math_object_log (ecma_value_t this_arg __attr_unused___, /**< 'this * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_max (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_max (ecma_value_t this_arg, /**< 'this' argument */ const ecma_value_t args[], /**< arguments list */ ecma_length_t args_number) /**< number of arguments */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ecma_number_t ret_num = ecma_number_make_infinity (true); @@ -375,10 +386,11 @@ ecma_builtin_math_object_max (ecma_value_t this_arg __attr_unused___, /**< 'this * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_min (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_min (ecma_value_t this_arg, /**< 'this' argument */ const ecma_value_t args[], /**< arguments list */ ecma_length_t args_number) /**< number of arguments */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ecma_number_t ret_num = ecma_number_make_infinity (false); @@ -455,10 +467,11 @@ ecma_builtin_math_object_min (ecma_value_t this_arg __attr_unused___, /**< 'this * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_pow (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_pow (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg1, /**< first routine's argument */ ecma_value_t arg2) /**< second routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (x, arg1, ret_value); @@ -482,8 +495,9 @@ ecma_builtin_math_object_pow (ecma_value_t this_arg __attr_unused___, /**< 'this * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_random (ecma_value_t this_arg __attr_unused___) /**< 'this' argument */ +ecma_builtin_math_object_random (ecma_value_t this_arg) /**< 'this' argument */ { + JERRY_UNUSED (this_arg); uint32_t rnd = 1; uint32_t reps_count; #if RAND_MAX < 0x100 @@ -518,9 +532,10 @@ ecma_builtin_math_object_random (ecma_value_t this_arg __attr_unused___) /**< 't * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_round (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_round (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -572,9 +587,10 @@ ecma_builtin_math_object_round (ecma_value_t this_arg __attr_unused___, /**< 'th * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_sin (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_sin (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -595,9 +611,10 @@ ecma_builtin_math_object_sin (ecma_value_t this_arg __attr_unused___, /**< 'this * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_sqrt (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_sqrt (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); @@ -618,9 +635,10 @@ ecma_builtin_math_object_sqrt (ecma_value_t this_arg __attr_unused___, /**< 'thi * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_math_object_tan (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_math_object_tan (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-object.c b/jerry-core/ecma/builtin-objects/ecma-builtin-object.c index 198a7307a..3a022dea0 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-object.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-object.c @@ -105,9 +105,10 @@ ecma_builtin_object_dispatch_construct (const ecma_value_t *arguments_list_p, /* * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_object_object_get_prototype_of (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_object_object_get_prototype_of (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); /* 1. */ @@ -145,9 +146,10 @@ ecma_builtin_object_object_get_prototype_of (ecma_value_t this_arg __attr_unused * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_object_object_get_own_property_names (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_object_object_get_own_property_names (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); if (!ecma_is_value_object (arg)) @@ -175,9 +177,10 @@ ecma_builtin_object_object_get_own_property_names (ecma_value_t this_arg __attr_ * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_object_object_seal (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_object_object_seal (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); // 1. @@ -247,9 +250,10 @@ ecma_builtin_object_object_seal (ecma_value_t this_arg __attr_unused___, /**< 't * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_object_object_freeze (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_object_object_freeze (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); // 1. @@ -327,9 +331,10 @@ ecma_builtin_object_object_freeze (ecma_value_t this_arg __attr_unused___, /**< * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_object_object_prevent_extensions (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_object_object_prevent_extensions (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); if (!ecma_is_value_object (arg)) @@ -357,9 +362,10 @@ ecma_builtin_object_object_prevent_extensions (ecma_value_t this_arg __attr_unus * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_object_object_is_sealed (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_object_object_is_sealed (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); // 1. @@ -425,9 +431,10 @@ ecma_builtin_object_object_is_sealed (ecma_value_t this_arg __attr_unused___, /* * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_object_object_is_frozen (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_object_object_is_frozen (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); // 1. @@ -503,9 +510,10 @@ ecma_builtin_object_object_is_frozen (ecma_value_t this_arg __attr_unused___, /* * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_object_object_is_extensible (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_object_object_is_extensible (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); if (!ecma_is_value_object (arg)) @@ -535,9 +543,10 @@ ecma_builtin_object_object_is_extensible (ecma_value_t this_arg __attr_unused___ * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_object_object_keys (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_object_object_keys (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg) /**< routine's argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); if (!ecma_is_value_object (arg)) @@ -565,10 +574,11 @@ ecma_builtin_object_object_keys (ecma_value_t this_arg __attr_unused___, /**< 't * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_object_object_get_own_property_descriptor (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_object_object_get_own_property_descriptor (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg1, /**< routine's first argument */ ecma_value_t arg2) /**< routine's second argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); // 1. @@ -676,10 +686,11 @@ ecma_builtin_object_object_create (ecma_value_t this_arg, /**< 'this' argument * * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_object_object_define_properties (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_object_object_define_properties (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg1, /**< routine's first argument */ ecma_value_t arg2) /**< routine's second argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); // 1. @@ -782,11 +793,12 @@ ecma_builtin_object_object_define_properties (ecma_value_t this_arg __attr_unuse * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_object_object_define_property (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_object_object_define_property (ecma_value_t this_arg, /**< 'this' argument */ ecma_value_t arg1, /**< routine's first argument */ ecma_value_t arg2, /**< routine's second argument */ ecma_value_t arg3) /**< routine's third argument */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); if (!ecma_is_value_object (arg1)) diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string.c b/jerry-core/ecma/builtin-objects/ecma-builtin-string.c index 33eb1f33a..53ee17d09 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-string.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string.c @@ -1,4 +1,4 @@ -/* Copyright 2014-2015 Samsung Electronics Co., Ltd. +/* Copyright 2014-2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,10 +54,11 @@ * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_string_object_from_char_code (ecma_value_t this_arg __attr_unused___, /**< 'this' argument */ +ecma_builtin_string_object_from_char_code (ecma_value_t this_arg, /**< 'this' argument */ const ecma_value_t args[], /**< arguments list */ ecma_length_t args_number) /**< number of arguments */ { + JERRY_UNUSED (this_arg); ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY); ecma_string_t *ret_string_p = NULL; diff --git a/jerry-core/ecma/operations/ecma-try-catch-macro.h b/jerry-core/ecma/operations/ecma-try-catch-macro.h index 9905192bd..b02ccae61 100644 --- a/jerry-core/ecma/operations/ecma-try-catch-macro.h +++ b/jerry-core/ecma/operations/ecma-try-catch-macro.h @@ -1,4 +1,4 @@ -/* Copyright 2014-2015 Samsung Electronics Co., Ltd. +/* Copyright 2014-2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,8 @@ } \ else \ { \ - ecma_value_t var __attr_unused___ = var ## _completion; + ecma_value_t var = var ## _completion; \ + JERRY_UNUSED (var); /** * The macro marks end of code block that is defined by corresponding diff --git a/jerry-core/jmem/jmem-heap.c b/jerry-core/jmem/jmem-heap.c index 03f839dab..32fdaf250 100644 --- a/jerry-core/jmem/jmem-heap.c +++ b/jerry-core/jmem/jmem-heap.c @@ -199,8 +199,7 @@ static void jmem_heap_stat_free_iter (); void jmem_heap_init (void) { - JERRY_STATIC_ASSERT ((uintptr_t) jmem_heap.area % JMEM_ALIGNMENT == 0, - jmem_heap_area_must_be_multiple_of_MEM_ALIGNMENT); + JERRY_ASSERT ((uintptr_t) jmem_heap.area % JMEM_ALIGNMENT == 0); JERRY_STATIC_ASSERT ((1u << JMEM_HEAP_OFFSET_LOG) >= JMEM_HEAP_SIZE, two_pow_mem_heap_offset_should_not_be_less_than_mem_heap_size); diff --git a/jerry-core/jrt/jrt.h b/jerry-core/jrt/jrt.h index bec7657b8..b9f3f88cc 100644 --- a/jerry-core/jrt/jrt.h +++ b/jerry-core/jrt/jrt.h @@ -26,7 +26,6 @@ /** * Attributes */ -#define __attr_unused___ __attribute__((unused)) #define __noreturn __attribute__((noreturn)) #define __attr_noinline___ __attribute__((noinline)) #define __attr_return_value_should_be_checked___ __attribute__((warn_unused_result)) @@ -57,11 +56,10 @@ * __LINE__ may be the same for asserts in a header * and in an implementation file. */ -#define JERRY_STATIC_ASSERT_GLUE_(a, b, c) a ## b ## c +#define JERRY_STATIC_ASSERT_GLUE_(a, b, c) a ## b ## _ ## c #define JERRY_STATIC_ASSERT_GLUE(a, b, c) JERRY_STATIC_ASSERT_GLUE_ (a, b, c) #define JERRY_STATIC_ASSERT(x, msg) \ - typedef char JERRY_STATIC_ASSERT_GLUE (static_assertion_failed_, __LINE__, msg) \ - [ (x) ? 1 : -1 ] __attr_unused___ + enum { JERRY_STATIC_ASSERT_GLUE (static_assertion_failed_, __LINE__, msg) = 1 / (!!(x)) } /** * Variable that must not be referenced. @@ -81,6 +79,8 @@ extern void __noreturn jerry_unimplemented (const char *, const char *, const ch #define JERRY_ASSERT(x) do { if (false) { (void)(x); } } while (0) #endif /* !JERRY_NDEBUG */ +#define JERRY_UNUSED(x) ((void) (x)) + #ifdef JERRY_ENABLE_LOG #define JERRY_LOG(lvl, ...) \ do \ diff --git a/tests/unit/test-api.c b/tests/unit/test-api.c index 3f3bd638d..5c4f86519 100644 --- a/tests/unit/test-api.c +++ b/tests/unit/test-api.c @@ -288,12 +288,10 @@ static bool foreach (const jerry_string_t *name, return true; } /* foreach */ -#define UNUSED(x) (void)(x) - static bool foreach_exception (const jerry_string_t *name, const jerry_value_t *value, void * user_data) { - UNUSED (value); - UNUSED (user_data); + JERRY_UNUSED (value); + JERRY_UNUSED (user_data); char str_buf_p[128]; jerry_size_t sz = jerry_string_to_char_buffer (name, (jerry_char_t *) str_buf_p, 128); str_buf_p[sz] = '\0'; @@ -307,8 +305,8 @@ static bool foreach_exception (const jerry_string_t *name, const jerry_value_t * static bool foreach_subset (const jerry_string_t *name, const jerry_value_t *value, void *user_data) { - UNUSED (name); - UNUSED (value); + JERRY_UNUSED (name); + JERRY_UNUSED (value); int *count_p = (int *) (user_data); if (*count_p == 3) diff --git a/tests/unit/test-date-helpers.c b/tests/unit/test-date-helpers.c index df458481a..0768cf551 100644 --- a/tests/unit/test-date-helpers.c +++ b/tests/unit/test-date-helpers.c @@ -1,5 +1,5 @@ -/* Copyright 2015 Samsung Electronics Co., Ltd. - * Copyright 2015 University of Szeged. +/* Copyright 2015-2016 Samsung Electronics Co., Ltd. + * Copyright 2015-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. @@ -32,8 +32,7 @@ * Unit test's main function. */ int -main (int __attr_unused___ argc, - char __attr_unused___ **argv) +main () { /* int ecma_date_day (time)*/ diff --git a/tests/unit/test-heap.c b/tests/unit/test-heap.c index 6a92031fb..a9df01c73 100644 --- a/tests/unit/test-heap.c +++ b/tests/unit/test-heap.c @@ -69,8 +69,7 @@ test_heap_give_some_memory_back (jmem_free_unused_memory_severity_t severity) } /* test_heap_give_some_memory_back */ int -main (int __attr_unused___ argc, - char __attr_unused___ **argv) +main () { TEST_INIT (); diff --git a/tests/unit/test-libm.c b/tests/unit/test-libm.c index 4f4069591..a11a13018 100644 --- a/tests/unit/test-libm.c +++ b/tests/unit/test-libm.c @@ -73,8 +73,7 @@ check_double (const char *expr, double computed, double expected) } /* check_double */ int -main (int __attr_unused___ argc, - char __attr_unused___ **argv) +main () { #define INF INFINITY #include "test-libm.inc.h" diff --git a/tests/unit/test-lit-char-helpers.c b/tests/unit/test-lit-char-helpers.c index 02594f847..d41c166cd 100644 --- a/tests/unit/test-lit-char-helpers.c +++ b/tests/unit/test-lit-char-helpers.c @@ -1,4 +1,4 @@ -/* Copyright 2015 Samsung Electronics Co., Ltd. +/* Copyright 2015-2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,7 @@ #include "test-common.h" int -main (int __attr_unused___ argc, - char __attr_unused___ **argv) +main () { TEST_INIT (); diff --git a/tests/unit/test-literal-storage.c b/tests/unit/test-literal-storage.c index 38e9e1729..9be807e30 100644 --- a/tests/unit/test-literal-storage.c +++ b/tests/unit/test-literal-storage.c @@ -81,8 +81,7 @@ compare_utf8_string_and_string_literal (const lit_utf8_byte_t *str_p, lit_utf8_s } /* compare_utf8_string_and_string_literal */ int -main (int __attr_unused___ argc, - char __attr_unused___ **argv) +main () { TEST_INIT (); diff --git a/tests/unit/test-longjmp.c b/tests/unit/test-longjmp.c index 51e1149d4..9fc8e296d 100644 --- a/tests/unit/test-longjmp.c +++ b/tests/unit/test-longjmp.c @@ -1,4 +1,4 @@ -/* Copyright 2015 Samsung Electronics Co., Ltd. +/* Copyright 2015-2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,8 +68,7 @@ test_setjmp_longjmp (volatile int depth) } /* test_setjmp_longjmp */ int -main (int __attr_unused___ argc, - char __attr_unused___ **argv) +main () { TEST_INIT (); diff --git a/tests/unit/test-number-to-integer.c b/tests/unit/test-number-to-integer.c index fbd42f9ca..2eada56f1 100644 --- a/tests/unit/test-number-to-integer.c +++ b/tests/unit/test-number-to-integer.c @@ -1,4 +1,4 @@ -/* Copyright 2015 Samsung Electronics Co., Ltd. +/* Copyright 2015-2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,8 +34,7 @@ typedef struct * Unit test's main function. */ int -main (int __attr_unused___ argc, - char __attr_unused___ **argv) +main () { TEST_INIT (); diff --git a/tests/unit/test-number-to-string.c b/tests/unit/test-number-to-string.c index b663492d1..c03e5e264 100644 --- a/tests/unit/test-number-to-string.c +++ b/tests/unit/test-number-to-string.c @@ -1,4 +1,4 @@ -/* Copyright 2014-2015 Samsung Electronics Co., Ltd. +/* Copyright 2014-2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,7 @@ * Unit test's main function. */ int -main (int __attr_unused___ argc, - char __attr_unused___ **argv) +main () { TEST_INIT (); diff --git a/tests/unit/test-poolman.c b/tests/unit/test-poolman.c index ae838284b..ea66cfff8 100644 --- a/tests/unit/test-poolman.c +++ b/tests/unit/test-poolman.c @@ -35,8 +35,7 @@ uint8_t *ptrs[TEST_MAX_SUB_ITERS]; uint8_t data[TEST_MAX_SUB_ITERS][JMEM_POOL_CHUNK_SIZE]; int -main (int __attr_unused___ argc, - char __attr_unused___ **argv) +main () { TEST_INIT (); diff --git a/tests/unit/test-string-to-number.c b/tests/unit/test-string-to-number.c index 2a90182bc..5ede32cee 100644 --- a/tests/unit/test-string-to-number.c +++ b/tests/unit/test-string-to-number.c @@ -23,8 +23,7 @@ * Unit test's main function. */ int -main (int __attr_unused___ argc, - char __attr_unused___ **argv) +main () { TEST_INIT (); diff --git a/tests/unit/test-strings.c b/tests/unit/test-strings.c index 7e704c551..e4a47e951 100644 --- a/tests/unit/test-strings.c +++ b/tests/unit/test-strings.c @@ -102,8 +102,7 @@ generate_cesu8_string (lit_utf8_byte_t *buf_p, } /* generate_cesu8_string */ int -main (int __attr_unused___ argc, - char __attr_unused___ **argv) +main () { TEST_INIT ();