From e2d1c0e72bc9954cc790716c5e1d91edeac15fae Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Sun, 9 Nov 2008 16:30:50 +0000 Subject: [PATCH] more intelligence to avoid false warnings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- utils/ifacecheck/src/ifacecheck.cpp | 3 ++- utils/ifacecheck/src/xmlparser.cpp | 23 +++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/utils/ifacecheck/src/ifacecheck.cpp b/utils/ifacecheck/src/ifacecheck.cpp index df06950..3abe835 100644 --- a/utils/ifacecheck/src/ifacecheck.cpp +++ b/utils/ifacecheck/src/ifacecheck.cpp @@ -75,8 +75,9 @@ class IfaceCheckLog : public wxLog public: IfaceCheckLog() {} - void DoLog(wxLogLevel level, const wxString& msg, time_t stamp) + void DoLog(wxLogLevel, const wxString& msg, time_t) { + // send all messages to stdout (normal behaviour is to sent them to stderr) wxPrintf(msg); wxPrintf("\n"); Flush(); diff --git a/utils/ifacecheck/src/xmlparser.cpp b/utils/ifacecheck/src/xmlparser.cpp index eb02ad5..04a5831 100644 --- a/utils/ifacecheck/src/xmlparser.cpp +++ b/utils/ifacecheck/src/xmlparser.cpp @@ -82,7 +82,7 @@ void wxType::SetTypeFromString(const wxString& t) m_strType.Replace(" ,", ","); // ADHOC-FIX - m_strType.Replace("_wxArraywxArrayStringBase", "const wxString&"); + m_strType.Replace("_wxArraywxArrayStringBase", "wxString"); m_strType = m_strType.Strip(wxString::both); @@ -104,12 +104,12 @@ void wxType::SetTypeFromString(const wxString& t) if (m_strTypeClean.EndsWith("Base")) m_strTypeClean = m_strTypeClean.Left(m_strTypeClean.Len()-4); + // remove the namespace from the types; there's no problem of conflicts + // (except for templates) and this avoids tons of false warnings + if (m_strTypeClean.Contains("::") && !m_strTypeClean.Contains("<")) + m_strTypeClean = m_strTypeClean.Mid(m_strTypeClean.Find("::")+2); + // ADHOC-FIX: - // doxygen likes to put wxDateTime:: in front of all wxDateTime enums; - // fix this to avoid false positives - m_strTypeClean.Replace("wxDateTime::", ""); - m_strTypeClean.Replace("wxStockGDI::", ""); // same story for some other classes - m_strTypeClean.Replace("wxHelpEvent::", ""); m_strTypeClean.Replace("wxWindowID", "int"); } @@ -174,6 +174,8 @@ void wxArgumentType::SetDefaultValue(const wxString& defval, const wxString& def p->Replace("0x000000001", "1"); p->Replace("\\000\\000\\000", ""); // fix for unicode strings: p->Replace("\\011", "\\t"); + p->Replace("e+0", ""); + p->Replace("2147483647", "__INT_MAX__"); // ADHOC-FIX: for wxConv* default values p->Replace("wxConvAuto(wxFONTENCODING_DEFAULT)", "wxConvAuto()"); @@ -211,6 +213,10 @@ bool wxArgumentType::operator==(const wxArgumentType& m) const if ((const wxType&)(*this) != (const wxType&)m) return false; + // check if the default values match + // --------------------------------- + + // ADHOC-FIX: // default values for style attributes of wxWindow-derived classes in gccxml appear as raw // numbers; avoid false positives in this case! @@ -232,6 +238,11 @@ bool wxArgumentType::operator==(const wxArgumentType& m) const return true; } } + else if (m_strTypeClean == "float" || m_strTypeClean == "double") + // gccXML translates the default floating values in a hardly usable + // format; e.g. 25.2 => 2.51999999999999992894572642398998141288757324219e+1 + // we avoid check on these... + return true; if (m_strDefaultValueForCmp != m.m_strDefaultValueForCmp) { -- 2.7.4