From 39ff31be4c955d1fb72b2ac5a0e05531f2377c6c Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 7 Mar 2024 14:06:34 +0100 Subject: Formatting fixes --- include/bitset.h | 6 +++--- include/bob.h | 3 +-- include/macros.h | 6 ++++-- include/mbstring.h | 2 ++ 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/bitset.h b/include/bitset.h index 397435f..c72985e 100644 --- a/include/bitset.h +++ b/include/bitset.h @@ -3,13 +3,13 @@ #include -#define __MLIB_BITSLOT(x) ((x) / CHAR_BIT) -#define __MLIB_BITMASK(x) (1 << ((x) % CHAR_BIT)) +#define __MLIB_BITSLOT(x) ((x) / CHAR_BIT) +#define __MLIB_BITMASK(x) (1 << ((x) % CHAR_BIT)) #define __MLIB_BITIMPL(bs, x, op) ((bs)[__MLIB_BITSLOT(x)] op __MLIB_BITMASK(x)) #define bitset(name, n) unsigned char name[(n + CHAR_BIT - 1) / CHAR_BIT] -#define BITCLR(bs, x) __MLIB_BITIMPL(bs, x, &=~) +#define BITCLR(bs, x) __MLIB_BITIMPL(bs, x, &= ~) #define BITSET(bs, x) __MLIB_BITIMPL(bs, x, |=) #define BITTOGL(bs, x) __MLIB_BITIMPL(bs, x, ^=) #define BITTEST(bs, x) (bool)__MLIB_BITIMPL(bs, x, &) diff --git a/include/bob.h b/include/bob.h index f2fb429..e39a769 100644 --- a/include/bob.h +++ b/include/bob.h @@ -42,7 +42,6 @@ u8strtou8(struct u8str s) int: u8strpushr, \ rune: u8strpushr, \ char *: u8strpushstr, \ - struct u8view: u8strpushu8 \ - )((sb), (x)) + struct u8view: u8strpushu8)((sb), (x)) #endif /* !MLIB_BOB_H */ diff --git a/include/macros.h b/include/macros.h index 2b62625..24a5a5d 100644 --- a/include/macros.h +++ b/include/macros.h @@ -15,8 +15,10 @@ # define ASSUME(p) ((p) ? (void)0 : unreachable()) #else # include "errors.h" -# define ASSUME(p) ((p) ? (void)0 : warnx("%s:%s:%d: assumption ā€˜%sā€™ failed", \ - __FILE__, __func__, __LINE__, #p)) +# define ASSUME(p) \ + ((p) ? (void)0 \ + : warnx("%s:%s:%d: assumption ā€˜%sā€™ failed", __FILE__, __func__, \ + __LINE__, #p)) #endif #endif /* !MLIB_MACROS_H */ diff --git a/include/mbstring.h b/include/mbstring.h index cf2d6c5..9545f1a 100644 --- a/include/mbstring.h +++ b/include/mbstring.h @@ -16,11 +16,13 @@ struct u8view { }; #endif +/* clang-format off */ #define U8_BYTE_1(x) (((x) & 0x80) == 0x00) #define U8_BYTE_2(x) (((x) & 0xE0) == 0xC0) #define U8_BYTE_3(x) (((x) & 0xF0) == 0xE0) #define U8_BYTE_4(x) (((x) & 0xF8) == 0xF0) #define U8_BYTE_C(x) (((x) & 0xC0) == 0x80) +/* clang-format on */ static const rune U8_1B_MAX = 0x00007FL; static const rune U8_2B_MAX = 0x0007FFL; -- cgit v1.2.3