From fccd1e294a2ab2e6a5c3a236e915b4e86fbed905 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Wed, 1 Oct 2008 11:54:31 +0000 Subject: [PATCH] Fix indentation. Use %{ %} in a couple of typemaps to avoid adding needless { } to the generated code. Use memcpy() instead of memmove() where the destination is freshly allocated so there's no possibility of overlap. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10887 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/php/php.swg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Lib/php/php.swg b/Lib/php/php.swg index 916a5159e..28431610a 100644 --- a/Lib/php/php.swg +++ b/Lib/php/php.swg @@ -205,15 +205,15 @@ %typemap(out) SWIGTYPE *, SWIGTYPE [], SWIGTYPE & -{ - SWIG_SetPointerZval(return_value, (void *)$1, $1_descriptor, $owner); -} +%{ + SWIG_SetPointerZval(return_value, (void *)$1, $1_descriptor, $owner); +%} %typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); - SWIG_SetPointerZval(return_value, (void *)$1, ty, $owner); + swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); + SWIG_SetPointerZval(return_value, (void *)$1, ty, $owner); } %typemap(out) SWIGTYPE @@ -225,7 +225,7 @@ #else { $&1_ltype resultobj = ($&1_ltype) emalloc(sizeof($1_type)); - memmove(resultobj, &$1, sizeof($1_type)); + memcpy(resultobj, &$1, sizeof($1_type)); SWIG_SetPointerZval(return_value, (void *)resultobj, $&1_descriptor, 1); } #endif @@ -233,9 +233,9 @@ %typemap(out) void ""; %typemap(out) char [ANY] -{ +%{ RETVAL_STRINGL($1,$1_dim0,1); -} +%} // This typecheck does hard checking for proper argument type. If you want // an argument to be converted from a different PHP type, you must convert