fix errors reported by SUSE's post-build linter

In StartRFUSocket() in gba/GBALink.cpp move a postincrement out of an
expression to a following statement, because the evaluation order is
undefined.

In GetDevices() in wx/openal.cpp replace an #else with an #endif so that
the function has a default return statement visible to the linter.

In FilterThread::Entry() add a `return 0;` (ExitCode) statement at the
end even though it is probably never reached.

In the TransferToWindow() for the positive double validator widget in
wx/widgets/wxmisc.cpp add a default `return true;`, for the rare case
there is no double value, in which case the string representation would
be displayed (since it is a subclass of wxGenericValidator(wxString&) .)
This commit is contained in:
Avindra Goolcharan 2017-08-06 22:23:03 -04:00 committed by Rafael Kitover
parent d118c457b1
commit dd91abf72e
4 changed files with 7 additions and 3 deletions

View File

@ -1918,7 +1918,8 @@ static void StartRFUSocket(uint16_t value)
if (!ok) { if (!ok) {
rfu_curclient = rfu_numclients; rfu_curclient = rfu_numclients;
rfu_data.rfu_clientidx[(rfu_masterdata[0] - 0x61f1) >> 3] = rfu_numclients; rfu_data.rfu_clientidx[(rfu_masterdata[0] - 0x61f1) >> 3] = rfu_numclients;
rfu_clientlist[rfu_numclients] = rfu_masterdata[0] | (rfu_numclients++ << 16); rfu_clientlist[rfu_numclients] = rfu_masterdata[0] | (rfu_numclients << 16);
rfu_numclients++;
gbaid = (rfu_masterdata[0] - 0x61f1) >> 3; gbaid = (rfu_masterdata[0] - 0x61f1) >> 3;
rfu_data.rfu_signal[gbaid] = 0xffffffff >> ((3 - (rfu_numclients - 1)) << 3); rfu_data.rfu_signal[gbaid] = 0xffffffff >> ((3 - (rfu_numclients - 1)) << 3);
} }

View File

@ -356,10 +356,10 @@ bool OpenAL::GetDevices(wxArrayString& names, wxArrayString& ids)
devs += strlen(devs) + 1; devs += strlen(devs) + 1;
} }
#else #endif
// should work anyway, but must always use default driver // should work anyway, but must always use default driver
return true; return true;
#endif
} }
#endif #endif

View File

@ -1658,6 +1658,8 @@ public:
done->Post(); done->Post();
continue; continue;
} }
return 0;
} }
}; };

View File

@ -393,6 +393,7 @@ bool wxPositiveDoubleValidator::TransferToWindow()
str_val = wxString::Format(wxT("%.1f"), *double_val); str_val = wxString::Format(wxT("%.1f"), *double_val);
return wxGenericValidator::TransferToWindow(); return wxGenericValidator::TransferToWindow();
} }
return true;
} }
bool wxPositiveDoubleValidator::TransferFromWindow() bool wxPositiveDoubleValidator::TransferFromWindow()