Fixes to default typemap handling of arrays.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4833 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2003-05-29 18:28:46 +00:00
commit fcc42fa5a6

View file

@ -577,20 +577,26 @@ Swig_typemap_search(const String_or_char *op, SwigType *type, String_or_char *na
} }
/* Hmmm. Well, no match seems to be found at all. See if there is some kind of default mapping */ /* Hmmm. Well, no match seems to be found at all. See if there is some kind of default mapping */
if (!primitive) {
primitive = SwigType_default(type); primitive = SwigType_default(type);
} while (primitive) {
tm = Getattr(typemaps[ts],primitive); tm = Getattr(typemaps[ts],primitive);
if (tm && cname) { if (tm && cname) {
tm1 = Getattr(tm,cname); tm1 = Getattr(tm,cname);
if (tm1) { if (tm1) {
result = Getattr(tm1,tmop); /* See if there is a type-name match */ result = Getattr(tm1,tmop); /* See if there is a type-name match */
if (result) goto ret_result;
}
}
if (tm) { /* See if there is simply a type match */
result = Getattr(tm,tmop);
if (result) goto ret_result; if (result) goto ret_result;
} }
} {
if (tm) { /* See if there is simply a type match */ SwigType *nprim = SwigType_default(primitive);
result = Getattr(tm,tmop); Delete(primitive);
if (result) goto ret_result; primitive = nprim;
}
} }
if (ctype != type) { Delete(ctype); ctype = 0; } if (ctype != type) { Delete(ctype); ctype = 0; }
ts--; /* Hmmm. Nothing found in this scope. Guess we'll go try another scope */ ts--; /* Hmmm. Nothing found in this scope. Guess we'll go try another scope */