From: Francesco Montorsi Date: Fri, 10 Oct 2008 22:51:26 +0000 (+0000) Subject: fix two bugs: 1) the missing NOT in the if (real) test; 2) the missing +1 in getID... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fce3374f3533ed5dda2f26f238649ef197337010?hp=7a0007346b74ff5b754bc0b2f86aa018e8d7b4a0 fix two bugs: 1) the missing NOT in the if (real) test; 2) the missing +1 in getID() function; add many checks and log messages git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/utils/ifacecheck/src/ifacecheck.cpp b/utils/ifacecheck/src/ifacecheck.cpp index efb72a14b1..5c6c6b4e63 100644 --- a/utils/ifacecheck/src/ifacecheck.cpp +++ b/utils/ifacecheck/src/ifacecheck.cpp @@ -301,7 +301,7 @@ int IfaceCheckApp::CompareClasses(const wxClass* iface, const wxClass* api) // search in the methods of the api classes provided real = api->RecursiveUpwardFindMethod(m, &m_gccInterface); - if (real) + if (!real) { bool exit = false; wxMethodPtrArray overloads = @@ -343,10 +343,11 @@ int IfaceCheckApp::CompareClasses(const wxClass* iface, const wxClass* api) warning += wxString::Format(": in the real headers there are %d overloads of '%s' for " "'%s' all with different signatures:\n", overloads.GetCount(), m.GetName(), api->GetName()); - else + else { warning += wxString::Format(": in the real headers there is a method '%s' for '%s'" " but has different signature:\n", m.GetName(), api->GetName()); + } // get a list of the prototypes with _all_ possible attributes: warning += "\tdoxy header: " + m.GetAsString(true, true, true, true); diff --git a/utils/ifacecheck/src/xmlparser.cpp b/utils/ifacecheck/src/xmlparser.cpp index 8ce5cf383a..cee6670ae5 100644 --- a/utils/ifacecheck/src/xmlparser.cpp +++ b/utils/ifacecheck/src/xmlparser.cpp @@ -1,4 +1,4 @@ -///////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////// // Name: xmlparser.cpp // Purpose: Parser of the API/interface XML files // Author: Francesco Montorsi @@ -121,7 +121,13 @@ bool wxType::operator==(const wxType& m) const return true; if (g_verbose) + { LogMessage("Type '%s' does not match type '%s'", m_strType, m.m_strType); + LogMessage(" => TypeClean %s / %s; IsConst %d / %d; IsStatic %d / %d; IsPointer %d / %d; IsReference %d / %d", + m_strTypeClean, m.m_strTypeClean, IsConst(), m.IsConst(), + IsStatic(), m.IsStatic(), IsPointer(), m.IsPointer(), + IsReference(), m.IsReference()); + } return false; } @@ -293,7 +299,11 @@ bool wxMethod::MatchesExceptForAttributes(const wxMethod& m) const { if (GetReturnType() != m.GetReturnType() || GetName() != m.GetName()) + { + if (g_verbose) + LogMessage("The method '%s' does not match method '%s'; different names/rettype", GetName(), m.GetName()); return false; + } if (m_args.GetCount()!=m.m_args.GetCount()) { if (g_verbose) @@ -319,7 +329,12 @@ bool wxMethod::operator==(const wxMethod& m) const IsPureVirtual() != m.IsPureVirtual() || IsDeprecated() != m.IsDeprecated() || GetAccessSpecifier() != m.GetAccessSpecifier()) + { + if (g_verbose) + LogMessage("The method '%s' does not match method '%s'; different attributes", GetName(), m.GetName()); + return false; + } // check everything else return MatchesExceptForAttributes(m); @@ -469,8 +484,10 @@ bool wxClass::CheckConsistency() const LogError("class %s has two methods with the same prototype: '%s'", m_strName, m_methods[i].GetAsString()); return false; - ((wxClass*)this)->m_methods.RemoveAt(j); - j--; + + // fix the problem? + //((wxClass*)this)->m_methods.RemoveAt(j); + //j--; } return true; @@ -661,7 +678,7 @@ typedef std::map wxToResolveTypeHashMap; // but is a little bit faster bool getID(unsigned long *id, const wxString& str) { - const wxStringCharType * const start = str.wx_str(); + const wxStringCharType * const start = str.wx_str()+1; wxStringCharType *end; #if wxUSE_UNICODE_WCHAR unsigned long val = wcstoul(start, &end, GCCXML_BASE);