machine/smioc.cpp: Cleaned up parameter bounds checking that could cause a compiler diagnostic. [R. Belmont]

This commit is contained in:
arbee 2024-10-27 15:26:38 -04:00
parent c56e1f1f6b
commit 72955160b9

View file

@ -355,14 +355,8 @@ void smioc_device::SetDmaParameter(smioc_dma_parameter_t param, u16 value)
{
int address = DmaParameterAddress(param);
static char const *const paramNames[] = { "smiocdma_sendaddress", "smiocdma_sendlength", "smiocdma_recvaddress", "smiocdma_recvlength" };
const char* paramName = "?";
if (param >= 0 && param < (sizeof(paramNames) / sizeof(*paramNames)))
{
paramName = paramNames[param];
}
WriteRamParameter("SetDmaParameter", paramName, address, value);
static char const *const paramNames[4] = { "smiocdma_sendaddress", "smiocdma_sendlength", "smiocdma_recvaddress", "smiocdma_recvlength" };
WriteRamParameter("SetDmaParameter", paramNames[param & 3], address, value);
}
u16 smioc_device::ReadDmaParameter(smioc_dma_parameter_t param)