Put braces around all calls to wxLogFunctions() inside an if statement.

This suppresses all the remaining g++ -Wparentheses warnings and uses consistent style everywhere.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-07-20 16:47:54 +00:00
parent c9cc9a2f3e
commit 43b2d5e7c3
79 changed files with 476 additions and 39 deletions

View File

@@ -117,7 +117,9 @@ bool TestExec(const wxVector<wxFileName>& programs, long timeout)
long pid = wxExecute(programs[i].GetFullPath(), wxEXEC_ASYNC, &dt->process);
if (pid == 0)
{
wxLogError("could not run the program '%s'", programs[i].GetFullPath());
}
else
{
wxLogMessage("started program '%s' (pid %d)...",

View File

@@ -53,10 +53,10 @@ rhhcClient::rhhcClient( bool *isconn_a )
wxConnectionBase *rhhcClient::OnMakeConnection()
{
return new rhhcConnection( isconn_2 );
return new rhhcConnection( isconn_2 );
}
rhhcConnection::rhhcConnection( bool *isconn_a )
rhhcConnection::rhhcConnection( bool *isconn_a )
: wxConnection()
{
isconn_3 = isconn_a;
@@ -89,8 +89,8 @@ IMPLEMENT_CLASS(wxRemoteHtmlHelpController, wxHelpControllerBase)
wxRemoteHtmlHelpController::wxRemoteHtmlHelpController(int style )
{
m_style = style;
m_connection = NULL;
m_style = style;
m_connection = NULL;
m_client = NULL;
m_pid = 0;
isconn_1 = false;
@@ -113,7 +113,7 @@ wxRemoteHtmlHelpController::wxRemoteHtmlHelpController(int style )
m_appname = wxT("./helpview");
m_service = wxT("/tmp/") + thename + wxString(wxT("_helpservice"));
#else
m_appname = wxT("./helpview");
m_appname = wxT("./helpview");
m_service = wxT("4242");
#endif
@@ -154,7 +154,7 @@ wxRemoteHtmlHelpController::~wxRemoteHtmlHelpController()
delete m_process;
m_process = NULL;
}
if( m_client )
if( m_client )
delete m_client; //should be automatic?
}
@@ -179,7 +179,7 @@ bool wxRemoteHtmlHelpController::DoConnection()
wxLogNull nolog;
//first try to connect assuming server is running
if( !isconn_1 )
if( !isconn_1 )
m_connection = (rhhcConnection *)m_client->MakeConnection(hostName, m_service, wxT("HELP") );
//if not, start server
@@ -201,20 +201,20 @@ bool wxRemoteHtmlHelpController::DoConnection()
}
while ( !isconn_1 )
{
{
//try every second for a while, then leave it to user
wxSleep(1);
if( nsleep > 4 ) {
if ( wxMessageBox( wxT("Failed to make connection to Help server.\nRetry?") ,
wxT("wxRemoteHtmlHelpController Error"),
wxICON_ERROR | wxYES_NO | wxCANCEL ) != wxYES )
{
{
// no server
return false;
}
}
nsleep++;
m_connection = (rhhcConnection *)m_client->MakeConnection(hostName, m_service, wxT("HELP") );
}
}
@@ -254,11 +254,11 @@ bool wxRemoteHtmlHelpController::Quit()
default:
wxFAIL_MSG( _T("unexpected return value") );
// fall through
case -1:
// cancelled
return false;
case wxSIGNONE:
case wxSIGHUP:
case wxSIGINT:
@@ -282,9 +282,13 @@ bool wxRemoteHtmlHelpController::Quit()
if ( sig == 0 )
{
if ( wxProcess::Exists(m_pid) )
{
wxLogStatus(_T("Process %ld is running."), m_pid);
}
else
{
wxLogStatus(_T("No process with pid = %ld."), m_pid);
}
}
else // not SIGNONE
{
@@ -303,7 +307,7 @@ bool wxRemoteHtmlHelpController::Quit()
_T("no such process"),
_T("unspecified error"),
};
// sig = 3, 6, 9 or 12 all kill server with no apparent problem
// but give error message on MSW - timout?
//
@@ -321,8 +325,8 @@ void wxRemoteHtmlHelpController::Display(const wxString& helpfile)
if( !isconn_1 ) {
if( !DoConnection() ) return;
}
if (!m_connection->Execute( helpfile, -1 ) )
if (!m_connection->Execute( helpfile, -1 ) )
wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed"));
}
@@ -335,8 +339,8 @@ void wxRemoteHtmlHelpController::Display(const int id)
wxString intstring;
intstring.Printf( "--intstring%d", id );
if (!m_connection->Execute( intstring, -1 ) )
if (!m_connection->Execute( intstring, -1 ) )
wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed"));
}
@@ -349,7 +353,9 @@ bool wxRemoteHtmlHelpController::AddBook(const wxString& book, bool show_wait_ms
if( isconn_1 ) {
if (!m_connection->Poke( wxT("--AddBook"), (char*)book.c_str() ) )
{
wxLogError(wxT("wxRemoteHtmlHelpController - AddBook Failed"));
}
return false;
}
@@ -370,7 +376,9 @@ void wxRemoteHtmlHelpController::DisplayIndex()
{
if( isconn_1 ) {
if (!m_connection->Poke( wxT("--DisplayIndex"), wxT("") ) )
{
wxLogError(wxT("wxRemoteHtmlHelpController - DisplayIndex Failed"));
}
}
}
bool wxRemoteHtmlHelpController::KeywordSearch(const wxString& keyword)
@@ -391,7 +399,9 @@ void wxRemoteHtmlHelpController::SetTitleFormat(const wxString& format)
if( isconn_1 ) {
if (!m_connection->Poke( wxT("--SetTitleFormat"), (char*)format.c_str() ) )
{
wxLogError(wxT("wxRemoteHtmlHelpController - SetTitleFormat Failed"));
}
}
}
@@ -399,7 +409,9 @@ void wxRemoteHtmlHelpController::SetTempDir(const wxString& path)
{
if( isconn_1 ) {
if (!m_connection->Poke( wxT("--SetTempDir"), (char*)path.c_str() ) )
{
wxLogError(wxT("wxRemoteHtmlHelpController - SetTempDir Failed"));
}
}
}

View File

@@ -214,7 +214,9 @@ bool IfaceCheckApp::Compare()
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++)
{
@@ -224,8 +226,10 @@ bool IfaceCheckApp::Compare()
(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
}
@@ -299,8 +303,10 @@ int IfaceCheckApp::CompareClasses(const wxClass* iface, const wxClass* api)
(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
}
@@ -355,7 +361,9 @@ int IfaceCheckApp::CompareClasses(const wxClass* iface, const wxClass* api)
// modify interface header
if (FixMethod(iface->GetHeader(), &m, &tmp))
{
wxLogMessage("Adjusted attributes of '%s' method", m.GetAsString());
}
proceed = false;
break;
@@ -397,7 +405,9 @@ int IfaceCheckApp::CompareClasses(const wxClass* iface, const wxClass* api)
// 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
{
@@ -574,7 +584,9 @@ bool IfaceCheckApp::FixMethod(const wxString& header, const wxMethod* iface, con
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

View File

@@ -234,8 +234,10 @@ bool wxArgumentType::operator==(const wxArgumentType& m) const
(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;
}
@@ -260,8 +262,10 @@ bool wxArgumentType::operator==(const wxArgumentType& m) const
}
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);
}
return false;
}
@@ -330,14 +334,18 @@ bool wxMethod::MatchesExceptForAttributes(const wxMethod& m) const
GetName() != m.GetName())
{
if (g_verbose)
{
wxLogMessage("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)
{
wxLogMessage("Method '%s' has %d arguments while '%s' has %d arguments",
m_strName, m_args.GetCount(), m_strName, m.m_args.GetCount());
}
return false;
}
@@ -372,7 +380,9 @@ bool wxMethod::operator==(const wxMethod& m) const
GetAccessSpecifier() != m.GetAccessSpecifier())
{
if (g_verbose)
{
wxLogMessage("The method '%s' does not match method '%s'; different attributes", GetName(), m.GetName());
}
return false;
}
@@ -1009,8 +1019,10 @@ bool wxXmlGccInterface::Parse(const wxString& filename)
// they're never used as return/argument types by wxWidgets methods
if (g_verbose)
{
wxLogWarning("Type node '%s' with ID '%s' does not have name attribute",
n, child->GetAttribute("id"));
}
types[id] = "TOFIX";
}
@@ -1028,8 +1040,10 @@ bool wxXmlGccInterface::Parse(const wxString& filename)
while (toResolveTypes.size()>0)
{
if (g_verbose)
{
wxLogMessage("%d types were collected; %d types need yet to be resolved...",
types.size(), toResolveTypes.size());
}
for (wxToResolveTypeHashMap::iterator i = toResolveTypes.begin();
i != toResolveTypes.end();)
@@ -1468,7 +1482,9 @@ bool wxXmlDoxygenInterface::ParseCompoundDefinition(const wxString& filename)
int nodes = 0;
if (g_verbose)
{
wxLogMessage("Parsing %s...", filename);
}
if (!doc.Load(filename)) {
wxLogError("can't load %s", filename);
@@ -1576,10 +1592,14 @@ bool wxXmlDoxygenInterface::ParseCompoundDefinition(const wxString& filename)
// add a new class
if (klass.IsOk())
{
m_classes.Add(klass);
}
else if (g_verbose)
{
wxLogWarning("discarding class '%s' with %d methods...",
klass.GetName(), klass.GetMethodCount());
}
}
child = child->GetNext();