From b105dee61824f2848b2f199943b7689ece2158b9 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 11 Jun 2024 00:17:46 +0200 Subject: Color functions with __attribute__() --- src/errors.h | 2 +- src/unicode.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/errors.h b/src/errors.h index c3ccaf2..eebd607 100644 --- a/src/errors.h +++ b/src/errors.h @@ -3,6 +3,6 @@ #include -noreturn void err(const char *, ...); +noreturn void err(const char *, ...) __attribute__((format(printf, 1, 2))); #endif /* !ORYX_ERRORS_H */ diff --git a/src/unicode.h b/src/unicode.h index 8b18d45..36bbc81 100644 --- a/src/unicode.h +++ b/src/unicode.h @@ -9,14 +9,14 @@ typedef uint32_t rune; /* Assert that CH has the Unicode Pattern_White_Space property */ -bool rune_is_pat_ws(rune ch); +bool rune_is_pat_ws(rune ch) __attribute__((const)); /* Assert that CH has the Unicode XID_Start or XID_Continue property. The rune_is_xids() function extends XID_Start to include U+005F LOW LINE, and the rune_is_xidc() function extends XID_Continue to include U+2032 PRIME, U+2033 DOUBLE PRIME, U+2034 TRIPLE PRIME, and U+2057 QUADRUPLE PRIME. */ -bool rune_is_xids(rune ch); -bool rune_is_xidc(rune ch); +bool rune_is_xids(rune ch) __attribute__((const)); +bool rune_is_xidc(rune ch) __attribute__((const)); /* Decode the first UTF-8 rune in S, and point S to the next rune in the stream. This function assumes that S points to a buffer that’s padded to a length of -- cgit v1.2.3