Merge pull request #2952 from lioncash/warning

bcat: Silence various warnings
merge-requests/60/head
Rodrigo Locatti 2019-10-06 23:35:12 +07:00 committed by GitHub
commit dcdd887df3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 12 deletions

@ -10,13 +10,14 @@
namespace Service::BCAT { namespace Service::BCAT {
ProgressServiceBackend::ProgressServiceBackend(std::string event_name) : impl{} { ProgressServiceBackend::ProgressServiceBackend(std::string_view event_name) {
auto& kernel{Core::System::GetInstance().Kernel()}; auto& kernel{Core::System::GetInstance().Kernel()};
event = Kernel::WritableEvent::CreateEventPair( event = Kernel::WritableEvent::CreateEventPair(
kernel, Kernel::ResetType::Automatic, "ProgressServiceBackend:UpdateEvent:" + event_name); kernel, Kernel::ResetType::Automatic,
std::string("ProgressServiceBackend:UpdateEvent:").append(event_name));
} }
Kernel::SharedPtr<Kernel::ReadableEvent> ProgressServiceBackend::GetEvent() { Kernel::SharedPtr<Kernel::ReadableEvent> ProgressServiceBackend::GetEvent() const {
return event.readable; return event.readable;
} }
@ -95,7 +96,7 @@ Backend::Backend(DirectoryGetter getter) : dir_getter(std::move(getter)) {}
Backend::~Backend() = default; Backend::~Backend() = default;
NullBackend::NullBackend(const DirectoryGetter& getter) : Backend(std::move(getter)) {} NullBackend::NullBackend(DirectoryGetter getter) : Backend(std::move(getter)) {}
NullBackend::~NullBackend() = default; NullBackend::~NullBackend() = default;

@ -6,6 +6,9 @@
#include <functional> #include <functional>
#include <optional> #include <optional>
#include <string>
#include <string_view>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/file_sys/vfs_types.h" #include "core/file_sys/vfs_types.h"
#include "core/hle/kernel/readable_event.h" #include "core/hle/kernel/readable_event.h"
@ -85,14 +88,14 @@ public:
void FinishDownload(ResultCode result); void FinishDownload(ResultCode result);
private: private:
explicit ProgressServiceBackend(std::string event_name); explicit ProgressServiceBackend(std::string_view event_name);
Kernel::SharedPtr<Kernel::ReadableEvent> GetEvent(); Kernel::SharedPtr<Kernel::ReadableEvent> GetEvent() const;
DeliveryCacheProgressImpl& GetImpl(); DeliveryCacheProgressImpl& GetImpl();
void SignalUpdate() const; void SignalUpdate() const;
DeliveryCacheProgressImpl impl; DeliveryCacheProgressImpl impl{};
Kernel::EventPair event; Kernel::EventPair event;
bool need_hle_lock = false; bool need_hle_lock = false;
}; };
@ -128,7 +131,7 @@ protected:
// A backend of BCAT that provides no operation. // A backend of BCAT that provides no operation.
class NullBackend : public Backend { class NullBackend : public Backend {
public: public:
explicit NullBackend(const DirectoryGetter& getter); explicit NullBackend(DirectoryGetter getter);
~NullBackend() override; ~NullBackend() override;
bool Synchronize(TitleIDVersion title, ProgressServiceBackend& progress) override; bool Synchronize(TitleIDVersion title, ProgressServiceBackend& progress) override;

@ -495,7 +495,8 @@ Boxcat::StatusResult Boxcat::GetStatus(std::optional<std::string>& global,
} }
return StatusResult::Success; return StatusResult::Success;
} catch (const nlohmann::json::parse_error& e) { } catch (const nlohmann::json::parse_error& error) {
LOG_ERROR(Service_BCAT, "{}", error.what());
return StatusResult::ParseError; return StatusResult::ParseError;
} }
} }

@ -451,7 +451,7 @@ private:
IPC::ResponseBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(write_size * sizeof(DeliveryCacheDirectoryEntry)); rb.Push(static_cast<u32>(write_size * sizeof(DeliveryCacheDirectoryEntry)));
} }
void GetCount(Kernel::HLERequestContext& ctx) { void GetCount(Kernel::HLERequestContext& ctx) {
@ -468,7 +468,7 @@ private:
IPC::ResponseBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(files.size()); rb.Push(static_cast<u32>(files.size()));
} }
FileSys::VirtualDir root; FileSys::VirtualDir root;
@ -525,7 +525,7 @@ private:
IPC::ResponseBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push<u32>(size); rb.Push(static_cast<u32>(size));
} }
FileSys::VirtualDir root; FileSys::VirtualDir root;