kernel: Update to use atmosphere macros and correct Result (#7242)

* kernel: Switch to atmosphere style macros

* code: Rename ResultCode to Result

* code: Result constants are lower case

* Address review comments

* core: Remove CASCADE_CODE

* R_TRY replaces completely

* core: Run clang format
This commit is contained in:
GPUCode
2023-12-31 19:01:40 +02:00
committed by GitHub
parent 811303ea54
commit 5a7f615da1
132 changed files with 2807 additions and 2995 deletions

View File

@ -9,12 +9,12 @@
namespace HLE::Applets {
ResultCode Mint::ReceiveParameterImpl(const Service::APT::MessageParameter& parameter) {
Result Mint::ReceiveParameterImpl(const Service::APT::MessageParameter& parameter) {
if (parameter.signal != Service::APT::SignalType::Request) {
LOG_ERROR(Service_APT, "unsupported signal {}", parameter.signal);
UNIMPLEMENTED();
// TODO(Subv): Find the right error code
return ResultCode(-1);
return ResultUnknown;
}
// The Request message contains a buffer with the size of the framebuffer shared
@ -40,10 +40,10 @@ ResultCode Mint::ReceiveParameterImpl(const Service::APT::MessageParameter& para
.object = framebuffer_memory,
});
return RESULT_SUCCESS;
return ResultSuccess;
}
ResultCode Mint::Start(const Service::APT::MessageParameter& parameter) {
Result Mint::Start(const Service::APT::MessageParameter& parameter) {
startup_param = parameter.buffer;
// TODO(Subv): Set the expected fields in the response buffer before resending it to the
@ -52,14 +52,14 @@ ResultCode Mint::Start(const Service::APT::MessageParameter& parameter) {
// Let the application know that we're closing
Finalize();
return RESULT_SUCCESS;
return ResultSuccess;
}
ResultCode Mint::Finalize() {
Result Mint::Finalize() {
std::vector<u8> buffer(startup_param.size());
std::fill(buffer.begin(), buffer.end(), 0);
CloseApplet(nullptr, buffer);
return RESULT_SUCCESS;
return ResultSuccess;
}
void Mint::Update() {}