summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2015-01-14 10:44:54 +1300
committerOlly Betts <olly@survex.com>2015-01-14 10:44:54 +1300
commitea5be4e5083750f0aeb168a748e14ec6d809b3c0 (patch)
tree69f2e3e08455ade69698330eef3e9e704c1887cf
parenta9f812809420ce8393eea410232d66b6d8b90d5c (diff)
downloadswig-ea5be4e5083750f0aeb168a748e14ec6d809b3c0.tar.gz
Fix PHP backend for default_args testcase
-rw-r--r--Source/Modules/php.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx
index 218d6250c..00dfb064e 100644
--- a/Source/Modules/php.cxx
+++ b/Source/Modules/php.cxx
@@ -1284,7 +1284,8 @@ public:
case T_SCHAR:
case T_SHORT:
case T_INT:
- case T_LONG: {
+ case T_LONG:
+ case T_LONGLONG: {
char *p;
errno = 0;
long n = strtol(Char(value), &p, 0);
@@ -1298,7 +1299,8 @@ public:
case T_UCHAR:
case T_USHORT:
case T_UINT:
- case T_ULONG: {
+ case T_ULONG:
+ case T_ULONGLONG: {
char *p;
errno = 0;
unsigned int n = strtoul(Char(value), &p, 0);
@@ -1310,7 +1312,8 @@ public:
break;
}
case T_FLOAT:
- case T_DOUBLE:{
+ case T_DOUBLE:
+ case T_LONGDOUBLE: {
char *p;
errno = 0;
/* FIXME: strtod is locale dependent... */
@@ -1329,13 +1332,6 @@ public:
}
break;
}
- case T_REFERENCE:
- case T_RVALUE_REFERENCE:
- case T_USER:
- case T_ARRAY:
- Clear(value);
- Append(value, "?");
- break;
case T_STRING:
if (Len(value) < 2) {
// How can a string (including "" be less than 2 characters?)
@@ -1384,6 +1380,11 @@ public:
}
break;
}
+ default:
+ /* Safe default */
+ Clear(value);
+ Append(value, "?");
+ break;
}
if (!arg_values[argno]) {