summaryrefslogtreecommitdiffstats
path: root/include/datatype.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-09-20 22:09:19 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2023-09-21 00:00:38 +0200
commita44ea3e5675078954740c54ec0400bb6d56397b2 (patch)
tree9b9e1e1d6b00b9dabb6eb710084e7ca9003aa49f /include/datatype.h
parent3526ca46c74f6e355f6377e24778363646392835 (diff)
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 <thaller@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/datatype.h')
-rw-r--r--include/datatype.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/datatype.h b/include/datatype.h
index 4e838a38..09a78945 100644
--- a/include/datatype.h
+++ b/include/datatype.h
@@ -174,7 +174,7 @@ struct datatype {
extern const struct datatype *datatype_lookup(enum datatypes type);
extern const struct datatype *datatype_lookup_byname(const char *name);
-extern struct datatype *datatype_get(const struct datatype *dtype);
+extern const struct datatype *datatype_get(const struct datatype *dtype);
extern void datatype_set(struct expr *expr, const struct datatype *dtype);
extern void __datatype_set(struct expr *expr, const struct datatype *dtype);
extern void datatype_free(const struct datatype *dtype);