aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-03-07 14:06:34 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-03-07 14:06:34 +0100
commit39ff31be4c955d1fb72b2ac5a0e05531f2377c6c (patch)
treef49d2220cf295a99b138e7deb3c1fb3bb26a2ca7 /include
parent5c5629ebb387242e99e90ccbd0bb0344c4a393fa (diff)
Formatting fixes
Diffstat (limited to 'include')
-rw-r--r--include/bitset.h6
-rw-r--r--include/bob.h3
-rw-r--r--include/macros.h6
-rw-r--r--include/mbstring.h2
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 <limits.h>
-#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;