Fix so that all the const primitive reference types can be applied to other types

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7843 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-11-10 21:26:40 +00:00
commit 1986fcd8e0
2 changed files with 46 additions and 46 deletions

View file

@ -129,23 +129,23 @@
%typemap(out, null="") void "" %typemap(out, null="") void ""
/* primitive types by const reference */ /* primitive types by const reference */
%typemap(in) const bool & (bool temp) %typemap(in) const bool & ($*1_ltype temp)
%{ temp = $input ? true : false; %{ temp = $input ? true : false;
$1 = &temp; %} $1 = &temp; %}
%typemap(in) const char & (char temp), %typemap(in) const char & ($*1_ltype temp),
const signed char & (signed char temp), const signed char & ($*1_ltype temp),
const unsigned char & (unsigned char temp), const unsigned char & ($*1_ltype temp),
const short & (short temp), const short & ($*1_ltype temp),
const unsigned short & (unsigned short temp), const unsigned short & ($*1_ltype temp),
const int & (int temp), const int & ($*1_ltype temp),
const unsigned int & (unsigned int temp), const unsigned int & ($*1_ltype temp),
const long & (long temp), const long & ($*1_ltype temp),
const unsigned long & (unsigned long temp), const unsigned long & ($*1_ltype temp),
const long long & ($*1_ltype temp), const long long & ($*1_ltype temp),
const unsigned long long & ($*1_ltype temp), const unsigned long long & ($*1_ltype temp),
const float & (float temp), const float & ($*1_ltype temp),
const double & (double temp) const double & ($*1_ltype temp)
%{ temp = ($*1_ltype)$input; %{ temp = ($*1_ltype)$input;
$1 = &temp; %} $1 = &temp; %}

View file

@ -386,7 +386,7 @@
%typemap(directorin, descriptor="V") void "" %typemap(directorin, descriptor="V") void ""
/* primitive types by reference */ /* primitive types by reference */
%typemap(in) const bool & (bool temp) %typemap(in) const bool & ($*1_ltype temp)
%{ temp = $input ? true : false; %{ temp = $input ? true : false;
$1 = &temp; %} $1 = &temp; %}
@ -398,18 +398,18 @@
%typemap(javadirectorin) const bool & "$jniinput" %typemap(javadirectorin) const bool & "$jniinput"
%typemap(javadirectorout) const bool & "$javacall" %typemap(javadirectorout) const bool & "$javacall"
%typemap(in) const char & (char temp), %typemap(in) const char & ($*1_ltype temp),
const signed char & (signed char temp), const signed char & ($*1_ltype temp),
const unsigned char & (unsigned char temp), const unsigned char & ($*1_ltype temp),
const short & (short temp), const short & ($*1_ltype temp),
const unsigned short & (unsigned short temp), const unsigned short & ($*1_ltype temp),
const int & (int temp), const int & ($*1_ltype temp),
const unsigned int & (unsigned int temp), const unsigned int & ($*1_ltype temp),
const long & (long temp), const long & ($*1_ltype temp),
const unsigned long & (unsigned long temp), const unsigned long & ($*1_ltype temp),
const long long & ($*1_ltype temp), const long long & ($*1_ltype temp),
const float & (float temp), const float & ($*1_ltype temp),
const double & (double temp) const double & ($*1_ltype temp)
%{ temp = ($*1_ltype)$input; %{ temp = ($*1_ltype)$input;
$1 = &temp; %} $1 = &temp; %}
@ -443,32 +443,32 @@
%typemap(directorin, descriptor="F") const float & "$input = (jfloat)$1_name;" %typemap(directorin, descriptor="F") const float & "$input = (jfloat)$1_name;"
%typemap(directorin, descriptor="D") const double & "$input = (jdouble)$1_name;" %typemap(directorin, descriptor="D") const double & "$input = (jdouble)$1_name;"
%typemap(javadirectorin) const char & (char temp), %typemap(javadirectorin) const char & ($*1_ltype temp),
const signed char & (signed char temp), const signed char & ($*1_ltype temp),
const unsigned char & (unsigned char temp), const unsigned char & ($*1_ltype temp),
const short & (short temp), const short & ($*1_ltype temp),
const unsigned short & (unsigned short temp), const unsigned short & ($*1_ltype temp),
const int & (int temp), const int & ($*1_ltype temp),
const unsigned int & (unsigned int temp), const unsigned int & ($*1_ltype temp),
const long & (long temp), const long & ($*1_ltype temp),
const unsigned long & (unsigned long temp), const unsigned long & ($*1_ltype temp),
const long long & ($*1_ltype temp), const long long & ($*1_ltype temp),
const float & (float temp), const float & ($*1_ltype temp),
const double & (double temp) const double & ($*1_ltype temp)
"$jniinput" "$jniinput"
%typemap(javadirectorout) const char & (char temp), %typemap(javadirectorout) const char & ($*1_ltype temp),
const signed char & (signed char temp), const signed char & ($*1_ltype temp),
const unsigned char & (unsigned char temp), const unsigned char & ($*1_ltype temp),
const short & (short temp), const short & ($*1_ltype temp),
const unsigned short & (unsigned short temp), const unsigned short & ($*1_ltype temp),
const int & (int temp), const int & ($*1_ltype temp),
const unsigned int & (unsigned int temp), const unsigned int & ($*1_ltype temp),
const long & (long temp), const long & ($*1_ltype temp),
const unsigned long & (unsigned long temp), const unsigned long & ($*1_ltype temp),
const long long & ($*1_ltype temp), const long long & ($*1_ltype temp),
const float & (float temp), const float & ($*1_ltype temp),
const double & (double temp) const double & ($*1_ltype temp)
"$javacall" "$javacall"