Fix function prototypes of generated pointer functions

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
This commit is contained in:
Justus Winter 2016-09-26 14:27:54 +02:00 committed by Olly Betts
commit 5691f3f685
2 changed files with 4 additions and 4 deletions

View file

@ -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);

View file

@ -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);