From 600890067c40e1846398db373b9c38b6fe9a16a6 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Tue, 26 Apr 2016 14:16:58 +0100 Subject: libnftnl: constify object arguments to various functions flow table support needs constant object arguments to printing functions to avoid ugly casts. While at it, also constify object arguments to message construction, destructor and a few helper functions. Signed-off-by: Patrick McHardy Signed-off-by: Pablo Neira Ayuso --- src/utils.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c index ba36bc4..089446c 100644 --- a/src/utils.c +++ b/src/utils.c @@ -233,9 +233,11 @@ uint32_t nftnl_str2cmd(const char *cmd) return NFTNL_CMD_UNSPEC; } -int nftnl_fprintf(FILE *fp, void *obj, uint32_t cmd, uint32_t type, uint32_t flags, - int (*snprintf_cb)(char *buf, size_t bufsiz, void *obj, - uint32_t cmd, uint32_t type, uint32_t flags)) +int nftnl_fprintf(FILE *fp, const void *obj, uint32_t cmd, uint32_t type, + uint32_t flags, + int (*snprintf_cb)(char *buf, size_t bufsiz, const void *obj, + uint32_t cmd, uint32_t type, + uint32_t flags)) { char _buf[NFTNL_SNPRINTF_BUFSIZ]; char *buf = _buf; -- cgit v1.2.3