ams: support building unit test programs on windows/linux/macos

This commit is contained in:
Michael Scire
2022-03-06 12:08:20 -08:00
committed by SciresM
parent 9a38be201a
commit 64a97576d0
756 changed files with 33359 additions and 9372 deletions

View File

@@ -237,7 +237,7 @@ namespace ams::htclow::mux {
m_state_machine->SetConnecting(m_channel);
/* Allocate a task. */
u32 task_id;
u32 task_id{};
R_TRY(m_task_manager->AllocateTask(std::addressof(task_id), m_channel));
/* Configure the task. */
@@ -295,7 +295,7 @@ namespace ams::htclow::mux {
R_TRY(this->CheckState({ChannelState_Connected}));
/* Allocate a task. */
u32 task_id;
u32 task_id{};
R_TRY(m_task_manager->AllocateTask(std::addressof(task_id), m_channel));
/* Configure the task. */
@@ -316,7 +316,7 @@ namespace ams::htclow::mux {
R_TRY(this->CheckState({ChannelState_Connected, ChannelState_Disconnected}));
/* Allocate a task. */
u32 task_id;
u32 task_id{};
R_TRY(m_task_manager->AllocateTask(std::addressof(task_id), m_channel));
/* Configure the task. */
@@ -389,7 +389,7 @@ namespace ams::htclow::mux {
R_TRY(this->CheckState({ChannelState_Connected}));
/* Allocate a task. */
u32 task_id;
u32 task_id{};
R_TRY(m_task_manager->AllocateTask(std::addressof(task_id), m_channel));
/* Send the data. */

View File

@@ -93,7 +93,7 @@ namespace ams::htclow::mux {
/* Determine the sendable size. */
const auto offset = total_send_size - ring_buffer_data_size;
const auto sendable_size = m_flow_control_enabled ? std::min(share - offset, ring_buffer_data_size) : ring_buffer_data_size;
const auto sendable_size = m_flow_control_enabled ? std::min<size_t>(share - offset, ring_buffer_data_size) : ring_buffer_data_size;
if (sendable_size == 0) {
return false;
}

View File

@@ -20,7 +20,7 @@ namespace ams::htclow::mux {
os::EventType *TaskManager::GetTaskEvent(u32 task_id) {
/* Check pre-conditions. */
AMS_ASSERT(0 <= task_id && task_id < MaxTaskCount);
AMS_ASSERT(task_id < MaxTaskCount);
AMS_ASSERT(m_valid[task_id]);
return std::addressof(m_tasks[task_id].event);
@@ -28,7 +28,7 @@ namespace ams::htclow::mux {
EventTrigger TaskManager::GetTrigger(u32 task_id) {
/* Check pre-conditions. */
AMS_ASSERT(0 <= task_id && task_id < MaxTaskCount);
AMS_ASSERT(task_id < MaxTaskCount);
AMS_ASSERT(m_valid[task_id]);
return m_tasks[task_id].event_trigger;
@@ -61,7 +61,7 @@ namespace ams::htclow::mux {
void TaskManager::FreeTask(u32 task_id) {
/* Check pre-conditions. */
AMS_ASSERT(0 <= task_id && task_id < MaxTaskCount);
AMS_ASSERT(task_id < MaxTaskCount);
/* Invalidate the task. */
if (m_valid[task_id]) {
@@ -72,7 +72,7 @@ namespace ams::htclow::mux {
void TaskManager::ConfigureConnectTask(u32 task_id) {
/* Check pre-conditions. */
AMS_ASSERT(0 <= task_id && task_id < MaxTaskCount);
AMS_ASSERT(task_id < MaxTaskCount);
AMS_ASSERT(m_valid[task_id]);
/* Set the task type. */
@@ -81,7 +81,7 @@ namespace ams::htclow::mux {
void TaskManager::ConfigureFlushTask(u32 task_id) {
/* Check pre-conditions. */
AMS_ASSERT(0 <= task_id && task_id < MaxTaskCount);
AMS_ASSERT(task_id < MaxTaskCount);
AMS_ASSERT(m_valid[task_id]);
/* Set the task type. */
@@ -90,7 +90,7 @@ namespace ams::htclow::mux {
void TaskManager::ConfigureReceiveTask(u32 task_id, size_t size) {
/* Check pre-conditions. */
AMS_ASSERT(0 <= task_id && task_id < MaxTaskCount);
AMS_ASSERT(task_id < MaxTaskCount);
AMS_ASSERT(m_valid[task_id]);
/* Set the task type. */
@@ -102,7 +102,7 @@ namespace ams::htclow::mux {
void TaskManager::ConfigureSendTask(u32 task_id) {
/* Check pre-conditions. */
AMS_ASSERT(0 <= task_id && task_id < MaxTaskCount);
AMS_ASSERT(task_id < MaxTaskCount);
AMS_ASSERT(m_valid[task_id]);
/* Set the task type. */