From 0cb8591199e830c42b0b39df3c90bcbb784fe328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Tokodi?= Date: Tue, 21 Nov 2023 12:35:46 +0100 Subject: [PATCH] WIP: update formatting TODO: re-enable CI checker for clangformat --- jerry-core/api/jerry-snapshot.c | 1 - .../builtin-objects/ecma-builtin-helpers.h | 2 +- jerry-core/ecma/operations/ecma-objects.c | 5 +++-- jerry-core/include/jerryscript-compiler.h | 6 +++--- jerry-core/jrt/jrt.h | 2 +- jerry-ext/include/jerryscript-ext/module.h | 8 ++++---- jerry-main/benchmark/main-benchmark.c | 18 +++++++++--------- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/jerry-core/api/jerry-snapshot.c b/jerry-core/api/jerry-snapshot.c index 924dae8631..5c13eaf30f 100644 --- a/jerry-core/api/jerry-snapshot.c +++ b/jerry-core/api/jerry-snapshot.c @@ -92,7 +92,6 @@ typedef struct bool class_found; } snapshot_globals_t; - /** * Write data into the specified buffer. * diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h index 89cf45e88f..823e3d5ea4 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h @@ -262,7 +262,7 @@ typedef ecma_value_t (*ecma_builtin_helper_sort_compare_fn_t) (ecma_value_t lhs, ecma_value_t rhs, /**< right value */ ecma_value_t compare_func, /**< compare function */ ecma_object_t *array_buffer_p /**< arrayBuffer */ - ); +); ecma_value_t ecma_builtin_helper_array_merge_sort_helper (ecma_value_t *array_p, uint32_t length, diff --git a/jerry-core/ecma/operations/ecma-objects.c b/jerry-core/ecma/operations/ecma-objects.c index cb3bc06876..b4939f4c6e 100644 --- a/jerry-core/ecma/operations/ecma-objects.c +++ b/jerry-core/ecma/operations/ecma-objects.c @@ -1851,8 +1851,9 @@ ecma_op_object_get_own_property_descriptor (ecma_object_t *object_p, /**< the ob } prop_desc_p->flags |= (JERRY_PROP_IS_VALUE_DEFINED | JERRY_PROP_IS_WRITABLE_DEFINED); - prop_desc_p->flags = (uint16_t) ( - prop_desc_p->flags | (ecma_is_property_writable (property) ? JERRY_PROP_IS_WRITABLE : JERRY_PROP_NO_OPTS)); + prop_desc_p->flags = + (uint16_t) (prop_desc_p->flags + | (ecma_is_property_writable (property) ? JERRY_PROP_IS_WRITABLE : JERRY_PROP_NO_OPTS)); } else { diff --git a/jerry-core/include/jerryscript-compiler.h b/jerry-core/include/jerryscript-compiler.h index 8ebe6efce0..4732f010f7 100644 --- a/jerry-core/include/jerryscript-compiler.h +++ b/jerry-core/include/jerryscript-compiler.h @@ -64,9 +64,9 @@ JERRY_C_API_BEGIN /* * Compiler-specific macros relevant for Microsoft Visual C/C++ Compiler. */ -#define JERRY_ATTR_DEPRECATED __declspec(deprecated) -#define JERRY_ATTR_NOINLINE __declspec(noinline) -#define JERRY_ATTR_NORETURN __declspec(noreturn) +#define JERRY_ATTR_DEPRECATED __declspec (deprecated) +#define JERRY_ATTR_NOINLINE __declspec (noinline) +#define JERRY_ATTR_NORETURN __declspec (noreturn) /* * Microsoft Visual C/C++ Compiler doesn't support for VLA, using _alloca diff --git a/jerry-core/jrt/jrt.h b/jerry-core/jrt/jrt.h index 973d4fc3d3..2c1f308d96 100644 --- a/jerry-core/jrt/jrt.h +++ b/jerry-core/jrt/jrt.h @@ -217,7 +217,7 @@ void jerry_jrt_set_log_level (jerry_log_level_t level); */ #if defined(__clang__) || defined(__GNUC__) /* Clang/GCC will not tail call given inline volatile assembly. */ -#define JERRY_BLOCK_TAIL_CALL_OPTIMIZATION() __asm__ __volatile__("") +#define JERRY_BLOCK_TAIL_CALL_OPTIMIZATION() __asm__ __volatile__ ("") #else /* !defined(__clang__) && !defined(__GNUC__) */ /* On GCC 10.x this version also works. */ #define JERRY_BLOCK_TAIL_CALL_OPTIMIZATION() \ diff --git a/jerry-ext/include/jerryscript-ext/module.h b/jerry-ext/include/jerryscript-ext/module.h index 6c53650390..9fb4483e16 100644 --- a/jerry-ext/include/jerryscript-ext/module.h +++ b/jerry-ext/include/jerryscript-ext/module.h @@ -62,10 +62,10 @@ typedef struct jerryx_native_module_t #pragma section(".CRT$XCU", read) #pragma section(".CRT$XTU", read) -#define JERRYX_MSVC_FUNCTION_ON_SECTION(sec_name, f) \ - static void f (void); \ - __pragma (JERRYX_MSVC_INCLUDE_SYM (f##_section)) __declspec(allocate (sec_name)) \ - JERRYX_MSCV_EXTERN_C void (*f##_section) (void) = f; \ +#define JERRYX_MSVC_FUNCTION_ON_SECTION(sec_name, f) \ + static void f (void); \ + __pragma (JERRYX_MSVC_INCLUDE_SYM (f##_section)) __declspec (allocate (sec_name)) \ + JERRYX_MSCV_EXTERN_C void (*f##_section) (void) = f; \ static void f (void) #define JERRYX_MODULE_CONSTRUCTOR(f) JERRYX_MSVC_FUNCTION_ON_SECTION (".CRT$XCU", f) diff --git a/jerry-main/benchmark/main-benchmark.c b/jerry-main/benchmark/main-benchmark.c index 21e7784a8b..25cf741b62 100644 --- a/jerry-main/benchmark/main-benchmark.c +++ b/jerry-main/benchmark/main-benchmark.c @@ -162,19 +162,19 @@ run (void) #endif /* !(defined ( __linux__) && __linux__) */ #if defined(__x86_64__) -#define STACK_SAVE(TARGET) \ - { \ - __asm volatile("mov %%rsp, %0" : "=m"(TARGET)); \ +#define STACK_SAVE(TARGET) \ + { \ + __asm volatile ("mov %%rsp, %0" : "=m"(TARGET)); \ } #elif defined(__i386__) -#define STACK_SAVE(TARGET) \ - { \ - __asm volatile("mov %%esp, %0" : "=m"(TARGET)); \ +#define STACK_SAVE(TARGET) \ + { \ + __asm volatile ("mov %%esp, %0" : "=m"(TARGET)); \ } #elif defined(__arm__) -#define STACK_SAVE(TARGET) \ - { \ - __asm volatile("mov %0, sp" : "=r"(TARGET)); \ +#define STACK_SAVE(TARGET) \ + { \ + __asm volatile ("mov %0, sp" : "=r"(TARGET)); \ } #else /* !defined (__x86_64__) && !defined (__i386__) && !defined (__arm__) */ #error "Unsupported stack measurement target!"