From 5691f3f685e0bfc8d5749387bca5815c8e69de27 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 26 Sep 2016 14:27:54 +0200 Subject: [PATCH] Fix function prototypes of generated pointer functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the emitted constructors were incomplete prototypes. When compiling the wrapper code using gcc 6 and -Wstrict-prototypes, the following warnings were emitted: warning: function declaration isn’t a prototype [-Wstrict-prototypes] See #801 --- Lib/cpointer.i | 4 ++-- Lib/typemaps/cpointer.swg | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/cpointer.i b/Lib/cpointer.i index a04de3d67..df40c0426 100644 --- a/Lib/cpointer.i +++ b/Lib/cpointer.i @@ -120,7 +120,7 @@ static NAME * frompointer(TYPE *t) { %define %pointer_functions(TYPE,NAME) %{ -static TYPE *new_##NAME() { %} +static TYPE *new_##NAME(void) { %} #ifdef __cplusplus %{ return new TYPE(); %} #else @@ -155,7 +155,7 @@ static TYPE NAME ##_value(TYPE *obj) { } %} -TYPE *new_##NAME(); +TYPE *new_##NAME(void); TYPE *copy_##NAME(TYPE value); void delete_##NAME(TYPE *obj); void NAME##_assign(TYPE *obj, TYPE value); diff --git a/Lib/typemaps/cpointer.swg b/Lib/typemaps/cpointer.swg index 88e8ef242..a5ac07d85 100644 --- a/Lib/typemaps/cpointer.swg +++ b/Lib/typemaps/cpointer.swg @@ -105,7 +105,7 @@ typedef struct { %define %pointer_functions(TYPE,NAME) %{ - static TYPE *new_##NAME() { + static TYPE *new_##NAME(void) { return %new_instance(TYPE); } @@ -126,7 +126,7 @@ typedef struct { } %} -TYPE *new_##NAME(); +TYPE *new_##NAME(void); TYPE *copy_##NAME(TYPE value); void delete_##NAME(TYPE *obj); void NAME##_assign(TYPE *obj, TYPE value);