Renamed Language::SetNoneComparison() to setSubclassInstanceCheck(),

because that name better reflects what the function's trying to accomplish
(test whether the object for which the constructor's being called is an
instance of the class, or an instance of one of its subclasses).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4722 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Logan Johnson 2003-04-28 22:35:52 +00:00
commit ddbdf26508
4 changed files with 7 additions and 8 deletions

View file

@ -1762,8 +1762,7 @@ Language::constructorHandler(Node *n) {
mrename = Swig_name_construct(symname); mrename = Swig_name_construct(symname);
if (CPlusPlus) patch_parms(parms); if (CPlusPlus) patch_parms(parms);
Swig_ConstructorToFunction(n,ClassType,none_comparison, Swig_ConstructorToFunction(n, ClassType, none_comparison, CPlusPlus, Getattr(n, "template") ? 0 :Extend);
CPlusPlus,Getattr(n,"template") ? 0 :Extend);
Setattr(n,"sym:name", mrename); Setattr(n,"sym:name", mrename);
functionWrapper(n); functionWrapper(n);
Delete(mrename); Delete(mrename);
@ -2155,6 +2154,6 @@ String * Language::getClassType() const {
return ClassType; return ClassType;
} }
void Language::SetNoneComparison( String *nc ) { void Language::setSubclassInstanceCheck(String *nc) {
none_comparison = nc; none_comparison = nc;
} }

View file

@ -375,7 +375,7 @@ public:
virtual int top(Node *n) { virtual int top(Node *n) {
/* Set comparison with none for ConstructorToFunction */ /* Set comparison with none for ConstructorToFunction */
SetNoneComparison( NewString( "argv[0] != Val_unit" ) ); setSubclassInstanceCheck(NewString("argv[0] != Val_unit"));
/* check if directors are enabled for this module. note: this /* check if directors are enabled for this module. note: this
* is a "master" switch, without which no director code will be * is a "master" switch, without which no director code will be

View file

@ -396,7 +396,7 @@ public:
} }
/* Set comparison with none for ConstructorToFunction */ /* Set comparison with none for ConstructorToFunction */
SetNoneComparison( NewString( "$arg != Py_None" ) ); setSubclassInstanceCheck(NewString("$arg != Py_None"));
/* Initialize all of the output files */ /* Initialize all of the output files */
String *outfile = Getattr(n,"outfile"); String *outfile = Getattr(n,"outfile");
@ -747,7 +747,7 @@ public:
/* Keyword argument handling */ /* Keyword argument handling */
if (Len(pn)) { if (Len(pn)) {
Printf(kwargs,"\"%s\",", pn); Printf(kwargs,"(char *) \"%s\",", pn);
} else { } else {
Printf(kwargs,"\"arg%d\",", i+1); Printf(kwargs,"\"arg%d\",", i+1);
} }
@ -1935,7 +1935,7 @@ public:
int use_director = Swig_directorclass(n); int use_director = Swig_directorclass(n);
/* /*
* If we wrapping the constructor of a C++ director class, prepend a new parameter * If we're wrapping the constructor of a C++ director class, prepend a new parameter
* to receive the scripting language object (e.g. 'self') * to receive the scripting language object (e.g. 'self')
* *
*/ */

View file

@ -208,7 +208,7 @@ public:
int directorsEnabled() const; int directorsEnabled() const;
/* Set none comparison string */ /* Set none comparison string */
void SetNoneComparison( String *s ); void setSubclassInstanceCheck(String *s);
protected: protected:
/* Patch C++ pass-by-value */ /* Patch C++ pass-by-value */