Fix some incorrect testing of bit flags.

This commit is contained in:
Kees van Reeuwijk 2010-02-02 12:24:35 +00:00
parent 310876dcec
commit 2db33d5c8c
2 changed files with 7 additions and 7 deletions

View file

@ -172,8 +172,8 @@ PRIVATE int get_set_input(struct inout_ctrl *input, int flag, int channel) {
mixer_set(input_cmd, mask); mixer_set(input_cmd, mask);
} else { /* Get input */ } else { /* Get input */
if (shift > 0) { if (shift > 0) {
input->left = ((mask >> (shift+1)) & 1 == 1 ? ON : OFF); input->left = (((mask >> (shift+1)) & 1) == 1 ? ON : OFF);
input->right = ((mask >> shift) & 1 == 1 ? ON : OFF); input->right = (((mask >> shift) & 1) == 1 ? ON : OFF);
} else { } else {
input->left = ((mask & 1) == 1 ? ON : OFF); input->left = ((mask & 1) == 1 ? ON : OFF);
} }
@ -220,8 +220,8 @@ PRIVATE int get_set_output(struct inout_ctrl *output, int flag) {
mixer_set(MIXER_OUTPUT_CTRL, mask); mixer_set(MIXER_OUTPUT_CTRL, mask);
} else { /* Get input */ } else { /* Get input */
if (shift > 0) { if (shift > 0) {
output->left = ((mask >> (shift+1)) & 1 == 1 ? ON : OFF); output->left = (((mask >> (shift+1)) & 1) == 1 ? ON : OFF);
output->right = ((mask >> shift) & 1 == 1 ? ON : OFF); output->right = (((mask >> shift) & 1) == 1 ? ON : OFF);
} else { } else {
output->left = ((mask & 1) == 1 ? ON : OFF); output->left = ((mask & 1) == 1 ? ON : OFF);
} }

View file

@ -1482,7 +1482,7 @@ int vectored;
goto suspend; goto suspend;
} }
if (!rfd_status & RFDS_OK) if (!(rfd_status & RFDS_OK))
{ {
/* Not OK? What happened? */ /* Not OK? What happened? */
assert(0); assert(0);
@ -1662,7 +1662,7 @@ int from_int;
goto suspend; goto suspend;
} }
if (!rfd_status & RFDS_OK) if (!(rfd_status & RFDS_OK))
{ {
/* Not OK? What happened? */ /* Not OK? What happened? */
assert(0); assert(0);