libstrat: enable -Wextra, -Werror
This caught an embarrassingly large number of bugs.
This commit is contained in:
@@ -107,7 +107,7 @@ namespace ams::htclow::ctrl {
|
||||
R_UNLESS(header.body_size == 0, htclow::ResultProtocolError());
|
||||
break;
|
||||
case HtcctrlPacketType_ReadyFromHost:
|
||||
R_UNLESS(0 <= header.body_size && header.body_size <= sizeof(HtcctrlPacketBody), htclow::ResultProtocolError());
|
||||
R_UNLESS(header.body_size <= sizeof(HtcctrlPacketBody), htclow::ResultProtocolError());
|
||||
break;
|
||||
default:
|
||||
return htclow::ResultProtocolError();
|
||||
|
||||
@@ -26,6 +26,8 @@ namespace ams::htclow::ctrl {
|
||||
}
|
||||
|
||||
bool JsonHandler::Key(const Ch *str, rapidjson::SizeType len, bool copy) {
|
||||
AMS_UNUSED(len, copy);
|
||||
|
||||
if (m_state == State::ParseObject) {
|
||||
if (!util::Strncmp(str, ChannelKey, sizeof(ChannelKey))) {
|
||||
m_state = State::ParseServiceChannels;
|
||||
@@ -45,6 +47,8 @@ namespace ams::htclow::ctrl {
|
||||
}
|
||||
|
||||
bool JsonHandler::String(const Ch *str, rapidjson::SizeType len, bool copy) {
|
||||
AMS_UNUSED(len, copy);
|
||||
|
||||
if (m_state == State::ParseServiceChannelsArray && *m_num_strings < m_max_strings) {
|
||||
m_strings[(*m_num_strings)++] = str;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ namespace ams::htclow::ctrl {
|
||||
constexpr auto JsonParseFlags = rapidjson::kParseTrailingCommasFlag | rapidjson::kParseInsituFlag;
|
||||
|
||||
void ParseBody(s16 *out_version, const char **out_channels, int *out_num_channels, int max_channels, void *str, size_t str_size) {
|
||||
AMS_UNUSED(str_size);
|
||||
|
||||
/* Create JSON handler. */
|
||||
JsonHandler json_handler(out_version, out_channels, out_num_channels, max_channels);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user