Modify following features to work as flags, so that they can be truely set and unset:

new


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7564 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-09-30 22:10:17 +00:00
commit 656cb7ab06
15 changed files with 36 additions and 36 deletions

View file

@ -551,7 +551,7 @@ CHICKEN::functionWrapper(Node *n)
Replaceall(tm,"$source", "result");
Replaceall(tm,"$target", "resultobj");
Replaceall(tm,"$result", "resultobj");
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
Replaceall(tm,"$owner","1");
} else {
Replaceall(tm,"$owner","0");
@ -586,7 +586,7 @@ CHICKEN::functionWrapper(Node *n)
Printv(f->code,cleanup,NIL);
/* Look to see if there is any newfree cleanup code */
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) {
Replaceall(tm,"$source","result");
Printf(f->code,"%s\n",tm);

View file

@ -704,7 +704,7 @@ class CSHARP : public Language {
Printv(f->code,cleanup,NIL);
/* Look to see if there is any newfree cleanup code */
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) {
canThrow(n, "newfree", n);
Replaceall(tm,"$source","result"); /* deprecated */
@ -1663,7 +1663,7 @@ class CSHARP : public Language {
// Transform return type used in PInvoke function (in intermediary class) to type used in C# wrapper function (in proxy class)
if ((tm = Swig_typemap_lookup_new("csout",n,"",0))) {
if (Getattr(n,"feature:new"))
if (GetFlag(n,"feature:new"))
Replaceall(tm,"$owner","true");
else
Replaceall(tm,"$owner","false");
@ -1719,7 +1719,7 @@ class CSHARP : public Language {
} else {
// Getter method
if ((tm = Swig_typemap_lookup_new("csvarout",n,"",0))) {
if (Getattr(n,"feature:new"))
if (GetFlag(n,"feature:new"))
Replaceall(tm,"$owner","true");
else
Replaceall(tm,"$owner","false");
@ -2070,7 +2070,7 @@ class CSHARP : public Language {
// Transform return type used in PInvoke function (in intermediary class) to type used in C# wrapper function (in module class)
if ((tm = Swig_typemap_lookup_new("csout",n,"",0))) {
if (Getattr(n,"feature:new"))
if (GetFlag(n,"feature:new"))
Replaceall(tm,"$owner","true");
else
Replaceall(tm,"$owner","false");
@ -2125,7 +2125,7 @@ class CSHARP : public Language {
} else {
// Getter method
if ((tm = Swig_typemap_lookup_new("csvarout",n,"",0))) {
if (Getattr(n,"feature:new"))
if (GetFlag(n,"feature:new"))
Replaceall(tm,"$owner","true");
else
Replaceall(tm,"$owner","false");

View file

@ -947,7 +947,7 @@ public:
Replaceall(tm,"$result","gswig_result");
Replaceall(tm,"$target","gswig_result");
Replaceall(tm,"$source","result");
if (Getattr(n, "feature:new"))
if (GetFlag(n, "feature:new"))
Replaceall(tm, "$owner", "1");
else
Replaceall(tm, "$owner", "0");
@ -965,7 +965,7 @@ public:
// Look for any remaining cleanup
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) {
Replaceall(tm,"$source","result");
Printv(f->code,tm,"\n",NIL);

View file

@ -938,7 +938,7 @@ class JAVA : public Language {
Printv(f->code,cleanup,NIL);
/* Look to see if there is any newfree cleanup code */
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) {
addThrows(n, "tmap:newfree", n);
Replaceall(tm,"$source","result"); /* deprecated */
@ -1929,7 +1929,7 @@ class JAVA : public Language {
// Transform return type used in JNI function (in intermediary class) to type used in Java wrapper function (in proxy class)
if ((tm = Swig_typemap_lookup_new("javaout",n,"",0))) {
addThrows(n, "tmap:javaout", n);
if (Getattr(n,"feature:new"))
if (GetFlag(n,"feature:new"))
Replaceall(tm,"$owner","true");
else
Replaceall(tm,"$owner","false");
@ -2273,7 +2273,7 @@ class JAVA : public Language {
// Transform return type used in JNI function (in intermediary class) to type used in Java wrapper function (in module class)
if ((tm = Swig_typemap_lookup_new("javaout",n,"",0))) {
addThrows(n, "tmap:javaout", n);
if (Getattr(n,"feature:new"))
if (GetFlag(n,"feature:new"))
Replaceall(tm,"$owner","true");
else
Replaceall(tm,"$owner","false");

View file

@ -2008,7 +2008,7 @@ static Node *makeConstructor(Node *n)
}
String *lname = Swig_scopename_last(name);
Append(dname,lname);
Setattr(cn,"feature:new","1");
SetFlag(cn,"feature:new");
Setattr(cn,"decl","f().");
Swig_features_get(Swig_cparse_features(), 0, dname, Getattr(cn,"decl"), cn);
Delete(rname);

View file

@ -507,7 +507,7 @@ NEW LANGUAGE NOTE:END ************************************************/
// }
// else returnval++;
Replaceall(tm,"$source", "result");
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
Replaceall(tm,"$owner","1");
} else {
Replaceall(tm,"$owner","0");
@ -526,7 +526,7 @@ NEW LANGUAGE NOTE:END ************************************************/
Printv(f->code,cleanup,NIL);
/* Look to see if there is any newfree cleanup code */
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) {
Replaceall(tm,"$source","result");
Printf(f->code,"%s\n",tm);

View file

@ -1537,7 +1537,7 @@ MODULA3 ():
Printv (f->code, cleanup, NIL);
/* Look to see if there is any newfree cleanup code */
if (Getattr (n, "feature:new")) {
if (GetFlag (n, "feature:new")) {
String *tm = Swig_typemap_lookup_new ("newfree", n, "result", 0);
if (tm != NIL) {
addThrows (throws_hash, "newfree", n);
@ -2987,7 +2987,7 @@ MODULA3 ():
// Transform return type used in PInvoke function (in intermediary class) to type used in Modula 3 wrapper function (in proxy class)
if ((tm = getMappedTypeNew (n, "m3out", ""))) {
addThrows (throws_hash, "m3out", n);
if (Getattr (n, "feature:new"))
if (GetFlag (n, "feature:new"))
Replaceall (tm, "$owner", "true");
else
Replaceall (tm, "$owner", "false");
@ -3004,7 +3004,7 @@ MODULA3 ():
if (setter_flag) {
// Setter method
if ((tm = getMappedTypeNew (n, "m3varin", ""))) {
if (Getattr (n, "feature:new"))
if (GetFlag (n, "feature:new"))
Replaceall (tm, "$owner", "true");
else
Replaceall (tm, "$owner", "false");
@ -3015,7 +3015,7 @@ MODULA3 ():
} else {
// Getter method
if ((tm = getMappedTypeNew (n, "m3varout", ""))) {
if (Getattr (n, "feature:new"))
if (GetFlag (n, "feature:new"))
Replaceall (tm, "$owner", "true");
else
Replaceall (tm, "$owner", "false");
@ -3768,7 +3768,7 @@ MODULA3 ():
// Setter method
String *tm = getMappedTypeNew (n, "m3varin", "");
if (tm != NIL) {
if (Getattr (n, "feature:new")) {
if (GetFlag (n, "feature:new")) {
Replaceall (tm, "$owner", "true");
} else {
Replaceall (tm, "$owner", "false");
@ -3783,7 +3783,7 @@ MODULA3 ():
// Getter method
String *tm = getMappedTypeNew (n, "m3varout", "");
if (tm != NIL) {
if (Getattr (n, "feature:new"))
if (GetFlag (n, "feature:new"))
Replaceall (tm, "$owner", "true");
else
Replaceall (tm, "$owner", "false");

View file

@ -366,7 +366,7 @@ public:
Replaceall(tm,"$source","result");
Replaceall(tm,"$target","values[0]");
Replaceall(tm,"$result","values[0]");
if (Getattr(n, "feature:new"))
if (GetFlag(n, "feature:new"))
Replaceall(tm, "$owner", "1");
else
Replaceall(tm, "$owner", "0");
@ -383,7 +383,7 @@ public:
// Look for any remaining cleanup
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) {
Replaceall(tm,"$source","result");
Printv(f->code, tm, "\n",NIL);

View file

@ -472,7 +472,7 @@ public:
int i = 0;
int numargs;
int numreq;
int newobj = Getattr(n,"feature:new") ? 1 : 0;
int newobj = GetFlag(n,"feature:new");
String *nodeType = Getattr(n, "nodeType");
int constructor = !Cmp(nodeType, "constructor");
int destructor = (!Cmp(nodeType, "destructor"));
@ -734,7 +734,7 @@ public:
// Look for any remaining cleanup
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) {
Replaceall(tm,"$source","swig_result");
Printv(f->code, tm, "\n",NIL);

View file

@ -654,7 +654,7 @@ public:
} else {
Replaceall(tm, "$shadow", "0");
}
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
Replaceall(tm,"$owner","SWIG_OWNER");
} else {
Replaceall(tm,"$owner","0");
@ -673,7 +673,7 @@ public:
Printv(f->code,cleanup,NIL);
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) {
Replaceall(tm,"$source","result");
Printf(f->code,"%s\n",tm);

View file

@ -886,7 +886,7 @@ public:
SwigType *d = Getattr(n,"type");
ParmList *l = Getattr(n,"parms");
String *nodeType = Getattr(n, "nodeType");
int newobject = (Getattr(n,"feature:new"))?1:0;
int newobject = GetFlag(n,"feature:new");
Parm *p;
char source[256];

View file

@ -408,7 +408,7 @@ public:
Replaceall(tm,"$source", "result");
Replaceall(tm,"$target", "resultobj");
Replaceall(tm,"$result", "resultobj");
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
Replaceall(tm,"$owner","1");
} else {
Replaceall(tm,"$owner","0");
@ -431,7 +431,7 @@ public:
Printv(f->code,cleanup,NIL);
/* Look to see if there is any newfree cleanup code */
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) {
Replaceall(tm,"$source","result");
Printf(f->code,"%s\n",tm);

View file

@ -1445,7 +1445,7 @@ public:
Replaceall(tm,"$source", "result");
Replaceall(tm,"$target", "resultobj");
Replaceall(tm,"$result", "resultobj");
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
Replaceall(tm,"$owner","1");
} else {
Replaceall(tm,"$owner","0");
@ -1493,7 +1493,7 @@ public:
Printv(f->code,cleanup,NIL);
/* Look to see if there is any newfree cleanup code */
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) {
Replaceall(tm,"$source","result");
Printf(f->code,"%s\n",tm);

View file

@ -1233,7 +1233,7 @@ public:
Replaceall(tm,"$source","result");
Replaceall(tm,"$target","vresult");
if (Getattr(n, "feature:new"))
if (GetFlag(n, "feature:new"))
Replaceall(tm,"$owner", "1");
else
Replaceall(tm,"$owner", "0");
@ -1296,7 +1296,7 @@ public:
Printv(f->code,cleanup,NIL);
/* Look for any remaining cleanup. This processes the %new directive */
if (current != CONSTRUCTOR_ALLOCATE && Getattr(n, "feature:new")) {
if (current != CONSTRUCTOR_ALLOCATE && GetFlag(n, "feature:new")) {
tm = Swig_typemap_lookup_new("newfree",n,"result",0);
if (tm) {
Replaceall(tm,"$source","result");

View file

@ -438,7 +438,7 @@ public:
Replaceall(tm,"$source", "result");
Replaceall(tm,"$target", "Tcl_GetObjResult(interp)");
Replaceall(tm,"$result", "Tcl_GetObjResult(interp)");
if(Getattr(n,"feature:new")) {
if(GetFlag(n,"feature:new")) {
Replaceall(tm,"$owner","1");
} else {
Replaceall(tm,"$owner","0");
@ -456,7 +456,7 @@ public:
Printv(f->code,cleanup,NIL);
/* Look for any remaining cleanup */
if (Getattr(n,"feature:new")) {
if (GetFlag(n,"feature:new")) {
if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) {
Replaceall(tm,"$source","result");
Printf(f->code,"%s\n", tm);