[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebindings/smoke
From: Arno Rehn <kde () arnorehn ! de>
Date: 2010-01-30 18:08:26
Message-ID: 1264874906.029502.27752.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1082517 by arnorehn:
Rewrite the findMethod(Smoke::ModuleIndex, Smoke::ModuleIndex) function.
The code is now much cleaner and works as expected. Fixes a bug reported
by Marcin Kulik. Thanks!
M +17 -18 smoke.h
--- trunk/KDE/kdebindings/smoke/smoke.h #1082516:1082517
@@ -482,26 +482,25 @@
}
inline ModuleIndex findMethod(ModuleIndex c, ModuleIndex name) {
- // Index is invalid
- if(!c.index || !name.index) return NullModuleIndex;
- // Is the method a direct member of the specified class?
- ModuleIndex mid = idMethod(c.index, name.index);
- if(mid.index) return mid;
- // No, it isn't... Search in the parent classes for it
- if(!classes[c.index].parents) return NullModuleIndex;
- for(int p = classes[c.index].parents; inheritanceList[p] ; p++) {
- Index ci = inheritanceList[p];
- const char* cName = className(ci);
- ClassMap::iterator i = classMap.find(cName);
- if (i == classMap.end()) {
+ if (!c.index || !name.index) {
return NullModuleIndex;
+ } else if (name.smoke == this && c.smoke == this) {
+ ModuleIndex mi = idMethod(c.index, name.index);
+ if (mi.index) return mi;
+ } else if (c.smoke != this) {
+ return c.smoke->findMethod(c, name);
}
- ModuleIndex cmi = i->second;
- ModuleIndex nmi = i->second.smoke->findMethodName(cName, name.smoke->methodNames[name.index]);
- ModuleIndex mi = i->second.smoke->findMethod(cmi, nmi);
- if (mi.index) return mi;
- }
- return NullModuleIndex;
+
+ for (Index *i = inheritanceList + classes[c.index].parents; *i; ++i) {
+ const char *cName = className(*i);
+ ModuleIndex ci = findClass(cName);
+ if (!ci.smoke)
+ return NullModuleIndex;
+ ModuleIndex ni = ci.smoke->findMethodName(cName, name.smoke->methodNames[name.index]);
+ ModuleIndex mi = ci.smoke->findMethod(ci, ni);
+ if (mi.index) return mi;
+ }
+ return NullModuleIndex;
}
inline ModuleIndex findMethod(const char *c, const char *name) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic