From 1534d4f816bc938a179d2e97132258510f0f3711 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Thu, 16 Jan 2020 07:47:23 +0100 Subject: [PATCH] s/SIOCTL_INTMAX/SIOCTL_VALMAX --- libsndio/sndio.h | 2 +- sndioctl/sndioctl.c | 12 ++++++------ xvolkeys/xvolkeys.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libsndio/sndio.h b/libsndio/sndio.h index b1cafd9..243d2e3 100644 --- a/libsndio/sndio.h +++ b/libsndio/sndio.h @@ -30,7 +30,7 @@ * limits */ #define SIOCTL_NAMEMAX 12 /* max name length */ -#define SIOCTL_INTMAX 127 /* max channel number */ +#define SIOCTL_VALMAX 127 /* max channel number */ #define SIOCTL_HALF 64 /* also bool threshold */ /* diff --git a/sndioctl/sndioctl.c b/sndioctl/sndioctl.c index 8f402c5..a7c4a88 100644 --- a/sndioctl/sndioctl.c +++ b/sndioctl/sndioctl.c @@ -442,8 +442,8 @@ parse_name(char **line, char *name) int parse_dec(char **line, int *num) { -#define MAXQ (SIOCTL_INTMAX / 10) -#define MAXR (SIOCTL_INTMAX % 10) +#define MAXQ (SIOCTL_VALMAX / 10) +#define MAXR (SIOCTL_VALMAX % 10) char *p = *line; unsigned int dig, val; @@ -641,7 +641,7 @@ cmd(char *line) if (!parse_modeval(&pos, &mode, &val)) return 0; } else { - val = SIOCTL_INTMAX; + val = SIOCTL_VALMAX; mode = MODE_SET; } nent = 0; @@ -696,8 +696,8 @@ commit(void) break; case MODE_ADD: val = i->curval + i->newval; - if (val > SIOCTL_INTMAX) - val = SIOCTL_INTMAX; + if (val > SIOCTL_VALMAX) + val = SIOCTL_VALMAX; break; case MODE_SUB: val = i->curval - i->newval; @@ -705,7 +705,7 @@ commit(void) val = 0; break; case MODE_TOGGLE: - val = (i->curval >= SIOCTL_HALF) ? 0 : SIOCTL_INTMAX; + val = (i->curval >= SIOCTL_HALF) ? 0 : SIOCTL_VALMAX; } switch (i->desc.type) { case SIOCTL_NUM: diff --git a/xvolkeys/xvolkeys.c b/xvolkeys/xvolkeys.c index f600ca8..19ed7f4 100644 --- a/xvolkeys/xvolkeys.c +++ b/xvolkeys/xvolkeys.c @@ -44,7 +44,7 @@ char *dev_name; struct pollfd pfds[16]; struct sioctl_hdl *hdl; -unsigned int output_addr, output_val = SIOCTL_INTMAX; +unsigned int output_addr, output_val = SIOCTL_VALMAX; int output_found = 0; int verbose; @@ -139,8 +139,8 @@ dev_incrvol(int incr) if (!dev_connect()) return; vol = output_val + incr; - if (vol > SIOCTL_INTMAX) - vol = SIOCTL_INTMAX; + if (vol > SIOCTL_VALMAX) + vol = SIOCTL_VALMAX; if (vol < 0) vol = 0; if (output_val != (unsigned int)vol) {