warning/error fixes for Visual Studio
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7543 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3ee6a93127
commit
219517adc0
6 changed files with 33 additions and 8 deletions
|
|
@ -571,6 +571,7 @@ $1 = &temp; %}
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(throws) SWIGTYPE {
|
%typemap(throws) SWIGTYPE {
|
||||||
|
(void)$1;
|
||||||
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown");
|
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown");
|
||||||
RETURN $null;
|
RETURN $null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -167,6 +167,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(throws) SWIGTYPE {
|
%typemap(throws) SWIGTYPE {
|
||||||
|
(void)$1;
|
||||||
SWIG_exception(0,"Thrown exception from C++ (unknown)");
|
SWIG_exception(0,"Thrown exception from C++ (unknown)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,12 @@
|
||||||
|
|
||||||
/* Typemaps for input parameters */
|
/* Typemaps for input parameters */
|
||||||
|
|
||||||
%typemap(in) int, short, long, signed char, bool, enum SWIGTYPE
|
%typemap(in) int, short, long, signed char, enum SWIGTYPE
|
||||||
"$1 = ($1_ltype) SvIV($input);";
|
"$1 = ($1_ltype) SvIV($input);";
|
||||||
|
|
||||||
|
%typemap(in) bool
|
||||||
|
"$1 = SvIV($input) ? true : false;";
|
||||||
|
|
||||||
%typemap(in) unsigned int, unsigned short, unsigned long, unsigned char
|
%typemap(in) unsigned int, unsigned short, unsigned long, unsigned char
|
||||||
"$1 = ($1_ltype) SvUV($input);";
|
"$1 = ($1_ltype) SvUV($input);";
|
||||||
|
|
||||||
|
|
@ -68,11 +71,14 @@
|
||||||
const short & (short temp),
|
const short & (short temp),
|
||||||
const long & (long temp),
|
const long & (long temp),
|
||||||
const signed char & (signed char temp),
|
const signed char & (signed char temp),
|
||||||
const bool & (bool temp),
|
|
||||||
const enum SWIGTYPE & ($*1_ltype temp)
|
const enum SWIGTYPE & ($*1_ltype temp)
|
||||||
"temp = ($*1_ltype) SvIV($input);
|
"temp = ($*1_ltype) SvIV($input);
|
||||||
$1 = &temp;";
|
$1 = &temp;";
|
||||||
|
|
||||||
|
%typemap(in) const bool & (bool temp)
|
||||||
|
"temp = SvIV($input) ? true : false;
|
||||||
|
$1 = &temp;";
|
||||||
|
|
||||||
%typemap(in) const unsigned int & (unsigned int temp),
|
%typemap(in) const unsigned int & (unsigned int temp),
|
||||||
const unsigned short & (unsigned short temp),
|
const unsigned short & (unsigned short temp),
|
||||||
const unsigned long & (unsigned long temp),
|
const unsigned long & (unsigned long temp),
|
||||||
|
|
@ -227,9 +233,12 @@
|
||||||
|
|
||||||
/* Variable input */
|
/* Variable input */
|
||||||
|
|
||||||
%typemap(varin) int, short, long, signed char, bool
|
%typemap(varin) int, short, long, signed char
|
||||||
"$1 = ($1_ltype) SvIV($input);";
|
"$1 = ($1_ltype) SvIV($input);";
|
||||||
|
|
||||||
|
%typemap(varin) bool
|
||||||
|
"$1 = SvIV($input) ? true : false;";
|
||||||
|
|
||||||
%typemap(varin) unsigned int, unsigned short, unsigned long, unsigned char
|
%typemap(varin) unsigned int, unsigned short, unsigned long, unsigned char
|
||||||
"$1 = ($1_ltype) SvUV($input);";
|
"$1 = ($1_ltype) SvUV($input);";
|
||||||
|
|
||||||
|
|
@ -305,11 +314,14 @@
|
||||||
const short & (short temp),
|
const short & (short temp),
|
||||||
const long & (long temp),
|
const long & (long temp),
|
||||||
const signed char & (signed char temp),
|
const signed char & (signed char temp),
|
||||||
const bool & (bool temp),
|
|
||||||
const enum SWIGTYPE & ($*1_ltype temp)
|
const enum SWIGTYPE & ($*1_ltype temp)
|
||||||
"temp = ($*1_ltype) SvIV($input);
|
"temp = ($*1_ltype) SvIV($input);
|
||||||
$1 = &temp;";
|
$1 = &temp;";
|
||||||
|
|
||||||
|
%typemap(varin) const bool & (bool temp)
|
||||||
|
"temp = SvIV($input) ? true : false;
|
||||||
|
$1 = &temp;";
|
||||||
|
|
||||||
%typemap(varin) const unsigned int & (unsigned int temp),
|
%typemap(varin) const unsigned int & (unsigned int temp),
|
||||||
const unsigned short & (unsigned short temp),
|
const unsigned short & (unsigned short temp),
|
||||||
const unsigned long & (unsigned long temp),
|
const unsigned long & (unsigned long temp),
|
||||||
|
|
@ -555,10 +567,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [ANY] %{
|
%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [ANY] %{
|
||||||
|
(void)$1;
|
||||||
SWIG_croak("C++ $1_type exception thrown");
|
SWIG_croak("C++ $1_type exception thrown");
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%typemap(throws) enum SWIGTYPE %{
|
%typemap(throws) enum SWIGTYPE %{
|
||||||
|
(void)$1;
|
||||||
SWIG_croak("C++ $1_type exception thrown");
|
SWIG_croak("C++ $1_type exception thrown");
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,6 @@ namespace std {
|
||||||
"Expected an array of " #T);
|
"Expected an array of " #T);
|
||||||
SV **tv;
|
SV **tv;
|
||||||
I32 len = av_len(av) + 1;
|
I32 len = av_len(av) + 1;
|
||||||
T* obj;
|
|
||||||
for (int i=0; i<len; i++) {
|
for (int i=0; i<len; i++) {
|
||||||
tv = av_fetch(av, i, 0);
|
tv = av_fetch(av, i, 0);
|
||||||
if (CHECK_T(*tv)) {
|
if (CHECK_T(*tv)) {
|
||||||
|
|
@ -284,9 +283,9 @@ namespace std {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%typemap(out) vector<T> {
|
%typemap(out) vector<T> {
|
||||||
int len = $1.size();
|
size_t len = $1.size();
|
||||||
SV **svs = new SV*[len];
|
SV **svs = new SV*[len];
|
||||||
for (unsigned int i=0; i<len; i++) {
|
for (size_t i=0; i<len; i++) {
|
||||||
svs[i] = sv_newmortal();
|
svs[i] = sv_newmortal();
|
||||||
FROM_T(svs[i], $1[i]);
|
FROM_T(svs[i], $1[i]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,13 @@ INPUT_TYPEMAP(unsigned int, SvUV);
|
||||||
INPUT_TYPEMAP(unsigned long, SvUV);
|
INPUT_TYPEMAP(unsigned long, SvUV);
|
||||||
INPUT_TYPEMAP(unsigned short, SvUV);
|
INPUT_TYPEMAP(unsigned short, SvUV);
|
||||||
INPUT_TYPEMAP(unsigned char, SvUV);
|
INPUT_TYPEMAP(unsigned char, SvUV);
|
||||||
INPUT_TYPEMAP(bool, SvIV);
|
|
||||||
|
|
||||||
|
%typemap(in) bool *INPUT(bool temp), bool &INPUT(bool temp) {
|
||||||
|
temp = SvIV($input) ? true : false;
|
||||||
|
$1 = &temp;
|
||||||
|
}
|
||||||
|
%typemap(typecheck) bool *INPUT = bool;
|
||||||
|
%typemap(typecheck) bool &INPUT = bool;
|
||||||
|
|
||||||
%typemap(in) long long *INPUT($*1_ltype temp), long long &INPUT($*1_ltype temp) {
|
%typemap(in) long long *INPUT($*1_ltype temp), long long &INPUT($*1_ltype temp) {
|
||||||
temp = strtoll(SvPV($input,PL_na), 0, 0);
|
temp = strtoll(SvPV($input,PL_na), 0, 0);
|
||||||
|
|
|
||||||
|
|
@ -1916,6 +1916,11 @@ SwigType_emit_type_table(File *f_forward, File *f_table) {
|
||||||
Printf(table, " &_swigt_%s,\n", ki.item);
|
Printf(table, " &_swigt_%s,\n", ki.item);
|
||||||
Printf(cast_init, " _swigc_%s,\n", ki.item);
|
Printf(cast_init, " _swigc_%s,\n", ki.item);
|
||||||
}
|
}
|
||||||
|
if (i==0) {
|
||||||
|
/* empty arrays are not allowed by ISO C */
|
||||||
|
Printf(table, " NULL\n");
|
||||||
|
Printf(cast_init, " NULL\n");
|
||||||
|
}
|
||||||
|
|
||||||
Delete(table_list);
|
Delete(table_list);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue