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:
Marcelo Matus 2006-01-07 00:28:51 +00:00
commit 76c06cc3bb
3 changed files with 29 additions and 8 deletions

View file

@ -33,11 +33,13 @@ int get_value(int *x, int i) {
class RayPacketData {
public:
enum {
Size = 32
};
Material const* hitMatl[Size];
enum {
Size = 32
};
const Material * chitMat[Size];
Material hitMat_val[Size];
Material *hitMat[Size];
};
}

View file

@ -73,3 +73,23 @@ int test_b(int a) {
#endif
%}
#ifdef __cplusplus
%inline
{
struct Material
{
};
enum {
Size = 32
};
const Material * chitMat[Size];
Material hitMat_val[Size];
Material *hitMat[Size];
}
#endif

View file

@ -129,7 +129,7 @@
}
%typemap(globalin) SWIGTYPE [ANY] {
if (inp) {
if ($input) {
size_t ii = 0;
for (; ii < (size_t)$dim0; ++ii) $1[ii] = $input[ii];
} else {
@ -144,8 +144,7 @@
%variable_fail(SWIG_TypeError, "$type", "$name");
} else if (inp) {
size_t ii = 0;
$basetype *dest = %static_cast($1, $basetype *);
for (; ii < (size_t)$dim0; ++ii) dest[ii] = inp[ii];
for (; ii < (size_t)$dim0; ++ii) $1[ii] = inp[ii];
} else {
%variable_nullref("$type", "$name");
}