Patchwork [5/5] libxtables: constify xtables_option_[mt]fcall argument

login
register
mail settings
Submitter Jan Engelhardt
Date March 5, 2013, 1:08 a.m.
Message ID <1362445695-15952-6-git-send-email-jengelh@inai.de>
Download mbox | patch
Permalink /patch/224895/
State Not Applicable
Headers show

Comments

Jan Engelhardt - March 5, 2013, 1:08 a.m.
Nothing modifies the match/target, so we can mark it const.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
---
 include/xtables.h      |    4 ++--
 libxtables/xtoptions.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/include/xtables.h b/include/xtables.h
index c35a6e6..f14914c 100644
--- a/include/xtables.h
+++ b/include/xtables.h
@@ -535,8 +535,8 @@  extern void xtables_option_tpcall(unsigned int, char **, bool,
 				  struct xtables_target *, void *);
 extern void xtables_option_mpcall(unsigned int, char **, bool,
 				  struct xtables_match *, void *);
-extern void xtables_option_tfcall(struct xtables_target *);
-extern void xtables_option_mfcall(struct xtables_match *);
+extern void xtables_option_tfcall(const struct xtables_target *);
+extern void xtables_option_mfcall(const struct xtables_match *);
 extern void xtables_options_fcheck(const char *, unsigned int,
 				   const struct xt_option_entry *);
 
diff --git a/libxtables/xtoptions.c b/libxtables/xtoptions.c
index 452e0fe..01c626c 100644
--- a/libxtables/xtoptions.c
+++ b/libxtables/xtoptions.c
@@ -1034,7 +1034,7 @@  void xtables_options_fcheck(const char *name, unsigned int xflags,
  * Dispatch arguments to the appropriate final_check function, based upon the
  * extension's choice of API.
  */
-void xtables_option_tfcall(struct xtables_target *t)
+void xtables_option_tfcall(const struct xtables_target *t)
 {
 	if (t->x6_fcheck != NULL) {
 		struct xt_fcheck_call cb;
@@ -1055,7 +1055,7 @@  void xtables_option_tfcall(struct xtables_target *t)
  * Dispatch arguments to the appropriate final_check function, based upon the
  * extension's choice of API.
  */
-void xtables_option_mfcall(struct xtables_match *m)
+void xtables_option_mfcall(const struct xtables_match *m)
 {
 	if (m->x6_fcheck != NULL) {
 		struct xt_fcheck_call cb;