Fixed William's weird typemap local variable replacement bug (I think).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4427 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6116a681bc
commit
2547941ebe
1 changed files with 11 additions and 2 deletions
|
|
@ -693,6 +693,15 @@ void replace_local_types(ParmList *p, String *name, String *rep) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
int check_locals(ParmList *p, const char *s) {
|
||||||
|
while (p) {
|
||||||
|
char *c = GetChar(p,"type");
|
||||||
|
if (strstr(c,s)) return 1;
|
||||||
|
p = nextSibling(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
void typemap_replace_vars(String *s, ParmList *locals, SwigType *type, String *pname, String *lname, int index)
|
void typemap_replace_vars(String *s, ParmList *locals, SwigType *type, String *pname, String *lname, int index)
|
||||||
{
|
{
|
||||||
|
|
@ -764,7 +773,7 @@ void typemap_replace_vars(String *s, ParmList *locals, SwigType *type, String *p
|
||||||
|
|
||||||
sc = Char(s);
|
sc = Char(s);
|
||||||
|
|
||||||
if (strstr(sc,"type")) {
|
if (strstr(sc,"type") || check_locals(locals,"type")) {
|
||||||
/* Given type : $type */
|
/* Given type : $type */
|
||||||
ts = SwigType_str(type,0);
|
ts = SwigType_str(type,0);
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
|
|
@ -777,7 +786,7 @@ void typemap_replace_vars(String *s, ParmList *locals, SwigType *type, String *p
|
||||||
Delete(ts);
|
Delete(ts);
|
||||||
sc = Char(s);
|
sc = Char(s);
|
||||||
}
|
}
|
||||||
if (strstr(sc,"ltype")) {
|
if (strstr(sc,"ltype") || check_locals(locals,"ltype")) {
|
||||||
/* Local type: $ltype */
|
/* Local type: $ltype */
|
||||||
ltype = SwigType_ltype(type);
|
ltype = SwigType_ltype(type);
|
||||||
ts = SwigType_str(ltype,0);
|
ts = SwigType_str(ltype,0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue