cosmetic code formatting changes
This commit is contained in:
parent
dd6af222f4
commit
993214872f
3 changed files with 47 additions and 46 deletions
|
|
@ -3607,18 +3607,18 @@ Hash *Language::getClassHash() const {
|
|||
// 4 methods below are used in C# && Java module "feature:interface" implementation
|
||||
//
|
||||
// Collect all not abstract methods from the bases marked as "interface"
|
||||
static void collect_interface_methods(Node* n, List* methods) {
|
||||
if (Hash* bases = Getattr(n, "interface:bases")){
|
||||
List* keys = Keys(bases);
|
||||
static void collect_interface_methods(Node *n, List *methods) {
|
||||
if (Hash *bases = Getattr(n, "interface:bases")){
|
||||
List *keys = Keys(bases);
|
||||
for (Iterator base = First(keys); base.item; base = Next(base)) {
|
||||
Node* cls = Getattr(bases, base.item);
|
||||
Node *cls = Getattr(bases, base.item);
|
||||
if (cls == n)
|
||||
continue;
|
||||
for (Node* child = firstChild(cls); child; child = nextSibling(child)) {
|
||||
for (Node *child = firstChild(cls); child; child = nextSibling(child)) {
|
||||
if (strcmp(Char(nodeType(child)), "cdecl") == 0) {
|
||||
if (GetFlag(child, "feature:ignore") || Getattr(child, "interface:owner"))
|
||||
continue; // skip methods propagated to bases
|
||||
Node* m = Copy(child);
|
||||
Node *m = Copy(child);
|
||||
set_nextSibling(m, NIL);
|
||||
set_previousSibling(m, NIL);
|
||||
Setattr(m, "interface:owner", cls);
|
||||
|
|
@ -3630,9 +3630,9 @@ static void collect_interface_methods(Node* n, List* methods) {
|
|||
}
|
||||
}
|
||||
|
||||
static void collect_interface_bases(Hash* bases, Node* n) {
|
||||
static void collect_interface_bases(Hash *bases, Node *n) {
|
||||
if (Getattr(n, "feature:interface")) {
|
||||
String* name = Getattr(n, "feature:interface:name");
|
||||
String *name = Getattr(n, "feature:interface:name");
|
||||
if (Getattr(bases, name))
|
||||
return;
|
||||
Setattr(bases, name, n);
|
||||
|
|
@ -3644,8 +3644,8 @@ static void collect_interface_bases(Hash* bases, Node* n) {
|
|||
}
|
||||
}
|
||||
|
||||
static void Swig_collect_interface_bases(Node* n) {
|
||||
Hash* interface_bases = NewHash();
|
||||
static void Swig_collect_interface_bases(Node *n) {
|
||||
Hash *interface_bases = NewHash();
|
||||
collect_interface_bases(interface_bases, n);
|
||||
if (Len(interface_bases) == 0)
|
||||
Delete(interface_bases);
|
||||
|
|
@ -3654,10 +3654,9 @@ static void Swig_collect_interface_bases(Node* n) {
|
|||
}
|
||||
|
||||
// Append all the interface methods not implemented in the current class, so that it would not be abstract
|
||||
void Swig_propagate_interface_methods(Node *n)
|
||||
{
|
||||
void Swig_propagate_interface_methods(Node *n) {
|
||||
Swig_collect_interface_bases(n);
|
||||
List* methods = NewList();
|
||||
List *methods = NewList();
|
||||
collect_interface_methods(n, methods);
|
||||
bool is_interface = Getattr(n, "feature:interface") != 0;
|
||||
for (Iterator mi = First(methods); mi.item; mi = Next(mi)) {
|
||||
|
|
@ -3668,7 +3667,7 @@ void Swig_propagate_interface_methods(Node *n)
|
|||
bool overloaded = false;
|
||||
if (SwigType_isfunction(resolved_decl)) {
|
||||
String *name = Getattr(mi.item, "name");
|
||||
for (Node* child = firstChild(n); child; child = nextSibling(child)) {
|
||||
for (Node *child = firstChild(n); child; child = nextSibling(child)) {
|
||||
if (Getattr(child, "interface:owner"))
|
||||
break; // at the end of the list are newly appended methods
|
||||
if (checkAttribute(child, "name", name)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue