With the new astyle plugin,
the indentation of if(){} blocks is wrong,
when using K&R style (at least there i found it happen),
it's indented one size too much.
this sample, reference "K&R" style
void Notify() {
if(!m_frame->IsRunning()) {
m_gauge->SetValue(0);
}
else {
if(!m_bInit) {
if(m_thread->GetRSSLength()) {
m_bInit = true;
}
}
else {
m_gauge->SetValue(m_thread->GetRSSPos());
m_frame->SetStatusText(
wxString::Format(wxT("Converting Data... %i of %i"),
m_thread->GetRSSPos(),
m_thread->GetRSSLength()
)
);
}
}
}
astyled with "K&R"
void Notify() {
if ( !m_frame->IsRunning() ) {
m_gauge->SetValue( 0 );
}
else {
if ( !m_bInit ) {
if ( m_thread->GetRSSLength() ) {
m_bInit = true;
}
}
else {
m_gauge->SetValue( m_thread->GetRSSPos() );
m_frame->SetStatusText(
wxString::Format( wxT( "Converting Data... %i of %i" ),
m_thread->GetRSSPos(),
m_thread->GetRSSLength()
)
);
}
}
}
is indented one size too much !
btw, the K&R preview-sample misses a bracket '}'
namespace foospace {
int Foo() {
if (isBar) {
bar();
return 1;
} <<<<<<<<<<<<<<<<<<<<<missing
else
return 0;
}
}