+
+ // ADHOC-FIX:
+ // default values for style attributes of wxWindow-derived classes in gccxml appear as raw
+ // numbers; avoid false positives in this case!
+ if (m_strArgName == m.m_strArgName && m_strArgName == "style" &&
+ (m_strDefaultValueForCmp.IsNumber() || m.m_strDefaultValueForCmp.IsNumber()))
+ return true;
+
+ // fix for default values which were replaced by gcc-xml with their numeric values
+ // (at this point we know that m_strTypeClean == m.m_strTypeClean):
+ if (m_strTypeClean == "long" || m_strTypeClean == "int")
+ {
+ if ((m_strDefaultValueForCmp.IsNumber() && m.m_strDefaultValueForCmp.StartsWith("wx")) ||
+ (m.m_strDefaultValueForCmp.IsNumber() && m_strDefaultValueForCmp.StartsWith("wx")))
+ {
+ if (g_verbose)
+ {
+ wxLogMessage("Supposing '%s' default value to be the same of '%s'...",
+ m_strDefaultValueForCmp, m.m_strDefaultValueForCmp);
+ }
+
+ 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)
+ {
+ // maybe the default values are numbers.
+ // in this case gccXML gives as default values things like '-0x0000001' instead of just '-1'.
+ // To handle these cases, we try to convert the default value strings to numbers:
+ long def1val, def2val;
+ if (m_strDefaultValueForCmp.ToLong(&def1val, 0 /* auto-detect */) &&
+ m.m_strDefaultValueForCmp.ToLong(&def2val, 0 /* auto-detect */))
+ {
+ if (def1val == def2val)
+ return true; // the default values match
+ }
+
+ if (g_verbose)
+ {
+ wxLogMessage("Argument type '%s = %s' has different default value from '%s = %s'",
+ m_strType, m_strDefaultValueForCmp, m.m_strType, m.m_strDefaultValueForCmp);
+ }