From 6e204c91b6c7ece751331de2fa3fb460bc5edd59 Mon Sep 17 00:00:00 2001 From: David Fabro Date: Thu, 10 Jun 2010 14:54:41 +0200 Subject: non-modified payload arguments are pointer-to-const The payload parameters to nfq_set_verdict(), nfq_set_verdict2(), and nfq_set_verdict_mark() are not modified by those functions, and therefore should have datatype pointer-to-const. This both causes the source-code to more effectively represent what is the purpose of the parameter, and eliminates the need to cast away const-ness when calling the functions with compilers that enforce strict casting. All existing calling code should not need modification as pointer-to-X automatically converts to pointer-to-const-X. Signed-off-by: David Favro Signed-off-by: Pablo Neira Ayuso --- include/libnetfilter_queue/libnetfilter_queue.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libnetfilter_queue/libnetfilter_queue.h b/include/libnetfilter_queue/libnetfilter_queue.h index 88a9b8c..2e2ca8b 100644 --- a/include/libnetfilter_queue/libnetfilter_queue.h +++ b/include/libnetfilter_queue/libnetfilter_queue.h @@ -60,14 +60,14 @@ extern int nfq_set_verdict(struct nfq_q_handle *qh, u_int32_t id, u_int32_t verdict, u_int32_t data_len, - unsigned char *buf); + const unsigned char *buf); extern int nfq_set_verdict2(struct nfq_q_handle *qh, u_int32_t id, u_int32_t verdict, u_int32_t mark, u_int32_t datalen, - unsigned char *buf); + const unsigned char *buf); extern __attribute__((deprecated)) int nfq_set_verdict_mark(struct nfq_q_handle *qh, @@ -75,7 +75,7 @@ int nfq_set_verdict_mark(struct nfq_q_handle *qh, u_int32_t verdict, u_int32_t mark, u_int32_t datalen, - unsigned char *buf); + const unsigned char *buf); /* message parsing function */ -- cgit v1.2.3