more test cases, less cast operations
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8265 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a9cc475443
commit
76c06cc3bb
3 changed files with 29 additions and 8 deletions
|
|
@ -33,11 +33,13 @@ int get_value(int *x, int i) {
|
||||||
|
|
||||||
class RayPacketData {
|
class RayPacketData {
|
||||||
public:
|
public:
|
||||||
enum {
|
enum {
|
||||||
Size = 32
|
Size = 32
|
||||||
};
|
};
|
||||||
|
|
||||||
Material const* hitMatl[Size];
|
const Material * chitMat[Size];
|
||||||
|
Material hitMat_val[Size];
|
||||||
|
Material *hitMat[Size];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,3 +73,23 @@ int test_b(int a) {
|
||||||
#endif
|
#endif
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
%inline
|
||||||
|
{
|
||||||
|
|
||||||
|
struct Material
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
Size = 32
|
||||||
|
};
|
||||||
|
|
||||||
|
const Material * chitMat[Size];
|
||||||
|
Material hitMat_val[Size];
|
||||||
|
Material *hitMat[Size];
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(globalin) SWIGTYPE [ANY] {
|
%typemap(globalin) SWIGTYPE [ANY] {
|
||||||
if (inp) {
|
if ($input) {
|
||||||
size_t ii = 0;
|
size_t ii = 0;
|
||||||
for (; ii < (size_t)$dim0; ++ii) $1[ii] = $input[ii];
|
for (; ii < (size_t)$dim0; ++ii) $1[ii] = $input[ii];
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -144,8 +144,7 @@
|
||||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||||
} else if (inp) {
|
} else if (inp) {
|
||||||
size_t ii = 0;
|
size_t ii = 0;
|
||||||
$basetype *dest = %static_cast($1, $basetype *);
|
for (; ii < (size_t)$dim0; ++ii) $1[ii] = inp[ii];
|
||||||
for (; ii < (size_t)$dim0; ++ii) dest[ii] = inp[ii];
|
|
||||||
} else {
|
} else {
|
||||||
%variable_nullref("$type", "$name");
|
%variable_nullref("$type", "$name");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue