From fbe0f33b45abd585eb9f52cb56d751a750667dc6 Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Wed, 3 Aug 2016 12:52:34 +0200 Subject: callback: mark cb_ctl_array 'const' in mnl_cb_run2() Users of mnl_cb_run2() would typically pass a 'static const' array as cb_ctl_array parameter. Unfortunately this triggers a compiler warning because the prototype doesn't declare cb_ctl_array with the 'const' qualifier. Since mnl_cb_run2() and __mnl_cb_run() don't modify cb_ctl_array (and don't have any reason to do so in the future), we can mark this parameter as 'const'. There should be no impact on existing users beyond removing the compiler warning when using a constant array. Signed-off-by: Guillaume Nault Signed-off-by: Pablo Neira Ayuso --- include/libmnl/libmnl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/libmnl/libmnl.h') diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h index 5adb13c..0331da7 100644 --- a/include/libmnl/libmnl.h +++ b/include/libmnl/libmnl.h @@ -179,7 +179,8 @@ extern int mnl_cb_run(const void *buf, size_t numbytes, unsigned int seq, extern int mnl_cb_run2(const void *buf, size_t numbytes, unsigned int seq, unsigned int portid, mnl_cb_t cb_data, void *data, - mnl_cb_t *cb_ctl_array, unsigned int cb_ctl_array_len); + const mnl_cb_t *cb_ctl_array, + unsigned int cb_ctl_array_len); /* * other declarations -- cgit v1.2.3