From 1ed3c5413c4530856a5b1d476cb2001bcf444f0c Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 20 Apr 2023 13:31:42 +1200 Subject: Make string& consistent in PHP's std_string.i --- Lib/php/std_string.i | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Lib/php/std_string.i b/Lib/php/std_string.i index b2039786c..afd09b071 100644 --- a/Lib/php/std_string.i +++ b/Lib/php/std_string.i @@ -45,7 +45,7 @@ namespace std { ZVAL_STRINGL($input, $1.data(), $1.size()); %} - %typemap(out, phptype="string") const string & %{ + %typemap(out, phptype="string") const string& %{ ZVAL_STRINGL($result, $1->data(), $1->size()); %} @@ -54,7 +54,7 @@ namespace std { goto fail; %} - %typemap(in, phptype="string") const string & ($*1_ltype temp) %{ + %typemap(in, phptype="string") const string& ($*1_ltype temp) %{ convert_to_string(&$input); temp.assign(Z_STRVAL($input), Z_STRLEN($input)); $1 = &temp; @@ -62,7 +62,7 @@ namespace std { /* These next two handle a function which takes a non-const reference to * a std::string and modifies the string. */ - %typemap(in,byref=1, phptype="string") string & ($*1_ltype temp) %{ + %typemap(in,byref=1, phptype="string") string& ($*1_ltype temp) %{ { zval * p = Z_ISREF($input) ? Z_REFVAL($input) : &$input; convert_to_string(p); @@ -71,14 +71,14 @@ namespace std { } %} - %typemap(directorout) string & ($*1_ltype *temp) %{ + %typemap(directorout) string& ($*1_ltype *temp) %{ convert_to_string($input); temp = new $*1_ltype(Z_STRVAL_P($input), Z_STRLEN_P($input)); swig_acquire_ownership(temp); $result = temp; %} - %typemap(argout) string & %{ + %typemap(argout) string& %{ if (Z_ISREF($input)) { ZVAL_STRINGL(Z_REFVAL($input), $1->data(), $1->size()); } @@ -86,5 +86,5 @@ namespace std { /* SWIG will apply the non-const typemap above to const string& without * this more specific typemap. */ - %typemap(argout) const string & "" + %typemap(argout) const string& "" } -- cgit v1.2.1