public:
IfaceCheckLog() {}
- void DoLog(wxLogLevel, const wxString& msg, time_t)
+ virtual void DoLogText(const wxString& msg)
{
// send all messages to stdout (normal behaviour is to sent them to stderr)
- wxPrintf(msg);
- wxPrintf("\n");
- Flush();
+ wxPuts(msg);
+ fflush(stdout);
}
};
// in any case set basic std preprocessor #defines:
m_doxyInterface.AddPreprocessorValue("NULL", "0");
- //g_bLogEnabled = false;
-
// parse the two XML files which contain the real and the doxygen interfaces
// for wxWidgets API:
if (!m_gccInterface.Parse(parser.GetParam(0)) ||
!m_doxyInterface.Parse(parser.GetParam(1)))
return 1;
-// g_bLogEnabled = true;
-
if (parser.Found(DUMP_SWITCH))
{
wxLogMessage("Dumping real API to '%s'...", API_DUMP_FILE);
interfaces.GetCount());
if (!m_strToMatch.IsEmpty())
+ {
wxLogMessage("Processing only header files matching '%s' expression.", m_strToMatch);
+ }
for (unsigned int i=0; i<interfaces.GetCount(); i++)
{
(interfaces[i].GetAvailability() & m_gccInterface.GetInterfacePort()) == 0) {
if (g_verbose)
+ {
wxLogMessage("skipping class '%s' since it's not available for the %s port.",
interfaces[i].GetName(), m_gccInterface.GetInterfacePortName());
+ }
continue; // skip this method
}
(m.GetAvailability() & m_gccInterface.GetInterfacePort()) == 0) {
if (g_verbose)
+ {
wxLogMessage("skipping method '%s' since it's not available for the %s port.",
m.GetAsString(), m_gccInterface.GetInterfacePortName());
+ }
continue; // skip this method
}
// modify interface header
if (FixMethod(iface->GetHeader(), &m, &tmp))
+ {
wxLogMessage("Adjusted attributes of '%s' method", m.GetAsString());
+ }
proceed = false;
break;
for (unsigned int j=0; j<overloads.GetCount(); j++)
warning += "\n\treal header: " + overloads[j]->GetAsString(true, true, true, true);
- wxLogWarning(warning);
+ wxLogWarning("%s", warning);
count++;
if (overloads.GetCount()>1)
// TODO: decide which of these overloads is the most "similar" to m
// and eventually modify it
if (m_modify)
+ {
wxLogWarning("\tmanual fix is required");
+ }
}
else
{
bool IfaceCheckApp::FixMethod(const wxString& header, const wxMethod* iface, const wxMethod* api)
{
+ unsigned int i,j;
wxASSERT(iface && api);
wxTextFile file;
}
// remove the old prototype
- for (int i=start; i<=end; i++)
+ for (int k=start; k<=end; k++)
file.RemoveLine(start); // remove (end-start)-nth times the start-th line
#define INDENTATION_STR wxString(" ")
const wxArgumentTypeArray& realargs = api->GetArgumentTypes();
if (realargs.GetCount() == doxygenargs.GetCount())
{
- for (unsigned int j=0; j<doxygenargs.GetCount(); j++)
+ for (j=0; j<doxygenargs.GetCount(); j++)
if (doxygenargs[j]==realargs[j])
{
realargs[j].SetArgumentName(doxygenargs[j].GetArgumentName());
wxASSERT(nStartColumn != wxNOT_FOUND);
// wrap lines too long at comma boundaries
- for (unsigned int i=0; i<toinsert.GetCount(); i++)
+ for (i=0; i<toinsert.GetCount(); i++)
{
size_t len = toinsert[i].Len();
if (len > WRAP_COLUMN)
}
// insert the new lines
- for (unsigned int i=0; i<toinsert.GetCount(); i++)
+ for (i=0; i<toinsert.GetCount(); i++)
file.InsertLine(toinsert[i], start+i);
// now save the modification
return false;
if (g_verbose)
+ {
wxLogMessage("\tthe final row offset for following methods is %d lines.", nOffset);
+ }
// update the other method's locations for those methods which belong to the modified header
// and are placed _below_ the modified method
wxClassPtrArray cToUpdate = m_doxyInterface.FindClassesDefinedIn(header);
- for (unsigned int i=0; i < cToUpdate.GetCount(); i++)
+ for (i=0; i < cToUpdate.GetCount(); i++)
{
- for (unsigned int j=0; j < cToUpdate[i]->GetMethodCount(); j++)
+ for (j=0; j < cToUpdate[i]->GetMethodCount(); j++)
{
wxMethod& m = cToUpdate[i]->GetMethod(j);
if (m.GetLocation() > iface->GetLocation())