From 3a8d3b3bccdd0c3bd11b76b2455522ee22eefc89 Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Mon, 18 Apr 2016 17:09:15 +0200 Subject: [PATCH] Unifiy the comments of preprocessor conditionals JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu --- jerry-core/config.h | 10 ++++---- jerry-core/ecma/base/ecma-globals.h | 4 ++-- .../ecma/base/ecma-helpers-conversion.c | 4 ++-- jerry-core/ecma/base/ecma-helpers-number.c | 2 +- jerry-core/ecma/base/ecma-helpers-string.c | 2 +- jerry-core/ecma/base/ecma-helpers-value.c | 6 ++--- jerry-core/ecma/base/ecma-helpers.c | 2 +- jerry-core/ecma/base/ecma-lcache.c | 4 ++-- .../ecma-builtin-date-prototype.c | 2 +- .../ecma-builtin-date-prototype.inc.h | 6 ++--- .../builtin-objects/ecma-builtin-global.c | 2 +- .../builtin-objects/ecma-builtin-global.inc.h | 6 ++--- ...a-builtin-internal-routines-template.inc.h | 2 +- .../ecma/builtin-objects/ecma-builtin-math.c | 4 ++-- .../ecma-builtin-regexp-prototype.inc.h | 6 ++--- .../ecma-builtin-string-prototype.c | 2 +- .../ecma/builtin-objects/ecma-builtins.c | 18 +++++++------- .../ecma/builtin-objects/ecma-builtins.inc.h | 2 +- .../ecma/operations/ecma-array-object.c | 4 ++-- .../ecma/operations/ecma-boolean-object.c | 6 ++--- jerry-core/ecma/operations/ecma-exceptions.c | 4 ++-- jerry-core/ecma/operations/ecma-lex-env.c | 2 +- .../ecma/operations/ecma-number-object.c | 6 ++--- .../ecma/operations/ecma-string-object.c | 4 ++-- jerry-core/jerry-api.h | 4 ++-- jerry-core/jerry-internal.h | 2 +- jerry-core/jerry-port.h | 4 ++-- jerry-core/jerry.c | 18 +++++++------- jerry-core/jerry.h | 4 ++-- jerry-core/jrt/jrt-fatals.c | 14 +++++------ jerry-core/jrt/jrt.h | 10 ++++---- jerry-core/mem/mem-allocator.c | 4 ++-- jerry-core/mem/mem-heap.c | 14 +++++------ jerry-core/mem/mem-heap.h | 4 ++-- jerry-core/mem/mem-poolman.c | 6 ++--- jerry-core/parser/js/common.h | 8 +++---- jerry-core/parser/js/js-lexer.c | 2 +- jerry-core/parser/js/js-parser-internal.h | 2 +- jerry-core/parser/js/js-parser-limits.h | 10 ++++---- jerry-core/parser/js/js-parser-statm.c | 24 +++++++++---------- jerry-core/parser/js/js-parser-util.c | 10 ++++---- jerry-core/parser/js/js-parser.c | 14 +++++------ jerry-core/parser/regexp/re-bytecode.h | 2 +- jerry-core/parser/regexp/re-compiler.c | 2 +- jerry-libc/arch/arm-v7.h | 4 ++-- jerry-libc/include/assert.h | 6 ++--- jerry-libc/include/setjmp.h | 4 ++-- jerry-libc/include/stdio.h | 4 ++-- jerry-libc/include/stdlib.h | 4 ++-- jerry-libc/include/string.h | 4 ++-- jerry-libc/include/sys/time.h | 4 ++-- jerry-libc/target/posix/jerry-asm.S | 8 +++---- jerry-libc/target/posix/jerry-libc-target.c | 10 ++++---- jerry-libm/include/math.h | 4 ++-- jerry-libm/jerry-libm-internal.h | 4 ++-- tests/unit/test-api.c | 6 ++--- 56 files changed, 165 insertions(+), 165 deletions(-) diff --git a/jerry-core/config.h b/jerry-core/config.h index 18828e269b..1de1193d51 100644 --- a/jerry-core/config.h +++ b/jerry-core/config.h @@ -1,4 +1,4 @@ -/* Copyright 2014-2015 Samsung Electronics Co., Ltd. +/* Copyright 2014-2016 Samsung Electronics Co., Ltd. * Copyright 2016 University of Szeged. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -98,13 +98,13 @@ #ifndef CONFIG_ECMA_NUMBER_TYPE # define CONFIG_ECMA_NUMBER_TYPE CONFIG_ECMA_NUMBER_FLOAT32 -#else /* !CONFIG_ECMA_NUMBER_TYPE */ +#else /* CONFIG_ECMA_NUMBER_TYPE */ # if (CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 \ && CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT64) # error "ECMA-number storage is configured incorrectly" # endif /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 && CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT64 */ -#endif /* CONFIG_ECMA_NUMBER_TYPE */ +#endif /* !CONFIG_ECMA_NUMBER_TYPE */ /** * Representation for ecma-characters @@ -114,13 +114,13 @@ #ifndef CONFIG_ECMA_CHAR_ENCODING # define CONFIG_ECMA_CHAR_ENCODING CONFIG_ECMA_CHAR_ASCII -#else /* !CONFIG_ECMA_CHAR_ENCODING */ +#else /* CONFIG_ECMA_CHAR_ENCODING */ # if (CONFIG_ECMA_CHAR_ENCODING != CONFIG_ECMA_CHAR_ASCII \ && CONFIG_ECMA_CHAR_ENCODING != CONFIG_ECMA_CHAR_UTF16) # error "ECMA-char encoding is configured incorrectly" # endif /* CONFIG_ECMA_CHAR_ENCODING != CONFIG_ECMA_CHAR_ASCII && CONFIG_ECMA_CHAR_ENCODING != CONFIG_ECMA_CHAR_UTF16 */ -#endif /* CONFIG_ECMA_CHAR_ENCODING */ +#endif /* !CONFIG_ECMA_CHAR_ENCODING */ /** * Disable ECMA lookup cache diff --git a/jerry-core/ecma/base/ecma-globals.h b/jerry-core/ecma/base/ecma-globals.h index 1e441ebef4..da16928e32 100644 --- a/jerry-core/ecma/base/ecma-globals.h +++ b/jerry-core/ecma/base/ecma-globals.h @@ -575,7 +575,7 @@ typedef double ecma_number_t; * IEEE-754 2008, 3.6, Table 3.5 */ #define ECMA_NUMBER_FRACTION_WIDTH (52) -#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */ +#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */ /** * Value '0' of ecma_number_t @@ -621,7 +621,7 @@ typedef double ecma_number_t; * See also: ECMA_262 v5, 15.7.3.3 */ # define ECMA_NUMBER_MIN_VALUE ((ecma_number_t) 5e-324) -#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */ +#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */ /** * Euler number diff --git a/jerry-core/ecma/base/ecma-helpers-conversion.c b/jerry-core/ecma/base/ecma-helpers-conversion.c index bc6612e26d..b5046f18b8 100644 --- a/jerry-core/ecma/base/ecma-helpers-conversion.c +++ b/jerry-core/ecma/base/ecma-helpers-conversion.c @@ -765,7 +765,7 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */ } return num; -#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */ +#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */ } /* ecma_utf8_string_to_number */ /** @@ -1258,7 +1258,7 @@ ecma_number_to_decimal (ecma_number_t num, /**< ecma-number */ *out_digits_p = s; *out_digits_num_p = k; *out_decimal_exp_p = n; -#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */ +#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */ } /* ecma_number_to_decimal */ /** diff --git a/jerry-core/ecma/base/ecma-helpers-number.c b/jerry-core/ecma/base/ecma-helpers-number.c index e47738289f..7d82afbb54 100644 --- a/jerry-core/ecma/base/ecma-helpers-number.c +++ b/jerry-core/ecma/base/ecma-helpers-number.c @@ -176,7 +176,7 @@ ecma_number_unpack (ecma_number_t num, /**< ecma-number */ */ const int32_t ecma_number_exponent_bias = 1023; -#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */ +#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */ /** * Get fraction of number diff --git a/jerry-core/ecma/base/ecma-helpers-string.c b/jerry-core/ecma/base/ecma-helpers-string.c index 7c1f7a9f2e..744c7d44a1 100644 --- a/jerry-core/ecma/base/ecma-helpers-string.c +++ b/jerry-core/ecma/base/ecma-helpers-string.c @@ -1467,7 +1467,7 @@ ecma_string_substr (const ecma_string_t *string_p, /**< pointer to an ecma strin const ecma_length_t string_length = ecma_string_get_length (string_p); JERRY_ASSERT (start_pos <= string_length); JERRY_ASSERT (end_pos <= string_length); -#endif +#endif /* !JERRY_NDEBUG */ if (start_pos < end_pos) { diff --git a/jerry-core/ecma/base/ecma-helpers-value.c b/jerry-core/ecma/base/ecma-helpers-value.c index 6b6c2c8f86..18e2d6abc5 100644 --- a/jerry-core/ecma/base/ecma-helpers-value.c +++ b/jerry-core/ecma/base/ecma-helpers-value.c @@ -52,7 +52,7 @@ JERRY_STATIC_ASSERT ((sizeof (ecma_value_t) * JERRY_BITSINBYTE) JERRY_STATIC_ASSERT (sizeof (uintptr_t) <= sizeof (ecma_value_t), uintptr_t_must_fit_in_ecma_value_t); -#else /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */ +#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */ JERRY_STATIC_ASSERT (sizeof (uintptr_t) > sizeof (ecma_value_t), uintptr_t_must_not_fit_in_ecma_value_t); @@ -84,7 +84,7 @@ ecma_pointer_to_ecma_value (const void *ptr) /**< pointer */ JERRY_ASSERT ((uint_ptr & ECMA_VALUE_FULL_MASK) == 0); return (ecma_value_t) uint_ptr; -#else /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */ +#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */ mem_cpointer_t ptr_cp; ECMA_SET_NON_NULL_POINTER (ptr_cp, ptr); @@ -103,7 +103,7 @@ ecma_get_pointer_from_ecma_value (ecma_value_t value) /**< value */ { #ifdef ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY return (void *) (uintptr_t) ((value) & ~ECMA_VALUE_FULL_MASK); -#else /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */ +#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */ return ECMA_GET_NON_NULL_POINTER (ecma_number_t, value >> ECMA_VALUE_SHIFT); #endif /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */ diff --git a/jerry-core/ecma/base/ecma-helpers.c b/jerry-core/ecma/base/ecma-helpers.c index b005d922b3..b65d6d71fe 100644 --- a/jerry-core/ecma/base/ecma-helpers.c +++ b/jerry-core/ecma/base/ecma-helpers.c @@ -970,7 +970,7 @@ ecma_assert_object_contains_the_property (const ecma_object_t *object_p, /**< ec #else /* JERRY_NDEBUG */ (void) object_p; (void) prop_p; -#endif /* JERRY_NDEBUG */ +#endif /* !JERRY_NDEBUG */ } /* ecma_assert_object_contains_the_property */ /** diff --git a/jerry-core/ecma/base/ecma-lcache.c b/jerry-core/ecma/base/ecma-lcache.c index fa2e47323f..70424a9fce 100644 --- a/jerry-core/ecma/base/ecma-lcache.c +++ b/jerry-core/ecma/base/ecma-lcache.c @@ -213,7 +213,7 @@ ecma_lcache_insert (ecma_object_t *object_p, /**< object */ ecma_lcache_hash_table[ hash_key ][ entry_index ].prop_p = prop_p; #else /* CONFIG_ECMA_LCACHE_DISABLE */ (void) prop_p; -#endif /* CONFIG_ECMA_LCACHE_DISABLE */ +#endif /* !CONFIG_ECMA_LCACHE_DISABLE */ } /* ecma_lcache_insert */ /** @@ -267,7 +267,7 @@ ecma_lcache_lookup (ecma_object_t *object_p, /**< object */ (void) object_p; (void) prop_name_p; (void) prop_p_p; -#endif /* CONFIG_ECMA_LCACHE_DISABLE */ +#endif /* !CONFIG_ECMA_LCACHE_DISABLE */ return false; } /* ecma_lcache_lookup */ 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 35fa8f408c..233899a1e3 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c @@ -1325,7 +1325,7 @@ ecma_builtin_date_prototype_set_year (ecma_value_t this_arg, /**< this argument return ret_value; } /* ecma_builtin_date_prototype_set_year */ -#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */ +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */ /** * @} diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h index ae06eb5602..37b6f327d6 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h @@ -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. @@ -89,7 +89,7 @@ ROUTINE (LIT_MAGIC_STRING_GET_YEAR_UL, ecma_builtin_date_prototype_get_year, 0, ROUTINE (LIT_MAGIC_STRING_SET_YEAR_UL, ecma_builtin_date_prototype_set_year, 1, 1) ROUTINE (LIT_MAGIC_STRING_TO_GMT_STRING_UL, ecma_builtin_date_prototype_to_utc_string, 0, 0) -#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */ +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */ #undef OBJECT_ID #undef SIMPLE_VALUE diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-global.c b/jerry-core/ecma/builtin-objects/ecma-builtin-global.c index fad9a4bfdf..c2f7dd4381 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-global.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-global.c @@ -1448,7 +1448,7 @@ ecma_builtin_global_object_unescape (ecma_value_t this_arg __attr_unused___, /** return ret_value; } /* ecma_builtin_global_object_unescape */ -#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */ +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */ /** * @} diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h index b1291eb4b9..7d83e2e9f2 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.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. @@ -131,7 +131,7 @@ OBJECT_VALUE (LIT_MAGIC_STRING_DATE_UL, ECMA_PROPERTY_WRITABLE, ECMA_PROPERTY_NOT_ENUMERABLE, ECMA_PROPERTY_CONFIGURABLE) -#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN */ +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN */ #ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN // ECMA-262 v5, 15.1.4.8 @@ -238,7 +238,7 @@ ROUTINE (LIT_MAGIC_STRING_PARSE_INT, ecma_builtin_global_object_parse_int, 2, 2) #ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN ROUTINE (LIT_MAGIC_STRING_ESCAPE, ecma_builtin_global_object_escape, 1, 1) ROUTINE (LIT_MAGIC_STRING_UNESCAPE, ecma_builtin_global_object_unescape, 1, 1) -#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */ +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */ #undef OBJECT_ID #undef SIMPLE_VALUE diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h index bb34d58ef7..0290bc783a 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h @@ -289,7 +289,7 @@ TRY_TO_INSTANTIATE_PROPERTY_ROUTINE_NAME (ecma_object_t *obj_p, /**< object */ \ return compact_profile_thrower_property_p; \ } -#else /* CONFIG_ECMA_COMPACT_PROFILE */ +#else /* !CONFIG_ECMA_COMPACT_PROFILE */ #define CP_UNIMPLEMENTED_VALUE(name, value, prop_writable, prop_enumerable, prop_configurable) case name: \ { \ JERRY_UNIMPLEMENTED ("The built-in is not implemented."); \ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-math.c b/jerry-core/ecma/builtin-objects/ecma-builtin-math.c index c30400ab92..d9d643f7bb 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-math.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-math.c @@ -526,9 +526,9 @@ ecma_builtin_math_object_random (ecma_value_t this_arg __attr_unused___) /**< 't reps_count = 4; #elif RAND_MAX < 0x10000 reps_count = 2; -#else /* RAND_MAX < 0x10000 */ +#else /* RAND_MAX >= 0x10000 */ reps_count = 1; -#endif /* RAND_MAX >= 0x10000 */ +#endif /* RAND_MAX < 0x100 */ for (uint32_t i = 0; i < reps_count; i++) { diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h index 9d992bc90d..4d41b98539 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h @@ -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. @@ -88,7 +88,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LASTINDEX_UL, #ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN ROUTINE (LIT_MAGIC_STRING_COMPILE, ecma_builtin_regexp_prototype_compile, 2, 1) -#endif +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */ ROUTINE (LIT_MAGIC_STRING_EXEC, ecma_builtin_regexp_prototype_exec, 1, 1) ROUTINE (LIT_MAGIC_STRING_TEST, ecma_builtin_regexp_prototype_test, 1, 1) ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_regexp_prototype_to_string, 0, 0) diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c index d15820757d..5145b99459 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c @@ -2322,7 +2322,7 @@ ecma_builtin_string_prototype_object_substr (ecma_value_t this_arg, /**< this ar return ret_value; } /* ecma_builtin_string_prototype_object_substr */ -#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */ +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */ /** * @} diff --git a/jerry-core/ecma/builtin-objects/ecma-builtins.c b/jerry-core/ecma/builtin-objects/ecma-builtins.c index c12bd7cb86..bf498cfba2 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtins.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtins.c @@ -365,9 +365,9 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object * { #ifdef CONFIG_ECMA_COMPACT_PROFILE JERRY_UNREACHABLE (); -#else /* CONFIG_ECMA_COMPACT_PROFILE */ +#else /* !CONFIG_ECMA_COMPACT_PROFILE */ JERRY_UNIMPLEMENTED ("The built-in is not implemented."); -#endif /* !CONFIG_ECMA_COMPACT_PROFILE */ +#endif /* CONFIG_ECMA_COMPACT_PROFILE */ } } @@ -442,9 +442,9 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in { #ifdef CONFIG_ECMA_COMPACT_PROFILE JERRY_UNREACHABLE (); -#else /* CONFIG_ECMA_COMPACT_PROFILE */ +#else /* !CONFIG_ECMA_COMPACT_PROFILE */ JERRY_UNIMPLEMENTED ("The built-in is not implemented."); -#endif /* !CONFIG_ECMA_COMPACT_PROFILE */ +#endif /* CONFIG_ECMA_COMPACT_PROFILE */ } } @@ -576,9 +576,9 @@ ecma_builtin_dispatch_call (ecma_object_t *obj_p, /**< built-in object */ { #ifdef CONFIG_ECMA_COMPACT_PROFILE JERRY_UNREACHABLE (); -#else /* CONFIG_ECMA_COMPACT_PROFILE */ +#else /* !CONFIG_ECMA_COMPACT_PROFILE */ JERRY_UNIMPLEMENTED ("The built-in is not implemented."); -#endif /* !CONFIG_ECMA_COMPACT_PROFILE */ +#endif /* CONFIG_ECMA_COMPACT_PROFILE */ } } } @@ -638,7 +638,7 @@ ecma_builtin_dispatch_construct (ecma_object_t *obj_p, /**< built-in object */ { #ifdef CONFIG_ECMA_COMPACT_PROFILE JERRY_UNREACHABLE (); -#else /* CONFIG_ECMA_COMPACT_PROFILE */ +#else /* !CONFIG_ECMA_COMPACT_PROFILE */ JERRY_UNIMPLEMENTED ("The built-in is not implemented."); #endif /* !CONFIG_ECMA_COMPACT_PROFILE */ } @@ -690,9 +690,9 @@ ecma_builtin_dispatch_routine (ecma_builtin_id_t builtin_object_id, /**< built-i { #ifdef CONFIG_ECMA_COMPACT_PROFILE JERRY_UNREACHABLE (); -#else /* CONFIG_ECMA_COMPACT_PROFILE */ +#else /* !CONFIG_ECMA_COMPACT_PROFILE */ JERRY_UNIMPLEMENTED ("The built-in is not implemented."); -#endif /* !CONFIG_ECMA_COMPACT_PROFILE */ +#endif /* CONFIG_ECMA_COMPACT_PROFILE */ } } diff --git a/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h index 1a52e9e869..88f3521065 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h @@ -156,7 +156,7 @@ BUILTIN (ECMA_BUILTIN_ID_DATE, true, true, date) -#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN*/ +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN */ #ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN /* The RegExp.prototype object (15.10.6) */ diff --git a/jerry-core/ecma/operations/ecma-array-object.c b/jerry-core/ecma/operations/ecma-array-object.c index b09f03c2d5..ad98b3688a 100644 --- a/jerry-core/ecma/operations/ecma-array-object.c +++ b/jerry-core/ecma/operations/ecma-array-object.c @@ -86,9 +86,9 @@ ecma_op_create_array_object (const ecma_value_t *arguments_list_p, /**< list of #ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN ecma_object_t *array_prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_ARRAY_PROTOTYPE); -#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */ +#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */ ecma_object_t *array_prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE); -#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */ +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */ ecma_object_t *obj_p = ecma_create_object (array_prototype_obj_p, true, ECMA_OBJECT_TYPE_ARRAY); ecma_deref_object (array_prototype_obj_p); diff --git a/jerry-core/ecma/operations/ecma-boolean-object.c b/jerry-core/ecma/operations/ecma-boolean-object.c index 0b42f32118..55b4a0f00f 100644 --- a/jerry-core/ecma/operations/ecma-boolean-object.c +++ b/jerry-core/ecma/operations/ecma-boolean-object.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. @@ -53,9 +53,9 @@ ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boo #ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE); -#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */ +#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */ ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE); -#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */ +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */ ecma_object_t *obj_p = ecma_create_object (prototype_obj_p, true, diff --git a/jerry-core/ecma/operations/ecma-exceptions.c b/jerry-core/ecma/operations/ecma-exceptions.c index 5bd86f0d8e..740d7a7aa3 100644 --- a/jerry-core/ecma/operations/ecma-exceptions.c +++ b/jerry-core/ecma/operations/ecma-exceptions.c @@ -98,11 +98,11 @@ ecma_new_standard_error (ecma_standard_error_t error_type) /**< native error typ ECMA_PROPERTY_VALUE_PTR (class_prop_p)->value = LIT_MAGIC_STRING_ERROR_UL; return new_error_obj_p; -#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */ +#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */ (void) error_type; return ecma_builtin_get (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR); -#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */ +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */ } /* ecma_new_standard_error */ /** diff --git a/jerry-core/ecma/operations/ecma-lex-env.c b/jerry-core/ecma/operations/ecma-lex-env.c index 6587624bf6..96b32cfd49 100644 --- a/jerry-core/ecma/operations/ecma-lex-env.c +++ b/jerry-core/ecma/operations/ecma-lex-env.c @@ -55,7 +55,7 @@ ecma_init_environment (void) ecma_global_lex_env_p = ecma_create_object_lex_env (NULL, glob_obj_p, false); ecma_deref_object (glob_obj_p); -#endif /* !CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE */ +#endif /* CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE */ } /* ecma_init_environment */ /** diff --git a/jerry-core/ecma/operations/ecma-number-object.c b/jerry-core/ecma/operations/ecma-number-object.c index 0204b94b6f..cf73922dd9 100644 --- a/jerry-core/ecma/operations/ecma-number-object.c +++ b/jerry-core/ecma/operations/ecma-number-object.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. @@ -52,9 +52,9 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb #ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE); -#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */ +#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */ ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE); -#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */ +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */ ecma_object_t *obj_p = ecma_create_object (prototype_obj_p, true, diff --git a/jerry-core/ecma/operations/ecma-string-object.c b/jerry-core/ecma/operations/ecma-string-object.c index e12d9a53e4..49ce67c6f4 100644 --- a/jerry-core/ecma/operations/ecma-string-object.c +++ b/jerry-core/ecma/operations/ecma-string-object.c @@ -78,9 +78,9 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of #ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_STRING_PROTOTYPE); -#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */ +#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */ ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE); -#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */ +#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */ ecma_object_t *obj_p = ecma_create_object (prototype_obj_p, true, diff --git a/jerry-core/jerry-api.h b/jerry-core/jerry-api.h index 3752ee6eae..b39257fc56 100644 --- a/jerry-core/jerry-api.h +++ b/jerry-core/jerry-api.h @@ -25,7 +25,7 @@ #ifdef __cplusplus extern "C" { -#endif /* !__cplusplus */ +#endif /* __cplusplus */ /** \addtogroup jerry Jerry engine interface * @{ @@ -331,5 +331,5 @@ jerry_api_string_t *jerry_api_value_to_string (const jerry_api_value_t *); #ifdef __cplusplus } -#endif /* !__cplusplus */ +#endif /* __cplusplus */ #endif /* !JERRY_API_H */ diff --git a/jerry-core/jerry-internal.h b/jerry-core/jerry-internal.h index 23fd0083c6..f13702d4fc 100644 --- a/jerry-core/jerry-internal.h +++ b/jerry-core/jerry-internal.h @@ -15,7 +15,7 @@ #ifndef JERRY_INTERNAL # error "The header is for Jerry's internal interfaces" -#endif +#endif /* !JERRY_INTERNAL */ #ifndef JERRY_INTERNAL_H #define JERRY_INTERNAL_H diff --git a/jerry-core/jerry-port.h b/jerry-core/jerry-port.h index 5de51909b3..ba34f3aca4 100644 --- a/jerry-core/jerry-port.h +++ b/jerry-core/jerry-port.h @@ -22,7 +22,7 @@ #ifdef __cplusplus extern "C" { -#endif /* !__cplusplus */ +#endif /* __cplusplus */ /** \addtogroup jerry_port Jerry engine port * @{ @@ -41,5 +41,5 @@ int jerry_port_putchar (int c); #ifdef __cplusplus } -#endif /* !__cplusplus */ +#endif /* __cplusplus */ #endif /* !JERRY_PORT_H */ diff --git a/jerry-core/jerry.c b/jerry-core/jerry.c index b72f9a427a..3f0dac7017 100644 --- a/jerry-core/jerry.c +++ b/jerry-core/jerry.c @@ -405,7 +405,7 @@ jerry_api_convert_ecma_value_to_api_value (jerry_api_value_t *out_value_p, /**< #elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 out_value_p->type = JERRY_API_DATA_TYPE_FLOAT64; out_value_p->u.v_float64 = *num; -#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */ +#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */ } else if (ecma_is_value_string (value)) { @@ -1644,12 +1644,12 @@ jerry_init (jerry_flag_t flags) /**< combination of Jerry flags */ flags &= (jerry_flag_t) ~(JERRY_FLAG_MEM_STATS | JERRY_FLAG_MEM_STATS_SEPARATE); JERRY_WARNING_MSG ("Ignoring memory statistics option because of '!MEM_STATS' build configuration.\n"); -#else /* !MEM_STATS */ +#else /* MEM_STATS */ if (flags & JERRY_FLAG_MEM_STATS_SEPARATE) { flags |= JERRY_FLAG_MEM_STATS; } -#endif /* MEM_STATS */ +#endif /* !MEM_STATS */ } jerry_flags = flags; @@ -1898,7 +1898,7 @@ snapshot_add_compiled_code (ecma_compiled_code_t *compiled_code_p) /**< compiled copied_compiled_code_p->status_flags = compiled_code_p->status_flags; -#else +#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */ JERRY_UNIMPLEMENTED ("RegExp is not supported in compact profile."); #endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */ return start_offset; @@ -2151,7 +2151,7 @@ jerry_parse_and_save_snapshot (const jerry_api_char_t *source_p, /**< script sou ecma_bytecode_deref (bytecode_data_p); return snapshot_buffer_write_offset; -#else /* JERRY_ENABLE_SNAPSHOT_SAVE */ +#else /* !JERRY_ENABLE_SNAPSHOT_SAVE */ (void) source_p; (void) source_size; (void) is_for_global; @@ -2159,7 +2159,7 @@ jerry_parse_and_save_snapshot (const jerry_api_char_t *source_p, /**< script sou (void) buffer_size; return 0; -#endif /* !JERRY_ENABLE_SNAPSHOT_SAVE */ +#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */ } /* jerry_parse_and_save_snapshot */ #ifdef JERRY_ENABLE_SNAPSHOT_EXEC @@ -2203,7 +2203,7 @@ snapshot_load_compiled_code (const uint8_t *snapshot_data_p, /**< snapshot data ecma_deref_ecma_string (pattern_str_p); return (ecma_compiled_code_t *) re_bytecode_p; -#else +#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */ JERRY_UNIMPLEMENTED ("RegExp is not supported in compact profile."); #endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */ } @@ -2407,14 +2407,14 @@ jerry_exec_snapshot (const void *snapshot_p, /**< snapshot */ } return ret_code; -#else /* JERRY_ENABLE_SNAPSHOT_EXEC */ +#else /* !JERRY_ENABLE_SNAPSHOT_EXEC */ (void) snapshot_p; (void) snapshot_size; (void) copy_bytecode; (void) retval_p; return JERRY_COMPLETION_CODE_INVALID_SNAPSHOT_VERSION; -#endif /* !JERRY_ENABLE_SNAPSHOT_EXEC */ +#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */ } /* jerry_exec_snapshot */ /** diff --git a/jerry-core/jerry.h b/jerry-core/jerry.h index d04c954193..a5aa252369 100644 --- a/jerry-core/jerry.h +++ b/jerry-core/jerry.h @@ -26,7 +26,7 @@ #ifdef __cplusplus extern "C" { -#endif /* !__cplusplus */ +#endif /* __cplusplus */ /** \addtogroup jerry Jerry engine interface * @{ @@ -94,5 +94,5 @@ jerry_completion_code_t jerry_run_simple (const jerry_api_char_t *, size_t, jerr #ifdef __cplusplus } -#endif /* !__cplusplus */ +#endif /* __cplusplus */ #endif /* !JERRY_H */ diff --git a/jerry-core/jrt/jrt-fatals.c b/jerry-core/jrt/jrt-fatals.c index 498df0c47d..7d98e17273 100644 --- a/jerry-core/jrt/jrt-fatals.c +++ b/jerry-core/jrt/jrt-fatals.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. @@ -94,12 +94,12 @@ jerry_assert_fail (const char *assertion, /**< assertion condition string */ #if !defined (JERRY_NDEBUG) || !defined (JERRY_DISABLE_HEAVY_DEBUG) printf ("ICE: Assertion '%s' failed at %s(%s):%lu.\n", assertion, file, function, (unsigned long) line); -#else /* !JERRY_NDEBUG || !JERRY_DISABLE_HEAVY_DEBUG */ +#else /* JERRY_NDEBUG && JERRY_DISABLE_HEAVY_DEBUG */ (void) assertion; (void) file; (void) function; (void) line; -#endif /* JERRY_NDEBUG && JERRY_DISABLE_HEAVY_DEBUG */ +#endif /* !JERRY_NDEBUG || !JERRY_DISABLE_HEAVY_DEBUG */ jerry_fatal (ERR_FAILED_INTERNAL_ASSERTION); } /* jerry_assert_fail */ @@ -116,11 +116,11 @@ jerry_unreachable (const char *comment, /**< comment to unreachable mark if exis { #ifndef JERRY_NDEBUG printf ("ICE: Unreachable control path at %s(%s):%lu was executed", file, function, (unsigned long) line); -#else /* !JERRY_NDEBUG */ +#else /* JERRY_NDEBUG */ (void) file; (void) function; (void) line; -#endif /* JERRY_NDEBUG */ +#endif /* !JERRY_NDEBUG */ if (comment != NULL) { @@ -143,11 +143,11 @@ jerry_unimplemented (const char *comment, /**< comment to unimplemented mark if { #ifndef JERRY_NDEBUG printf ("SORRY: Unimplemented case at %s(%s):%lu was executed", file, function, (unsigned long) line); -#else /* !JERRY_NDEBUG */ +#else /* JERRY_NDEBUG */ (void) file; (void) function; (void) line; -#endif /* JERRY_NDEBUG */ +#endif /* !JERRY_NDEBUG */ if (comment != NULL) { diff --git a/jerry-core/jrt/jrt.h b/jerry-core/jrt/jrt.h index 9017e4adeb..bc22950e17 100644 --- a/jerry-core/jrt/jrt.h +++ b/jerry-core/jrt/jrt.h @@ -80,9 +80,9 @@ extern void __noreturn jerry_unimplemented (const char *, const char *, const ch #if !defined (JERRY_NDEBUG) || !defined (JERRY_DISABLE_HEAVY_DEBUG) #define JERRY_ASSERT(x) do { if (__builtin_expect (!(x), 0)) { \ jerry_assert_fail (#x, __FILE__, __func__, __LINE__); } } while (0) -#else /* !JERRY_NDEBUG || !JERRY_DISABLE_HEAVY_DEBUG*/ +#else /* JERRY_NDEBUG && JERRY_DISABLE_HEAVY_DEBUG */ #define JERRY_ASSERT(x) do { if (false) { (void)(x); } } while (0) -#endif /* JERRY_NDEBUG && JERRY_DISABLE_HEAVY_NEBUG */ +#endif /* !JERRY_NDEBUG || !JERRY_DISABLE_HEAVY_DEBUG */ #ifdef JERRY_ENABLE_LOG #define JERRY_LOG(lvl, ...) \ @@ -109,7 +109,7 @@ extern void __noreturn jerry_unimplemented (const char *, const char *, const ch } while (0) #define JERRY_DDLOG(...) JERRY_DLOG (__VA_ARGS__) #define JERRY_DDDLOG(...) JERRY_DLOG (__VA_ARGS__) -#endif /* !JERRY_ENABLE_LOG */ +#endif /* JERRY_ENABLE_LOG */ #define JERRY_ERROR_MSG(...) jerry_port_errormsg (__VA_ARGS__) #define JERRY_WARNING_MSG(...) JERRY_ERROR_MSG (__VA_ARGS__) @@ -141,7 +141,7 @@ extern void jerry_ref_unused_variables (void *, ...); } \ jerry_unimplemented (comment, __FILE__, __func__, __LINE__); \ } while (0) -#else /* !JERRY_NDEBUG */ +#else /* JERRY_NDEBUG */ #define JERRY_UNREACHABLE() \ do \ { \ @@ -163,7 +163,7 @@ extern void jerry_ref_unused_variables (void *, ...); } \ jerry_unimplemented (comment, NULL, NULL, 0); \ } while (0) -#endif /* JERRY_NDEBUG */ +#endif /* !JERRY_NDEBUG */ /** * Conditions' likeliness, unlikeliness. diff --git a/jerry-core/mem/mem-allocator.c b/jerry-core/mem/mem-allocator.c index a0f6092c73..0e7db9b05e 100644 --- a/jerry-core/mem/mem-allocator.c +++ b/jerry-core/mem/mem-allocator.c @@ -56,9 +56,9 @@ mem_finalize (bool is_show_mem_stats) /**< show heap memory stats { mem_stats_print (); } -#else /* MEM_STATS */ +#else /* !MEM_STATS */ (void) is_show_mem_stats; -#endif /* !MEM_STATS */ +#endif /* MEM_STATS */ mem_heap_finalize (); } /* mem_finalize */ diff --git a/jerry-core/mem/mem-heap.c b/jerry-core/mem/mem-heap.c index e3cf194a46..f17da0fc6e 100644 --- a/jerry-core/mem/mem-heap.c +++ b/jerry-core/mem/mem-heap.c @@ -45,7 +45,7 @@ # define VALGRIND_UNDEFINED_SPACE(p, s) VALGRIND_MAKE_MEM_UNDEFINED((p), (s)) # define VALGRIND_DEFINED_SPACE(p, s) VALGRIND_MAKE_MEM_DEFINED((p), (s)) -#else /* JERRY_VALGRIND */ +#else /* !JERRY_VALGRIND */ # define VALGRIND_NOACCESS_SPACE(p, s) # define VALGRIND_UNDEFINED_SPACE(p, s) # define VALGRIND_DEFINED_SPACE(p, s) @@ -83,7 +83,7 @@ void mem_heap_valgrind_freya_mempool_request (void) VALGRIND_FREELIKE_BLOCK((p), 0); \ } -#else /* JERRY_VALGRIND_FREYA */ +#else /* !JERRY_VALGRIND_FREYA */ # define VALGRIND_FREYA_CHECK_MEMPOOL_REQUEST # define VALGRIND_FREYA_MALLOCLIKE_SPACE(p, s) # define VALGRIND_FREYA_FREELIKE_SPACE(p) @@ -105,11 +105,11 @@ typedef struct #if UINTPTR_MAX > UINT32_MAX #define MEM_HEAP_GET_OFFSET_FROM_ADDR(p) ((uint32_t) ((uint8_t *) (p) - (uint8_t *) mem_heap.area)) #define MEM_HEAP_GET_ADDR_FROM_OFFSET(u) ((mem_heap_free_t *) &mem_heap.area[u]) -#else +#else /* UINTPTR_MAX <= UINT32_MAX */ /* In this case we simply store the pointer, since it fits anyway. */ #define MEM_HEAP_GET_OFFSET_FROM_ADDR(p) ((uint32_t) (p)) #define MEM_HEAP_GET_ADDR_FROM_OFFSET(u) ((mem_heap_free_t *)(u)) -#endif +#endif /* UINTPTR_MAX > UINT32_MAX */ /** * Get end of region @@ -139,9 +139,9 @@ typedef struct */ #ifndef JERRY_HEAP_SECTION_ATTR mem_heap_t mem_heap; -#else +#else /* JERRY_HEAP_SECTION_ATTR */ mem_heap_t mem_heap __attribute__ ((section (JERRY_HEAP_SECTION_ATTR))); -#endif +#endif /* !JERRY_HEAP_SECTION_ATTR */ /** * Check size of heap is corresponding to configuration @@ -191,7 +191,7 @@ static void mem_heap_stat_free_iter (); # define MEM_HEAP_STAT_NONSKIP() # define MEM_HEAP_STAT_ALLOC_ITER() # define MEM_HEAP_STAT_FREE_ITER() -#endif /* !MEM_STATS */ +#endif /* MEM_STATS */ /** * Startup initialization of heap diff --git a/jerry-core/mem/mem-heap.h b/jerry-core/mem/mem-heap.h index 4c4c4a355c..5c082a92c4 100644 --- a/jerry-core/mem/mem-heap.h +++ b/jerry-core/mem/mem-heap.h @@ -75,13 +75,13 @@ extern void mem_heap_stats_print (void); #ifdef JERRY_VALGRIND #error Valgrind and valgrind-freya modes are not compatible. -#endif +#endif /* JERRY_VALGRIND */ extern void mem_heap_valgrind_freya_mempool_request (void); #define MEM_HEAP_VALGRIND_FREYA_MEMPOOL_REQUEST() mem_heap_valgrind_freya_mempool_request () -#else /* JERRY_VALGRIND_FREYA */ +#else /* !JERRY_VALGRIND_FREYA */ #define MEM_HEAP_VALGRIND_FREYA_MEMPOOL_REQUEST() diff --git a/jerry-core/mem/mem-poolman.c b/jerry-core/mem/mem-poolman.c index 9e3a83b2bd..e47bdc496f 100644 --- a/jerry-core/mem/mem-poolman.c +++ b/jerry-core/mem/mem-poolman.c @@ -71,7 +71,7 @@ static void mem_pools_stat_dealloc (void); # define MEM_POOLS_STAT_NEW_ALLOC() # define MEM_POOLS_STAT_REUSE() # define MEM_POOLS_STAT_DEALLOC() -#endif /* !MEM_STATS */ +#endif /* MEM_STATS */ /* * Valgrind-related options and headers @@ -82,7 +82,7 @@ static void mem_pools_stat_dealloc (void); # define VALGRIND_NOACCESS_SPACE(p, s) VALGRIND_MAKE_MEM_NOACCESS((p), (s)) # define VALGRIND_UNDEFINED_SPACE(p, s) VALGRIND_MAKE_MEM_UNDEFINED((p), (s)) # define VALGRIND_DEFINED_SPACE(p, s) VALGRIND_MAKE_MEM_DEFINED((p), (s)) -#else /* JERRY_VALGRIND */ +#else /* !JERRY_VALGRIND */ # define VALGRIND_NOACCESS_SPACE(p, s) # define VALGRIND_UNDEFINED_SPACE(p, s) # define VALGRIND_DEFINED_SPACE(p, s) @@ -93,7 +93,7 @@ static void mem_pools_stat_dealloc (void); # define VALGRIND_FREYA_MALLOCLIKE_SPACE(p, s) VALGRIND_MALLOCLIKE_BLOCK((p), (s), 0, 0) # define VALGRIND_FREYA_FREELIKE_SPACE(p) VALGRIND_FREELIKE_BLOCK((p), 0) -#else /* JERRY_VALGRIND_FREYA */ +#else /* !JERRY_VALGRIND_FREYA */ # define VALGRIND_FREYA_MALLOCLIKE_SPACE(p, s) # define VALGRIND_FREYA_FREELIKE_SPACE(p) #endif /* JERRY_VALGRIND_FREYA */ diff --git a/jerry-core/parser/js/common.h b/jerry-core/parser/js/common.h index 82cbbe87bd..211b42c5b3 100644 --- a/jerry-core/parser/js/common.h +++ b/jerry-core/parser/js/common.h @@ -35,12 +35,12 @@ #ifndef JERRY_NDEBUG #define PARSER_DEBUG -#endif +#endif /* !JERRY_NDEBUG */ #ifndef JERRY_NDEBUG /* Note: This flag is independent from debug mode. */ #define PARSER_DUMP_BYTE_CODE -#endif +#endif /* !JERRY_NDEBUG */ #include "ecma-globals.h" #include "ecma-regexp-object.h" @@ -98,9 +98,9 @@ typedef struct #ifdef PARSER_DUMP_BYTE_CODE struct -#else +#else /* !PARSER_DUMP_BYTE_CODE */ union -#endif +#endif /* PARSER_DUMP_BYTE_CODE */ { uint16_t length; /**< length of ident / string literal */ uint16_t index; /**< real index during post processing */ diff --git a/jerry-core/parser/js/js-lexer.c b/jerry-core/parser/js/js-lexer.c index 1746a86148..ae68ee63c8 100644 --- a/jerry-core/parser/js/js-lexer.c +++ b/jerry-core/parser/js/js-lexer.c @@ -1836,7 +1836,7 @@ lexer_construct_regexp_object (parser_context_t *context_p, /**< context */ context_p->lit_object.literal_p = literal_p; context_p->lit_object.index = (uint16_t) (context_p->literal_count - 1); context_p->lit_object.type = LEXER_LITERAL_OBJECT_ANY; -#else +#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */ (void) parse_only; parser_raise_error (context_p, PARSER_ERR_UNSUPPORTED_REGEXP); #endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */ diff --git a/jerry-core/parser/js/js-parser-internal.h b/jerry-core/parser/js/js-parser-internal.h index d84a3bd471..417d9adb93 100644 --- a/jerry-core/parser/js/js-parser-internal.h +++ b/jerry-core/parser/js/js-parser-internal.h @@ -224,7 +224,7 @@ typedef struct parser_saved_context_t #ifdef PARSER_DEBUG uint16_t context_stack_depth; /**< current context stack depth */ -#endif +#endif /* PARSER_DEBUG */ } parser_saved_context_t; /** diff --git a/jerry-core/parser/js/js-parser-limits.h b/jerry-core/parser/js/js-parser-limits.h index f2ea21666b..ff92e0b9f6 100644 --- a/jerry-core/parser/js/js-parser-limits.h +++ b/jerry-core/parser/js/js-parser-limits.h @@ -31,31 +31,31 @@ * Limit: LEXER_MAX_STRING_LENGTH. */ #ifndef PARSER_MAXIMUM_IDENT_LENGTH #define PARSER_MAXIMUM_IDENT_LENGTH 255 -#endif /* PARSER_MAXIMUM_IDENT_LENGTH */ +#endif /* !PARSER_MAXIMUM_IDENT_LENGTH */ /* Maximum string length. * Limit: 65535. */ #ifndef PARSER_MAXIMUM_STRING_LENGTH #define PARSER_MAXIMUM_STRING_LENGTH 65535 -#endif /* PARSER_MAXIMUM_STRING_LENGTH */ +#endif /* !PARSER_MAXIMUM_STRING_LENGTH */ /* Maximum number of literals. * Limit: 32767. Recommended: 510, 32767 */ #ifndef PARSER_MAXIMUM_NUMBER_OF_LITERALS #define PARSER_MAXIMUM_NUMBER_OF_LITERALS 32767 -#endif /* PARSER_MAXIMUM_NUMBER_OF_LITERALS */ +#endif /* !PARSER_MAXIMUM_NUMBER_OF_LITERALS */ /* Maximum number of registers. * Limit: PARSER_MAXIMUM_NUMBER_OF_LITERALS */ #ifndef PARSER_MAXIMUM_NUMBER_OF_REGISTERS #define PARSER_MAXIMUM_NUMBER_OF_REGISTERS 256 -#endif +#endif /* !PARSER_MAXIMUM_NUMBER_OF_REGISTERS */ /* Maximum code size. * Limit: 16777215. Recommended: 65535, 16777215. */ #ifndef PARSER_MAXIMUM_CODE_SIZE #define PARSER_MAXIMUM_CODE_SIZE (65535 << (MEM_ALIGNMENT_LOG)) -#endif +#endif /* !PARSER_MAXIMUM_CODE_SIZE */ /* Maximum number of values pushed onto the stack by a function. * Limit: 65500. Recommended: 1024. */ diff --git a/jerry-core/parser/js/js-parser-statm.c b/jerry-core/parser/js/js-parser-statm.c index f327d75fb2..3c7206c5d6 100644 --- a/jerry-core/parser/js/js-parser-statm.c +++ b/jerry-core/parser/js/js-parser-statm.c @@ -496,7 +496,7 @@ parser_parse_with_statement_start (parser_context_t *context_p) /**< context */ #ifdef PARSER_DEBUG PARSER_PLUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_WITH_CONTEXT_STACK_ALLOCATION); -#endif +#endif /* PARSER_DEBUG */ context_p->status_flags |= PARSER_INSIDE_WITH | PARSER_LEXICAL_ENV_NEEDED; parser_emit_cbc_ext_forward_branch (context_p, @@ -527,7 +527,7 @@ parser_parse_with_statement_end (parser_context_t *context_p) /**< context */ PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, PARSER_WITH_CONTEXT_STACK_ALLOCATION); #ifdef PARSER_DEBUG PARSER_MINUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_WITH_CONTEXT_STACK_ALLOCATION); -#endif +#endif /* PARSER_DEBUG */ parser_emit_cbc (context_p, CBC_CONTEXT_END); parser_set_branch_to_current_position (context_p, &with_statement.branch); @@ -722,7 +722,7 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */ #ifdef PARSER_DEBUG PARSER_PLUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION); -#endif +#endif /* PARSER_DEBUG */ parser_emit_cbc_ext_forward_branch (context_p, CBC_EXT_FOR_IN_CREATE_CONTEXT, @@ -1122,7 +1122,7 @@ parser_parse_try_statement_end (parser_context_t *context_p) /**< context */ PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION); #ifdef PARSER_DEBUG PARSER_MINUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION); -#endif +#endif /* PARSER_DEBUG */ parser_emit_cbc (context_p, CBC_CONTEXT_END); parser_set_branch_to_current_position (context_p, &try_statement.branch); @@ -1139,7 +1139,7 @@ parser_parse_try_statement_end (parser_context_t *context_p) /**< context */ PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION); #ifdef PARSER_DEBUG PARSER_MINUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION); -#endif +#endif /* PARSER_DEBUG */ parser_emit_cbc (context_p, CBC_CONTEXT_END); parser_flush_cbc (context_p); @@ -1565,7 +1565,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */ uint32_t status_flags = context_p->status_flags; #ifdef PARSER_DUMP_BYTE_CODE int switch_to_strict_mode = PARSER_FALSE; -#endif +#endif /* PARSER_DUMP_BYTE_CODE */ JERRY_ASSERT (context_p->stack_depth == 0); @@ -1579,7 +1579,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */ #ifdef PARSER_DUMP_BYTE_CODE switch_to_strict_mode = PARSER_TRUE; -#endif +#endif /* PARSER_DUMP_BYTE_CODE */ } lexer_next_token (context_p); @@ -1643,7 +1643,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */ { #ifdef PARSER_DEBUG JERRY_ASSERT (context_p->stack_depth == context_p->context_stack_depth); -#endif +#endif /* PARSER_DEBUG */ switch (context_p->token.type) { @@ -1749,7 +1749,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */ #ifdef PARSER_DEBUG PARSER_PLUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION); -#endif +#endif /* PARSER_DEBUG */ try_statement.type = parser_try_block; parser_emit_cbc_ext_forward_branch (context_p, @@ -1924,7 +1924,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */ JERRY_ASSERT (context_p->stack_depth == 0); #ifdef PARSER_DEBUG JERRY_ASSERT (context_p->context_stack_depth == 0); -#endif +#endif /* PARSER_DEBUG */ /* There is no lexer_next_token here, since the * next token belongs to the parent context. */ return; @@ -2017,7 +2017,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */ PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION); #ifdef PARSER_DEBUG PARSER_MINUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION); -#endif +#endif /* PARSER_DEBUG */ parser_emit_cbc_ext_backward_branch (context_p, CBC_EXT_BRANCH_IF_FOR_IN_HAS_NEXT, @@ -2046,7 +2046,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */ JERRY_ASSERT (context_p->stack_depth == 0); #ifdef PARSER_DEBUG JERRY_ASSERT (context_p->context_stack_depth == 0); -#endif +#endif /* PARSER_DEBUG */ parser_stack_pop_uint8 (context_p); context_p->last_statement.current_p = NULL; diff --git a/jerry-core/parser/js/js-parser-util.c b/jerry-core/parser/js/js-parser-util.c index 14ae1d896e..be29e90ff3 100644 --- a/jerry-core/parser/js/js-parser-util.c +++ b/jerry-core/parser/js/js-parser-util.c @@ -407,7 +407,7 @@ parser_emit_cbc_forward_branch (parser_context_t *context_p, /**< context */ #if PARSER_MAXIMUM_CODE_SIZE <= 65535 opcode++; -#else /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */ +#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */ PARSER_PLUS_EQUAL_U16 (opcode, 2); #endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */ @@ -420,7 +420,7 @@ parser_emit_cbc_forward_branch (parser_context_t *context_p, /**< context */ #if PARSER_MAXIMUM_CODE_SIZE <= 65535 PARSER_APPEND_TO_BYTE_CODE (context_p, 0); context_p->byte_code_size += 3; -#else /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */ +#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */ parser_emit_two_bytes (context_p, 0, 0); context_p->byte_code_size += 4; #endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */ @@ -522,7 +522,7 @@ parser_emit_cbc_backward_branch (parser_context_t *context_p, /**< context */ opcode++; context_p->byte_code_size++; } -#else /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */ +#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */ if (offset > 65535) { PARSER_PLUS_EQUAL_U16 (opcode, 2); @@ -587,7 +587,7 @@ parser_set_branch_to_current_position (parser_context_t *context_p, /**< context page_p = page_p->next_p; offset = 0; } -#else +#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */ page_p->bytes[offset++] = (uint8_t) (delta >> 16); if (offset >= PARSER_CBC_STREAM_PAGE_SIZE) { @@ -600,7 +600,7 @@ parser_set_branch_to_current_position (parser_context_t *context_p, /**< context page_p = page_p->next_p; offset = 0; } -#endif +#endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */ page_p->bytes[offset++] = delta & 0xff; } /* parser_set_branch_to_current_position */ diff --git a/jerry-core/parser/js/js-parser.c b/jerry-core/parser/js/js-parser.c index 52a2a0be38..baef7bca21 100644 --- a/jerry-core/parser/js/js-parser.c +++ b/jerry-core/parser/js/js-parser.c @@ -529,7 +529,7 @@ parser_generate_initializers (parser_context_t *context_p, /**< context */ { mem_heap_free_block_size_stored ((void *) literal_p->u.char_p); } -#else /* PARSER_DUMP_BYTE_CODE */ +#else /* !PARSER_DUMP_BYTE_CODE */ literal_pool_p[literal_p->prop.index] = literal_p->u.value; #endif /* PARSER_DUMP_BYTE_CODE */ } @@ -1395,7 +1395,7 @@ parser_post_processing (parser_context_t *context_p) /**< context */ int prefix_zero = PARSER_TRUE; #if PARSER_MAXIMUM_CODE_SIZE <= 65535 cbc_opcode_t jump_forward = CBC_JUMP_FORWARD_2; -#else /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */ +#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */ cbc_opcode_t jump_forward = CBC_JUMP_FORWARD_3; #endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */ @@ -1554,7 +1554,7 @@ parser_post_processing (parser_context_t *context_p) /**< context */ /* These opcodes are deleted from the stream. */ #if PARSER_MAXIMUM_CODE_SIZE <= 65535 size_t length = 3; -#else /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */ +#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */ size_t length = 4; #endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */ @@ -1699,7 +1699,7 @@ parser_post_processing (parser_context_t *context_p) /**< context */ } } } -#else +#else /* !PARSER_DUMP_BYTE_CODE */ if (context_p->status_flags & PARSER_HAS_LATE_LIT_INIT) { parser_list_iterator_t literal_iterator; @@ -1966,7 +1966,7 @@ parser_parse_function (parser_context_t *context_p, /**< context */ #ifdef PARSER_DEBUG saved_context.context_stack_depth = context_p->context_stack_depth; -#endif +#endif /* PARSER_DEBUG */ /* Reset private part of the context. */ @@ -2183,7 +2183,7 @@ parser_parse_function (parser_context_t *context_p, /**< context */ #ifdef PARSER_DEBUG context_p->context_stack_depth = saved_context.context_stack_depth; -#endif +#endif /* PARSER_DEBUG */ return compiled_code_p; } /* parser_parse_function */ @@ -2231,7 +2231,7 @@ parser_set_show_instrs (int show_instrs) /**< flag indicating whether to dump by { #ifdef PARSER_DUMP_BYTE_CODE parser_show_instrs = show_instrs; -#else +#else /* !PARSER_DUMP_BYTE_CODE */ (void) show_instrs; #endif /* PARSER_DUMP_BYTE_CODE */ } /* parser_set_show_instrs */ diff --git a/jerry-core/parser/regexp/re-bytecode.h b/jerry-core/parser/regexp/re-bytecode.h index 98449ae308..217447812f 100644 --- a/jerry-core/parser/regexp/re-bytecode.h +++ b/jerry-core/parser/regexp/re-bytecode.h @@ -117,7 +117,7 @@ void re_bytecode_list_insert (re_bytecode_ctx_t *, size_t, uint8_t *, size_t); #ifdef JERRY_ENABLE_LOG void re_dump_bytecode (re_bytecode_ctx_t *bc_ctx); -#endif +#endif /* JERRY_ENABLE_LOG */ /** * @} diff --git a/jerry-core/parser/regexp/re-compiler.c b/jerry-core/parser/regexp/re-compiler.c index a8cae435dd..3eed0f3395 100644 --- a/jerry-core/parser/regexp/re-compiler.c +++ b/jerry-core/parser/regexp/re-compiler.c @@ -604,7 +604,7 @@ re_compile_bytecode (const re_compiled_code_t **out_bytecode_p, /**< [out] point { #ifdef JERRY_ENABLE_LOG re_dump_bytecode (&bc_ctx); -#endif +#endif /* JERRY_ENABLE_LOG */ /* The RegExp bytecode contains at least a RE_OP_SAVE_AT_START opdoce, so it cannot be NULL. */ JERRY_ASSERT (bc_ctx.block_start_p != NULL); diff --git a/jerry-libc/arch/arm-v7.h b/jerry-libc/arch/arm-v7.h index 21ae8f9084..5d614e6e11 100644 --- a/jerry-libc/arch/arm-v7.h +++ b/jerry-libc/arch/arm-v7.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. @@ -112,7 +112,7 @@ #else /* !__TARGET_HOST_ARMv7_HARD_FLOAT */ # define _STORE_VFP_S16_S31_IF_HARD_FLOAT # define _LOAD_VFP_S16_S31_IF_HARD_FLOAT -#endif /* !__TARGET_HOST_ARMv7_HARD_FLOAT */ +#endif /* __TARGET_HOST_ARMv7_HARD_FLOAT */ /* * setjmp diff --git a/jerry-libc/include/assert.h b/jerry-libc/include/assert.h index 382029ecfc..a63c08c64f 100644 --- a/jerry-libc/include/assert.h +++ b/jerry-libc/include/assert.h @@ -23,7 +23,7 @@ #ifdef __cplusplus extern "C" { -#endif /* !__cplusplus */ +#endif /* __cplusplus */ #ifndef NDEBUG #define assert(x) \ @@ -35,11 +35,11 @@ extern "C" abort (); \ } \ } while (0) -#else +#else /* NDEBUG */ #define assert(x) ((void) 0) #endif /* !NDEBUG */ #ifdef __cplusplus } -#endif /* !__cplusplus */ +#endif /* __cplusplus */ #endif /* !JERRY_LIBC_ASSERT_H */ diff --git a/jerry-libc/include/setjmp.h b/jerry-libc/include/setjmp.h index 62f56ea5bc..4705858f85 100644 --- a/jerry-libc/include/setjmp.h +++ b/jerry-libc/include/setjmp.h @@ -22,7 +22,7 @@ #ifdef __cplusplus extern "C" { -#endif /* !__cplusplus */ +#endif /* __cplusplus */ /** * Storage for context, used for nonlocal goto @@ -61,5 +61,5 @@ void longjmp (jmp_buf env, int val); #ifdef __cplusplus } -#endif /* !__cplusplus */ +#endif /* __cplusplus */ #endif /* !JERRY_LIBC_SETJMP_H */ diff --git a/jerry-libc/include/stdio.h b/jerry-libc/include/stdio.h index dd3eeac097..4975d0a5ec 100644 --- a/jerry-libc/include/stdio.h +++ b/jerry-libc/include/stdio.h @@ -23,7 +23,7 @@ #ifdef __cplusplus extern "C" { -#endif /* !__cplusplus */ +#endif /* __cplusplus */ /** * File descriptor type @@ -62,5 +62,5 @@ int putchar (int c); #ifdef __cplusplus } -#endif /* !__cplusplus */ +#endif /* __cplusplus */ #endif /* !JERRY_LIBC_STDIO_H */ diff --git a/jerry-libc/include/stdlib.h b/jerry-libc/include/stdlib.h index cc73ad44eb..26bcc9e5c2 100644 --- a/jerry-libc/include/stdlib.h +++ b/jerry-libc/include/stdlib.h @@ -20,7 +20,7 @@ #ifdef __cplusplus extern "C" { -#endif /* !__cplusplus */ +#endif /* __cplusplus */ /** * Maximum integer that could be returned by random number generator @@ -37,5 +37,5 @@ void srand (unsigned int); #ifdef __cplusplus } -#endif /* !__cplusplus */ +#endif /* __cplusplus */ #endif /* !JERRY_LIBC_STDLIB_H */ diff --git a/jerry-libc/include/string.h b/jerry-libc/include/string.h index e9ff8c5244..9f4212d185 100644 --- a/jerry-libc/include/string.h +++ b/jerry-libc/include/string.h @@ -22,7 +22,7 @@ #ifdef __cplusplus extern "C" { -#endif /* !__cplusplus */ +#endif /* __cplusplus */ void *memcpy (void *dest, const void *src, size_t n); void *memset (void *s, int c, size_t n); @@ -35,5 +35,5 @@ size_t strlen (const char *s); #ifdef __cplusplus } -#endif /* !__cplusplus */ +#endif /* __cplusplus */ #endif /* !JERRY_LIBC_STRING_H */ diff --git a/jerry-libc/include/sys/time.h b/jerry-libc/include/sys/time.h index 986adea2a1..eb929a90d3 100644 --- a/jerry-libc/include/sys/time.h +++ b/jerry-libc/include/sys/time.h @@ -20,7 +20,7 @@ #ifdef __cplusplus extern "C" { -#endif /* !__cplusplus */ +#endif /* __cplusplus */ /** * Time value structure @@ -44,5 +44,5 @@ int gettimeofday (void *tp, void *tzp); #ifdef __cplusplus } -#endif /* !__cplusplus */ +#endif /* __cplusplus */ #endif /* !JERRY_LIBC_TIME_H */ diff --git a/jerry-libc/target/posix/jerry-asm.S b/jerry-libc/target/posix/jerry-asm.S index afd44bee85..470b62121b 100644 --- a/jerry-libc/target/posix/jerry-asm.S +++ b/jerry-libc/target/posix/jerry-asm.S @@ -20,9 +20,9 @@ #include "arch/x86-32.h" #elif defined (__TARGET_HOST_ARMv7) #include "arch/arm-v7.h" -#else +#else /* !__TARGET_HOST_x64 && !__TARGET_HOST_x86 && !__TARGET_HOST_ARMv7 */ #error "Unsupported architecture" -#endif /* !__TARGET_HOST_x64 && !__TARGET_HOST_x86 && !__TARGET_HOST_ARMv7 */ +#endif /* __TARGET_HOST_x64 */ #if defined (__linux__) .macro func _name @@ -40,9 +40,9 @@ .endm .macro endfunc _name .endm -#else +#else /* !__linux && !(__APPLE__ && __MACH__) */ #error "Unsupported OS" -#endif /* !__linux && !(__APPLE__ && __MACH__) */ +#endif /* __linux__ */ func _start _START diff --git a/jerry-libc/target/posix/jerry-libc-target.c b/jerry-libc/target/posix/jerry-libc-target.c index c169280df9..beaefd722f 100644 --- a/jerry-libc/target/posix/jerry-libc-target.c +++ b/jerry-libc/target/posix/jerry-libc-target.c @@ -35,9 +35,9 @@ #elif defined (__APPLE__) && defined (__MACH__) #define SYS_exit_group SYS_exit #define SYSCALL_NO(NAME) SYS_ ## NAME -#else +#else /* !__linux && !(__APPLE__ && __MACH__) */ #error "Unsupported OS" -#endif /* !__linux && !(__APPLE__ && __MACH__) */ +#endif /* __linux__ */ #include "jerry-libc-defs.h" @@ -355,7 +355,7 @@ jrt_set_mem_limits (size_t data_size, /**< limit for data + bss + brk heap */ long int ret; -#ifdef __TARGET_HOST_x64 +#if defined (__TARGET_HOST_x64) ret = syscall_2 (SYSCALL_NO (setrlimit), RLIMIT_DATA, (intptr_t) &data_limit); assert (ret == 0); @@ -371,6 +371,6 @@ jrt_set_mem_limits (size_t data_size, /**< limit for data + bss + brk heap */ # error "__TARGET_HOST_x86 case is not implemented" #else /* !__TARGET_HOST_x64 && !__TARGET_HOST_ARMv7 && !__TARGET_HOST_x86 */ # error "!__TARGET_HOST_x64 && !__TARGET_HOST_ARMv7 && !__TARGET_HOST_x86" -#endif /* !__TARGET_HOST_x64 && !__TARGET_HOST_ARMv7 && !__TARGET_HOST_x86 */ +#endif /* __TARGET_HOST_x64 */ } /* jrt_set_mem_limits */ -#endif // FIXME +#endif /* 0 */ diff --git a/jerry-libm/include/math.h b/jerry-libm/include/math.h index 00f181d0e7..fc714432c7 100644 --- a/jerry-libm/include/math.h +++ b/jerry-libm/include/math.h @@ -20,7 +20,7 @@ #ifdef __cplusplus extern "C" { -#endif /* !__cplusplus */ +#endif /* __cplusplus */ // General Constants @@ -78,5 +78,5 @@ double fmod (double, double); #ifdef __cplusplus } -#endif /* !__cplusplus */ +#endif /* __cplusplus */ #endif /* !JERRY_LIBM_MATH_H */ diff --git a/jerry-libm/jerry-libm-internal.h b/jerry-libm/jerry-libm-internal.h index f593e9c4e1..a30f421f45 100644 --- a/jerry-libm/jerry-libm-internal.h +++ b/jerry-libm/jerry-libm-internal.h @@ -42,10 +42,10 @@ #ifdef __LITTLE_ENDIAN #define __HI(x) *(1 + (int *) &x) #define __LO(x) *(int *) &x -#else +#else /* !__LITTLE_ENDIAN */ #define __HI(x) *(int *) &x #define __LO(x) *(1 + (int *) &x) -#endif +#endif /* __LITTLE_ENDIAN */ /* * ANSI/POSIX diff --git a/tests/unit/test-api.c b/tests/unit/test-api.c index 876fb33820..ee3e2fe6be 100644 --- a/tests/unit/test-api.c +++ b/tests/unit/test-api.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. @@ -250,7 +250,7 @@ static bool foreach (const jerry_api_string_t *name, #elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 JERRY_ASSERT (value->type == JERRY_API_DATA_TYPE_FLOAT64); JERRY_ASSERT (value->u.v_float64 == 32.0); -#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */ +#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */ } else if (!strncmp (str_buf_p, "bravo", (size_t) sz)) { @@ -269,7 +269,7 @@ static bool foreach (const jerry_api_string_t *name, #elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 JERRY_ASSERT (value->type == JERRY_API_DATA_TYPE_FLOAT64); JERRY_ASSERT (value->u.v_float64 == 123.45); -#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */ +#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */ } else if (!strncmp (str_buf_p, "echo", (size_t) sz)) {