X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d9faa1fede04455b98de64001bcad46fa2061231..03d4f7b9924d9fa767411b8fccd3607ce962275d:/utils/ifacecheck/src/ifacecheck.cpp diff --git a/utils/ifacecheck/src/ifacecheck.cpp b/utils/ifacecheck/src/ifacecheck.cpp index d2c63869e6..a8ce9b2bc6 100644 --- a/utils/ifacecheck/src/ifacecheck.cpp +++ b/utils/ifacecheck/src/ifacecheck.cpp @@ -93,8 +93,8 @@ public: } protected: - wxXmlGccInterface m_api; // "real" headers API - wxXmlDoxygenInterface m_interface; // doxygen-commented headers API + wxXmlGccInterface m_gccInterface; // "real" headers API + wxXmlDoxygenInterface m_doxyInterface; // doxygen-commented headers API // was the MODIFY_SWITCH passed? bool m_modify; @@ -133,21 +133,21 @@ int IfaceCheckApp::OnRun() } // in any case set basic std preprocessor #defines: - m_interface.AddPreprocessorValue("NULL", "0"); + m_doxyInterface.AddPreprocessorValue("NULL", "0"); // parse the two XML files which contain the real and the doxygen interfaces // for wxWidgets API: - if (!m_api.Parse(parser.GetParam(0)) || - !m_interface.Parse(parser.GetParam(1))) + if (!m_gccInterface.Parse(parser.GetParam(0)) || + !m_doxyInterface.Parse(parser.GetParam(1))) return 1; if (parser.Found(DUMP_SWITCH)) { LogMessage("Dumping real API to '%s'...", API_DUMP_FILE); - m_api.Dump(API_DUMP_FILE); + m_gccInterface.Dump(API_DUMP_FILE); LogMessage("Dumping interface API to '%s'...", INTERFACE_DUMP_FILE); - m_interface.Dump(INTERFACE_DUMP_FILE); + m_doxyInterface.Dump(INTERFACE_DUMP_FILE); } else { @@ -195,7 +195,7 @@ void IfaceCheckApp::ShowProgress() bool IfaceCheckApp::Compare() { - const wxClassArray& interface = m_interface.GetClasses(); + const wxClassArray& interface = m_doxyInterface.GetClasses(); const wxClass* c; wxClassPtrArray api; int mcount = 0, ccount = 0; @@ -208,6 +208,18 @@ bool IfaceCheckApp::Compare() for (unsigned int i=0; i0) { @@ -242,9 +254,9 @@ bool IfaceCheckApp::Compare() } LogMessage("%d methods (%.1f%%) of the interface headers do not exist in the real headers", - mcount, (float)(100.0 * mcount/m_interface.GetMethodCount())); + mcount, (float)(100.0 * mcount/m_doxyInterface.GetMethodCount())); LogMessage("%d classes (%.1f%%) of the interface headers do not exist in the real headers", - ccount, (float)(100.0 * ccount/m_interface.GetClassesCount())); + ccount, (float)(100.0 * ccount/m_doxyInterface.GetClassesCount())); return true; } @@ -270,6 +282,18 @@ int IfaceCheckApp::CompareClasses(const wxClass* iface, const wxClassPtrArray& a const wxMethod& m = iface->GetMethod(i); int matches = 0; + // only compare the methods which are available for the port + // for which the gcc XML was produced + if (m.GetAvailability() != wxPORT_UNKNOWN && + (m.GetAvailability() & m_gccInterface.GetInterfacePort()) == 0) { + + if (g_verbose) + LogMessage("skipping method '%s' since it's not available for the %s port.", + m.GetAsString(), m_gccInterface.GetInterfacePortName()); + + continue; // skip this method + } + // search in the methods of the api classes provided for (unsigned int j=0; jGetMethodCount(); j++) @@ -529,7 +553,7 @@ bool IfaceCheckApp::ParsePreprocessorOutput(const wxString& filename) defval = defval.Mid(1, defval.Len()-2); // store this pair in the doxygen interface, where it can be useful - m_interface.AddPreprocessorValue(defname, defval); + m_doxyInterface.AddPreprocessorValue(defname, defval); useful++; } @@ -542,9 +566,9 @@ bool IfaceCheckApp::ParsePreprocessorOutput(const wxString& filename) void IfaceCheckApp::PrintStatistics(long secs) { LogMessage("wx real headers contains declaration of %d classes (%d methods)", - m_api.GetClassesCount(), m_api.GetMethodCount()); + m_gccInterface.GetClassesCount(), m_gccInterface.GetMethodCount()); LogMessage("wx interface headers contains declaration of %d classes (%d methods)", - m_interface.GetClassesCount(), m_interface.GetMethodCount()); + m_doxyInterface.GetClassesCount(), m_doxyInterface.GetMethodCount()); LogMessage("total processing took %d seconds.", secs); }