Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
add vol_perc notes, add braces to singleline statements
[slstatus.git]
/
slstatus.c
diff --git
a/slstatus.c
b/slstatus.c
index
d580ac0
..
ff81e0c
100644
(file)
--- a/
slstatus.c
+++ b/
slstatus.c
@@
-628,14
+628,18
@@
vol_perc(const char *card)
}
ioctl(afd, MIXER_READ(SOUND_MIXER_DEVMASK), &devmask);
}
ioctl(afd, MIXER_READ(SOUND_MIXER_DEVMASK), &devmask);
- for (i = 0; i < (sizeof(vnames) / sizeof((vnames[0]))); i++)
- if (devmask & (1 << i))
- if (!strcmp("vol", vnames[i]))
+ for (i = 0; i < (sizeof(vnames) / sizeof((vnames[0]))); i++)
{
+ if (devmask & (1 << i))
{
+ if (!strcmp("vol", vnames[i]))
{
ioctl(afd, MIXER_READ(i), &v);
ioctl(afd, MIXER_READ(i), &v);
+ }
+ }
+ }
close(afd);
close(afd);
- if (v == 0)
+ if (v == 0)
{
return smprintf("mute");
return smprintf("mute");
+ }
return smprintf("%d%%", v & 0xff);
}
return smprintf("%d%%", v & 0xff);
}