Merge pull request #4304 from B3n30/std_optional

Replace boost::optional with std::optional where possible
This commit is contained in:
Weiyi Wang
2018-10-11 12:40:00 -04:00
committed by GitHub
30 changed files with 115 additions and 109 deletions

View File

@@ -133,7 +133,7 @@ void HTTP_C::CreateContext(Kernel::HLERequestContext& ctx) {
}
// This command can only be called without a bound session.
if (session_data->current_http_context != boost::none) {
if (session_data->current_http_context) {
LOG_ERROR(Service_HTTP, "Command called with a bound context");
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
@@ -199,7 +199,7 @@ void HTTP_C::CloseContext(Kernel::HLERequestContext& ctx) {
return;
}
ASSERT_MSG(session_data->current_http_context == boost::none,
ASSERT_MSG(!session_data->current_http_context,
"Unimplemented CloseContext on context-bound session");
auto itr = contexts.find(context_handle);
@@ -250,7 +250,7 @@ void HTTP_C::AddRequestHeader(Kernel::HLERequestContext& ctx) {
}
// This command can only be called with a bound context
if (session_data->current_http_context == boost::none) {
if (!session_data->current_http_context) {
LOG_ERROR(Service_HTTP, "Command called without a bound context");
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
@@ -264,7 +264,7 @@ void HTTP_C::AddRequestHeader(Kernel::HLERequestContext& ctx) {
LOG_ERROR(Service_HTTP,
"Tried to add a request header on a mismatched session input context={} session "
"context={}",
context_handle, session_data->current_http_context.get());
context_handle, *session_data->current_http_context);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
rb.Push(ERROR_STATE_ERROR);
rb.PushMappedBuffer(value_buffer);
@@ -314,7 +314,7 @@ void HTTP_C::OpenClientCertContext(Kernel::HLERequestContext& ctx) {
if (!session_data->initialized) {
LOG_ERROR(Service_HTTP, "Command called without Initialize");
result = ERROR_STATE_ERROR;
} else if (session_data->current_http_context != boost::none) {
} else if (session_data->current_http_context) {
LOG_ERROR(Service_HTTP, "Command called with a bound context");
result = ERROR_NOT_IMPLEMENTED;
} else if (session_data->num_client_certs >= 2) {
@@ -353,7 +353,7 @@ void HTTP_C::OpenDefaultClientCertContext(Kernel::HLERequestContext& ctx) {
return;
}
if (session_data->current_http_context != boost::none) {
if (session_data->current_http_context) {
LOG_ERROR(Service_HTTP, "Command called with a bound context");
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(ERROR_NOT_IMPLEMENTED);