Fix compiler warnings in generated code when using -std=c++98 -std=gnu89 -pedantic -Wreturn-type

This commit is contained in:
William S Fulton 2014-05-24 00:14:18 +01:00
commit 3191473523
9 changed files with 80 additions and 60 deletions

View file

@ -34,12 +34,12 @@
SWIGTYPE &&,
SWIGTYPE [] {
zval *z_var;
zend_constant c;
size_t len = sizeof("$symname") - 1;
MAKE_STD_ZVAL(z_var);
SWIG_SetPointerZval(z_var, (void*)$value, $1_descriptor, 0);
zend_constant c;
c.value = *z_var;
zval_copy_ctor(&c.value);
size_t len = sizeof("$symname") - 1;
c.name = zend_strndup("$symname", len);
c.name_len = len+1;
c.flags = CONST_CS | CONST_PERSISTENT;

View file

@ -92,6 +92,7 @@
%fragment("t_output_helper","header") %{
static void
t_output_helper(zval **target, zval *o TSRMLS_DC) {
zval *tmp;
if ( (*target)->type == IS_ARRAY ) {
/* it's already an array, just append */
add_next_index_zval( *target, o );
@ -102,7 +103,6 @@ t_output_helper(zval **target, zval *o TSRMLS_DC) {
FREE_ZVAL(o);
return;
}
zval *tmp;
ALLOC_INIT_ZVAL(tmp);
*tmp = **target;
zval_copy_ctor(tmp);