Merge branch 'master' into gsoc2012-scilab

This commit is contained in:
Simon Marchetto 2014-03-11 10:24:09 +01:00
commit 013b9f9769
36 changed files with 285 additions and 303 deletions

View file

@ -467,9 +467,9 @@ void swig_pragma(char *lang, char *name, char *value) {
}
/* --------------------------------------------------------------------------
* use_naturalvar_mode()
* Language::use_naturalvar_mode()
* -------------------------------------------------------------------------- */
int use_naturalvar_mode(Node *n) {
int Language::use_naturalvar_mode(Node *n) const {
if (Getattr(n, "unnamed"))
return 0;
int nvar = naturalvar_mode || GetFlag(n, "feature:naturalvar");
@ -478,12 +478,16 @@ int use_naturalvar_mode(Node *n) {
SwigType *ty = Getattr(n, "type");
SwigType *fullty = SwigType_typedef_resolve_all(ty);
if (SwigType_isclass(fullty)) {
Node *m = Copy(n);
SwigType *tys = SwigType_strip_qualifiers(fullty);
Swig_features_get(Swig_cparse_features(), 0, tys, 0, m);
nvar = GetFlag(m, "feature:naturalvar");
if (!CPlusPlus) {
Replaceall(tys, "struct ", "");
Replaceall(tys, "union ", "");
Replaceall(tys, "class ", "");
}
Node *typenode = Swig_symbol_clookup(tys, 0);
if (typenode)
nvar = GetFlag(typenode, "feature:naturalvar");
Delete(tys);
Delete(m);
}
Delete(fullty);
}
@ -1441,6 +1445,7 @@ int Language::membervariableHandler(Node *n) {
tm = Swig_typemap_lookup("memberin", nin, target, 0);
Delete(nin);
}
int flags = Extend | SmartPointer | use_naturalvar_mode(n);
if (isNonVirtualProtectedAccess(n))
flags = flags | CWRAP_ALL_PROTECTED_ACCESS;
@ -2513,7 +2518,7 @@ int Language::classHandler(Node *n) {
Setattr(m, "parentNode", n);
/*
* There is a bug that needs fixing still...
* This area of code is creating methods which have not been overidden in a derived class (director methods that are protected in the base)
* This area of code is creating methods which have not been overridden in a derived class (director methods that are protected in the base)
* If the method is overloaded, then Swig_overload_dispatch() incorrectly generates a call to the base wrapper, _wrap_xxx method
* See director_protected_overloaded.i - Possibly sym:overname needs correcting here.
Printf(stdout, "new method: %s::%s(%s)\n", Getattr(parentNode(m), "name"), Getattr(m, "name"), ParmList_str_defaultargs(Getattr(m, "parms")));
@ -3091,7 +3096,7 @@ Node *Language::symbolLookup(String *s, const_String_or_char_ptr scope) {
* Tries to locate a class from a type definition
* ----------------------------------------------------------------------------- */
Node *Language::classLookup(const SwigType *s) {
Node *Language::classLookup(const SwigType *s) const {
Node *n = 0;
/* Look in hash of cached values */

View file

@ -2606,8 +2606,8 @@ done:
/* wrap complex arguments to zvals */
Printv(w->code, wrap_args, NIL);
Append(w->code, "call_user_function(EG(function_table), (zval**)&swig_self, &funcname,\n");
Printf(w->code, " %s, %d, args TSRMLS_CC);\n", Swig_cresult_name(), idx);
Append(w->code, "call_user_function(EG(function_table), (zval**)&swig_self, &funcname,");
Printf(w->code, " %s, %d, args TSRMLS_CC);\n", Swig_cresult_name(), idx);
if (tm) {
Printv(w->code, Str(tm), "\n", NIL);

View file

@ -3728,7 +3728,7 @@ public:
if (builtin)
builtin_pre_decl(n);
/* Overide the shadow file so we can capture its methods */
/* Override the shadow file so we can capture its methods */
f_shadow = NewString("");
// Set up type check for director class constructor

View file

@ -215,7 +215,7 @@ public:
virtual int addSymbol(const String *s, const Node *n, const_String_or_char_ptr scope = ""); /* Add symbol */
virtual void dumpSymbols();
virtual Node *symbolLookup(String *s, const_String_or_char_ptr scope = ""); /* Symbol lookup */
virtual Node *classLookup(const SwigType *s); /* Class lookup */
virtual Node *classLookup(const SwigType *s) const; /* Class lookup */
virtual Node *enumLookup(SwigType *s); /* Enum lookup */
virtual int abstractClassTest(Node *n); /* Is class really abstract? */
virtual int is_assignable(Node *n); /* Is variable assignable? */
@ -300,6 +300,9 @@ protected:
This does not include protected virtual methods as they are turned on with the dirprot option. */
bool isNonVirtualProtectedAccess(Node *n) const;
/* Identify if a wrapped global or member variable n should use the naturalvar feature */
int use_naturalvar_mode(Node *n) const;
/* Director subclass comparison test */
String *none_comparison;
@ -380,7 +383,6 @@ int is_protected(Node *n);
int is_member_director(Node *parentnode, Node *member);
int is_member_director(Node *member);
int is_non_virtual_protected_access(Node *n); /* Check if the non-virtual protected members are required (for directors) */
int use_naturalvar_mode(Node *n);
void Wrapper_virtual_elimination_mode_set(int);
void Wrapper_fast_dispatch_mode_set(int);