Commit a0b3f355 authored by Max Kellermann's avatar Max Kellermann

oss: return bool instead of int

Return type of oss_find_supported_param(), oss_can_convert() and oss_find_unsupported_param() should be bool instead of int.
parent e1f58fdc
...@@ -92,33 +92,33 @@ oss_param_from_ioctl(unsigned param) ...@@ -92,33 +92,33 @@ oss_param_from_ioctl(unsigned param)
return idx; return idx;
} }
static int static bool
oss_find_supported_param(struct oss_data *od, unsigned param, int val) oss_find_supported_param(struct oss_data *od, unsigned param, int val)
{ {
enum oss_param idx = oss_param_from_ioctl(param); enum oss_param idx = oss_param_from_ioctl(param);
for (unsigned i = 0; i < od->num_supported[idx]; i++) for (unsigned i = 0; i < od->num_supported[idx]; i++)
if (od->supported[idx][i] == val) if (od->supported[idx][i] == val)
return 1; return true;
return 0; return false;
} }
static int static bool
oss_can_convert(int idx, int val) oss_can_convert(int idx, int val)
{ {
switch (idx) { switch (idx) {
case OSS_BITS: case OSS_BITS:
if (val != 16) if (val != 16)
return 0; return false;
break; break;
case OSS_CHANNELS: case OSS_CHANNELS:
if (val != 2) if (val != 2)
return 0; return false;
break; break;
} }
return 1; return true;
} }
static int static int
...@@ -145,17 +145,17 @@ oss_get_supported_param(struct oss_data *od, unsigned param, int val) ...@@ -145,17 +145,17 @@ oss_get_supported_param(struct oss_data *od, unsigned param, int val)
return ret; return ret;
} }
static int static bool
oss_find_unsupported_param(struct oss_data *od, unsigned param, int val) oss_find_unsupported_param(struct oss_data *od, unsigned param, int val)
{ {
enum oss_param idx = oss_param_from_ioctl(param); enum oss_param idx = oss_param_from_ioctl(param);
for (unsigned i = 0; i < od->num_unsupported[idx]; i++) { for (unsigned i = 0; i < od->num_unsupported[idx]; i++) {
if (od->unsupported[idx][i] == val) if (od->unsupported[idx][i] == val)
return 1; return true;
} }
return 0; return false;
} }
static void static void
......
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