Commit 8c33b648 authored by Max Kellermann's avatar Max Kellermann

mvp: unsinged integers

Fix some gcc warnings by using unsigned where appropriate. Declare numfrequencies as "const", and replaced the magic number 12 with a sizeof.
parent cec9264d
...@@ -66,7 +66,7 @@ typedef struct _MvpData { ...@@ -66,7 +66,7 @@ typedef struct _MvpData {
int fd; int fd;
} MvpData; } MvpData;
static int pcmfrequencies[][3] = { static unsigned pcmfrequencies[][3] = {
{9, 8000, 32000}, {9, 8000, 32000},
{10, 11025, 44100}, {10, 11025, 44100},
{11, 12000, 48000}, {11, 12000, 48000},
...@@ -81,7 +81,8 @@ static int pcmfrequencies[][3] = { ...@@ -81,7 +81,8 @@ static int pcmfrequencies[][3] = {
{15, 96000, 48000} {15, 96000, 48000}
}; };
static int numfrequencies = sizeof(pcmfrequencies) / 12; static const unsigned numfrequencies =
sizeof(pcmfrequencies) / sizeof(pcmfrequencies[0]);
static int mvp_testDefault(void) static int mvp_testDefault(void)
{ {
...@@ -120,8 +121,8 @@ static void mvp_finishDriver(void *data) ...@@ -120,8 +121,8 @@ static void mvp_finishDriver(void *data)
static int mvp_setPcmParams(MvpData * md, unsigned long rate, int channels, static int mvp_setPcmParams(MvpData * md, unsigned long rate, int channels,
int big_endian, unsigned bits) int big_endian, unsigned bits)
{ {
int iloop; unsigned iloop;
int mix[5]; unsigned mix[5];
if (channels == 1) if (channels == 1)
mix[0] = 1; mix[0] = 1;
......
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