Skip to content

Commit

Permalink
Update clang formatting (#2465)
Browse files Browse the repository at this point in the history
Using

```
clang-format --version
Homebrew clang-format version 17.0.2
```
  • Loading branch information
jonaprieto authored Oct 23, 2023
1 parent f58c4a6 commit 7b7f06f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)$
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/juvix/object/closure.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
12 changes: 6 additions & 6 deletions runtime/src/juvix/object/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

// 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
#define KIND_UNBOXED1 3
#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; }
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7b7f06f

Please sign in to comment.