mirror of https://github.com/ericonr/sndio.git
Swap "if" and "else" code blocks in slot_new() to improve readability.
No behavior change.
This commit is contained in:
parent
e21b26a56f
commit
e6579625a0
17
sndiod/dev.c
17
sndiod/dev.c
|
@ -1600,14 +1600,7 @@ slot_new(struct dev *d, struct opt *opt, char *who,
|
|||
bestidx = i;
|
||||
}
|
||||
}
|
||||
if (bestidx == DEV_NSLOT) {
|
||||
if (log_level >= 1) {
|
||||
log_puts(name);
|
||||
log_putu(unit);
|
||||
log_puts(": out of sub-device slots\n");
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if (bestidx != DEV_NSLOT) {
|
||||
s = d->slot + bestidx;
|
||||
s->vol = MIDI_MAXCTL;
|
||||
strlcpy(s->name, name, SLOT_NAMEMAX);
|
||||
|
@ -1622,6 +1615,14 @@ slot_new(struct dev *d, struct opt *opt, char *who,
|
|||
log_puts("\n");
|
||||
}
|
||||
#endif
|
||||
goto found;
|
||||
}
|
||||
if (log_level >= 1) {
|
||||
log_puts(name);
|
||||
log_putu(unit);
|
||||
log_puts(": out of sub-device slots\n");
|
||||
}
|
||||
return NULL;
|
||||
|
||||
found:
|
||||
if ((mode & MODE_REC) && (opt->mode & MODE_MON)) {
|
||||
|
|
Loading…
Reference in New Issue