From a44ea3e5675078954740c54ec0400bb6d56397b2 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 20 Sep 2023 22:09:19 +0200 Subject: datatype: return const pointer from datatype_get() "struct datatype" is for the most part immutable, and most callers deal with const pointers. That's why datatype_get() accepts a const pointer to increase the reference count (mutating the refcnt field). It should also return a const pointer. In fact, all callers are fine with that already. Signed-off-by: Thomas Haller Signed-off-by: Pablo Neira Ayuso --- src/datatype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/datatype.c') diff --git a/src/datatype.c b/src/datatype.c index 8d65ab8b..f5d700bd 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -1211,7 +1211,7 @@ static struct datatype *datatype_alloc(void) return dtype; } -struct datatype *datatype_get(const struct datatype *ptr) +const struct datatype *datatype_get(const struct datatype *ptr) { struct datatype *dtype = (struct datatype *)ptr; -- cgit v1.2.3