From 7b7f06f81aab8d653166c56be9cc3fff5716a085 Mon Sep 17 00:00:00 2001 From: Jonathan Cubides Date: Mon, 23 Oct 2023 19:12:56 +0200 Subject: [PATCH] Update clang formatting (#2465) Using ``` clang-format --version Homebrew clang-format version 17.0.2 ``` --- .pre-commit-config.yaml | 4 ++-- runtime/src/juvix/object/closure.h | 2 +- runtime/src/juvix/object/object.h | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d5ae37eb9..d8fda51b7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-yaml - id: check-added-large-files @@ -41,7 +41,7 @@ repos: types_or: [json] - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v16.0.6 + rev: v17.0.2 hooks: - id: clang-format files: runtime/.+\.(c|h)$ diff --git a/runtime/src/juvix/object/closure.h b/runtime/src/juvix/object/closure.h index 1f9702c0e..88e39f924 100644 --- a/runtime/src/juvix/object/closure.h +++ b/runtime/src/juvix/object/closure.h @@ -96,7 +96,7 @@ EXTEND_CLOSURE(dest, src, n, { #define DECL_ZEROARG_CLOSURE(name, fuid, largs) \ word_t juvix_zeroarg_closure_data_##name[1 + CLOSURE_SKIP]; \ word_t juvix_zeroarg_closure_##name = \ - (word_t)&juvix_zeroarg_closure_data_##name; \ + (word_t) & juvix_zeroarg_closure_data_##name; \ INIT_CLOSURE(juvix_zeroarg_closure_##name, fuid, \ LABEL_ADDR(juvix_closure_##name), 0, largs); diff --git a/runtime/src/juvix/object/object.h b/runtime/src/juvix/object/object.h index 864429de6..29f9108fd 100644 --- a/runtime/src/juvix/object/object.h +++ b/runtime/src/juvix/object/object.h @@ -6,7 +6,7 @@ // The least significant two bits encode object kind #define KIND_MASK 3 -#define GET_KIND(x) ((word_t)(x)&KIND_MASK) +#define GET_KIND(x) ((word_t)(x) & KIND_MASK) #define KIND_PTR 0 #define KIND_UNBOXED0 1 @@ -14,7 +14,7 @@ #define KIND_HEADER 2 #define KIND3_MASK 7 -#define GET_KIND3(x) ((word_t)(x)&KIND3_MASK) +#define GET_KIND3(x) ((word_t)(x) & KIND3_MASK) static inline bool is_unboxed(word_t x) { return x & 1; } static inline bool is_ptr(word_t x) { return GET_KIND(x) == KIND_PTR; } @@ -60,7 +60,7 @@ static inline word_t clear_mark(word_t x) { return x & ~MARK_MASK; } #define UID_MASK ((word_t)0x00FFFFF0) #define UID_SHIFT 4U -#define GET_UID(x) (((word_t)(x)&UID_MASK) >> UID_SHIFT) +#define GET_UID(x) (((word_t)(x) & UID_MASK) >> UID_SHIFT) #define NFIELDS_MASK 0xFF000000 #define NFIELDS_SHIFT 24U @@ -105,16 +105,16 @@ static inline bool is_special_header(word_t x) { #define SUID_MASK ((word_t)0x30) #define SUID_SHIFT 4U -#define GET_SUID(x) (((word_t)(x)&SUID_MASK) >> SUID_SHIFT) +#define GET_SUID(x) (((word_t)(x) & SUID_MASK) >> SUID_SHIFT) #define SKIP_MASK ((word_t)0xC0) #define SKIP_SHIFT 6U -#define GET_SKIP(x) (((word_t)(x)&SKIP_MASK) >> SKIP_SHIFT) +#define GET_SKIP(x) (((word_t)(x) & SKIP_MASK) >> SKIP_SHIFT) #define SKIP_ALL 3U #define RESERVED_MASK 0x00FFFF00 #define RESERVED_SHIFT 8U -#define GET_RESERVED(x) (((word_t)(x)&RESERVED_MASK) >> RESERVED_SHIFT) +#define GET_RESERVED(x) (((word_t)(x) & RESERVED_MASK) >> RESERVED_SHIFT) static inline word_t make_special_header(word_t suid, word_t nfields, word_t skip, word_t reserved) {