1
0
Fork 0

Merge pull request #4462 from FearlessTobi/fix-my-shit

ir_user: Remove ArrayToString() calls
This commit is contained in:
Weiyi Wang 2018-11-26 14:43:07 -05:00 committed by GitHub
commit 2678c1a945
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 17 deletions

View File

@ -165,10 +165,8 @@ void ExtraHID::OnDisconnect() {
void ExtraHID::HandleConfigureHIDPollingRequest(const std::vector<u8>& request) {
if (request.size() != 3) {
std::string request_string;
for (auto request_part : request)
request_string += fmt::format("{:02x} ", request_part);
LOG_ERROR(Service_IR, "Wrong request size ({}): {}", request.size(), request_string);
LOG_ERROR(Service_IR, "Wrong request size ({}): {}", request.size(),
fmt::format("{:02x}", fmt::join(request, " ")));
return;
}
@ -190,11 +188,8 @@ void ExtraHID::HandleReadCalibrationDataRequest(const std::vector<u8>& request_b
"ReadCalibrationDataRequest has wrong size");
if (request_buf.size() != sizeof(ReadCalibrationDataRequest)) {
std::string request_buf_string;
for (auto request_buf_part : request_buf)
request_buf_string += fmt::format("{:02x} ", request_buf_part);
LOG_ERROR(Service_IR, "Wrong request size ({}): {}", request_buf.size(),
request_buf_string);
fmt::format("{:02x}", fmt::join(request_buf, " ")));
return;
}
@ -228,10 +223,7 @@ void ExtraHID::OnReceive(const std::vector<u8>& data) {
HandleReadCalibrationDataRequest(data);
break;
default:
std::string data_string;
for (auto data_part : data)
data_string += fmt::format("{:02x} ", data_part);
LOG_ERROR(Service_IR, "Unknown request: {}", data_string);
LOG_ERROR(Service_IR, "Unknown request: {}", fmt::format("{:02x}", fmt::join(data, " ")));
break;
}
}

View File

@ -183,7 +183,7 @@ private:
/// Wraps the payload into packet and puts it to the receive buffer
void IR_USER::PutToReceive(const std::vector<u8>& payload) {
LOG_TRACE(Service_IR, "called, data={}", Common::ArrayToString(payload.data(), payload.size()));
LOG_TRACE(Service_IR, "called, data={}", fmt::format("{:02x}", fmt::join(payload, " ")));
std::size_t size = payload.size();
std::vector<u8> packet;
@ -361,7 +361,7 @@ void IR_USER::SendIrNop(Kernel::HLERequestContext& ctx) {
ErrorSummary::InvalidState, ErrorLevel::Status));
}
LOG_TRACE(Service_IR, "called, data={}", Common::ArrayToString(buffer.data(), size));
LOG_TRACE(Service_IR, "called, data={}", fmt::format("{:02x}", fmt::join(buffer, " ")));
}
void IR_USER::ReleaseReceivedData(Kernel::HLERequestContext& ctx) {

View File

@ -358,9 +358,7 @@ Movie::ValidationResult Movie::ValidateHeader(const CTMHeader& header, u64 progr
return ValidationResult::Invalid;
}
std::string revision;
for (auto header_part : header.revision)
revision += fmt::format("{:02x}", header_part);
std::string revision = fmt::format("{:02x}", fmt::join(header.revision, ""));
if (!program_id)
Core::System::GetInstance().GetAppLoader().ReadProgramId(program_id);