Commit fdb68281 authored by Alexandre Julliard's avatar Alexandre Julliard

winealsa: Fix some unsigned comparison < 0 warnings.

parent a5d28014
......@@ -607,7 +607,7 @@ static mixer* MIX_GetMix(UINT wDevID)
{
mixer *mmixer;
if (wDevID < 0 || wDevID >= cards)
if (wDevID >= cards)
{
WARN("Invalid mixer id: %d\n", wDevID);
return NULL;
......@@ -888,7 +888,7 @@ static DWORD MIX_GetControlDetails(UINT wDevID, LPMIXERCONTROLDETAILS mctrld, DW
if (!mmixer)
return MMSYSERR_BADDEVICEID;
if (line < 0 || line >= mmixer->chans || !mmixer->controls[ctrl].enabled)
if (line >= mmixer->chans || !mmixer->controls[ctrl].enabled)
return MIXERR_INVALCONTROL;
ct = &mmixer->controls[ctrl];
......@@ -1095,7 +1095,7 @@ static DWORD MIX_SetControlDetails(UINT wDevID, LPMIXERCONTROLDETAILS mctrld, DW
if (!mmixer)
return MMSYSERR_BADDEVICEID;
if (line < 0 || line >= mmixer->chans)
if (line >= mmixer->chans)
{
WARN("Invalid line id: %d not in range of 0-%d\n", line, mmixer->chans-1);
return MMSYSERR_INVALPARAM;
......@@ -1343,7 +1343,7 @@ static DWORD MIX_GetLineInfo(UINT wDevID, LPMIXERLINEW Ml, DWORD_PTR flags)
}
case MIXER_GETLINEINFOF_LINEID:
if (Ml->dwLineID < 0 || Ml->dwLineID >= mmixer->chans)
if (Ml->dwLineID >= mmixer->chans)
return MIXERR_INVALLINE;
TRACE("MIXER_GETLINEINFOF_LINEID %d\n", Ml->dwLineID);
......@@ -1363,7 +1363,7 @@ static DWORD MIX_GetLineInfo(UINT wDevID, LPMIXERLINEW Ml, DWORD_PTR flags)
break;
case MIXER_GETLINEINFOF_DESTINATION:
if (Ml->dwDestination < 0 || Ml->dwDestination >= mmixer->dests)
if (Ml->dwDestination >= mmixer->dests)
{
WARN("dest %d out of bounds\n", Ml->dwDestination);
return MIXERR_INVALLINE;
......@@ -1375,13 +1375,13 @@ static DWORD MIX_GetLineInfo(UINT wDevID, LPMIXERLINEW Ml, DWORD_PTR flags)
break;
case MIXER_GETLINEINFOF_SOURCE:
if (Ml->dwDestination < 0 || Ml->dwDestination >= mmixer->dests)
if (Ml->dwDestination >= mmixer->dests)
{
WARN("dest %d for source out of bounds\n", Ml->dwDestination);
return MIXERR_INVALLINE;
}
if (Ml->dwSource < 0 || Ml->dwSource >= getsrccntfromchan(mmixer, Ml->dwDestination))
if (Ml->dwSource >= getsrccntfromchan(mmixer, Ml->dwDestination))
{
WARN("src %d out of bounds\n", Ml->dwSource);
return MIXERR_INVALLINE;
......@@ -1455,7 +1455,7 @@ static DWORD MIX_GetLineControls(UINT wDevID, LPMIXERLINECONTROLSW mlc, DWORD_PT
if (flags == MIXER_GETLINECONTROLSF_ONEBYID)
mlc->dwLineID = mlc->u.dwControlID / CONTROLSPERLINE;
if (mlc->dwLineID < 0 || mlc->dwLineID >= mmixer->chans)
if (mlc->dwLineID >= mmixer->chans)
{
TRACE("Invalid dwLineID %d\n", mlc->dwLineID);
return MIXERR_INVALLINE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment