From 89987806cdf0cf27aeadf92fdd251fd5579495b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Tue, 22 Nov 2016 18:00:49 +0100 Subject: [PATCH] Add (void) argument to be ANSI C compliant Add void argument has to avoid warning messages when compiling python bindings with CFFI since it uses -Wstrict-prototypes option by default. Modify`msc_create_rules_set` and `msc_init` internals, now it returns directly an instance like `msc_new_transaction` in transaction.cc. --- src/modsecurity.cc | 6 ++---- src/rules.cc | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/modsecurity.cc b/src/modsecurity.cc index 9f4b6091..c862e097 100644 --- a/src/modsecurity.cc +++ b/src/modsecurity.cc @@ -255,10 +255,8 @@ extern "C" void msc_cleanup(ModSecurity *msc) { * * @endcode */ -extern "C" ModSecurity *msc_init() { - ModSecurity *modsec = new ModSecurity(); - - return modsec; +extern "C" ModSecurity *msc_init(void) { + return new ModSecurity(); } diff --git a/src/rules.cc b/src/rules.cc index 85bea585..d0489434 100644 --- a/src/rules.cc +++ b/src/rules.cc @@ -309,10 +309,8 @@ void Rules::dump() { } -extern "C" Rules *msc_create_rules_set() { - Rules *rules = new Rules(); - - return rules; +extern "C" Rules *msc_create_rules_set(void) { + return new Rules(); }