[PHP] Add casts to the typemaps for long long and unsigned long

long to avoid issues when they are used with shorter types via
%apply.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12520 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2011-03-07 04:06:54 +00:00
commit 4fbb9e24d6
3 changed files with 15 additions and 10 deletions

View file

@ -201,7 +201,7 @@
return_value->type = IS_LONG;
} else {
char temp[256];
sprintf(temp, "%lld", $1);
sprintf(temp, "%lld", (long long)$1);
ZVAL_STRING(return_value, temp, 1);
}
%}
@ -212,7 +212,7 @@
return_value->type = IS_LONG;
} else {
char temp[256];
sprintf(temp, "%llu", $1);
sprintf(temp, "%llu", (unsigned long long)$1);
ZVAL_STRING(return_value, temp, 1);
}
%}
@ -239,7 +239,7 @@
return_value->type = IS_LONG;
} else {
char temp[256];
sprintf(temp, "%lld", *$1);
sprintf(temp, "%lld", (long long)(*$1));
ZVAL_STRING(return_value, temp, 1);
}
%}
@ -250,7 +250,7 @@
return_value->type = IS_LONG;
} else {
char temp[256];
sprintf(temp, "%llu", *$1);
sprintf(temp, "%llu", (unsigned long long)(*$1));
ZVAL_STRING(return_value, temp, 1);
}
%}