diff options
author | Olly Betts <olly@survex.com> | 2023-04-20 13:31:42 +1200 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2023-04-20 13:31:42 +1200 |
commit | 1ed3c5413c4530856a5b1d476cb2001bcf444f0c (patch) | |
tree | f6751a9f7860054b33c08c8632fe2de6dede2c1f | |
parent | e55a5f2da30cb2ce8bb55af05e92b6da2c52e38a (diff) | |
download | swig-1ed3c5413c4530856a5b1d476cb2001bcf444f0c.tar.gz |
Make string& consistent in PHP's std_string.i
-rw-r--r-- | Lib/php/std_string.i | 12 |
1 files 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& "" } |