From 846f605e6ed459f1276c218cb1421514d6b43c90 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Sat, 11 Oct 2014 18:47:28 +0200 Subject: [PATCH] bytestring: Use CONST_FUNCTION The bytestring() constructor function satisfies the constraints of CONST_FUNCTION, so mark it as such. Signed-off-by: David Gibson --- ccan/bytestring/_info | 1 + ccan/bytestring/bytestring.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ccan/bytestring/_info b/ccan/bytestring/_info index f68a4c73..34b0d129 100644 --- a/ccan/bytestring/_info +++ b/ccan/bytestring/_info @@ -36,6 +36,7 @@ int main(int argc, char *argv[]) if (strcmp(argv[1], "depends") == 0) { printf("ccan/array_size\n"); printf("ccan/mem\n"); + printf("ccan/compiler\n"); return 0; } diff --git a/ccan/bytestring/bytestring.h b/ccan/bytestring/bytestring.h index 0d1c929e..fd518770 100644 --- a/ccan/bytestring/bytestring.h +++ b/ccan/bytestring/bytestring.h @@ -11,6 +11,7 @@ #include #include +#include struct bytestring { const char *ptr; @@ -29,7 +30,8 @@ struct bytestring { * struct bytestring bs = bytestring(x, 5); * assert(bs.len == 5); */ -static inline struct bytestring bytestring(const char *p, size_t l) +static inline CONST_FUNCTION struct bytestring +bytestring(const char *p, size_t l) { struct bytestring bs = { .ptr = p, -- 2.39.2