Integrate new result macros. (#1780)

* result: try out some experimental shenanigans

* result: sketch out some more shenanigans

* result: see what it looks like to convert kernel to use result conds instead of guards

* make rest of kernel use experimental new macro-ing
This commit is contained in:
SciresM 2022-02-14 14:45:32 -08:00 committed by GitHub
parent 375ba615be
commit 96f95b9f95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 1355 additions and 1380 deletions

View file

@ -55,14 +55,14 @@ namespace ams::kern {
KScopedAutoObject existing_object = FindImpl(name);
if (existing_object.IsNull()) {
g_object_list.push_back(*new_name);
return ResultSuccess();
R_SUCCEED();
}
}
/* The object already exists, which is an error condition. Perform cleanup. */
obj->Close();
KObjectName::Free(new_name);
return svc::ResultInvalidState();
R_THROW(svc::ResultInvalidState());
}
Result KObjectName::Delete(KAutoObject *obj, const char *compare_name) {
@ -76,12 +76,12 @@ namespace ams::kern {
obj->Close();
g_object_list.erase(g_object_list.iterator_to(name));
KObjectName::Free(std::addressof(name));
return ResultSuccess();
R_SUCCEED();
}
}
/* We didn't find the object in the list. */
return svc::ResultNotFound();
R_THROW(svc::ResultNotFound());
}
KScopedAutoObject<KAutoObject> KObjectName::Find(const char *name) {