]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsamixer: fix gcc warnings
authorJaroslav Kysela <perex@perex.cz>
Sun, 14 Oct 2018 15:03:08 +0000 (17:03 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sun, 14 Oct 2018 15:05:22 +0000 (17:05 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
alsamixer/mainloop.c
alsamixer/mem.c
alsamixer/mixer_controls.c
alsamixer/mixer_widget.c
alsamixer/volume_mapping.c
alsamixer/widget.c
alsamixer/widget.h

index 79d81a99cfc14f6a4eb57822c5e3058391c0baf0..a50109baea27dcc7a7504b94e73e9c2a5cd26ea9 100644 (file)
@@ -68,7 +68,7 @@ void mainloop(void)
 {
        struct pollfd *pollfds = NULL;
        int nfds = 0, n;
-       struct widget *active_widget;
+       const struct widget *active_widget;
        unsigned short revents;
        int key;
        int err;
index fa03a895bb6a0107fafc59f84b46c5d221c2d2ad..b6e1df2c7e82290397201089b49a2ce0b47fe3a0 100644 (file)
@@ -16,7 +16,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define _GNU_SOURCE
 #include "aconfig.h"
 #include <stdio.h>
 #include <stdlib.h>
index cc98b64413ddf4470e1ad9c238d472bb7d4b61f9..9573517b6e14e54790c8cc31cfac3f15ae34bb48 100644 (file)
@@ -216,7 +216,6 @@ static unsigned int create_controls_for_elem(snd_mixer_elem_t *elem, struct cont
 {
        unsigned int count = 0;
        unsigned int i;
-       unsigned int multich_flag;
        unsigned int enum_index;
        struct control *front_control = NULL;
        bool has_pvol, has_psw;
@@ -286,7 +285,6 @@ static unsigned int create_controls_for_elem(snd_mixer_elem_t *elem, struct cont
                        ++control;
                        ++count;
                } else {
-                       multich_flag = 0;
                        for (i = 0; i < ARRAY_SIZE(supported_channels); ++i)
                                has_channel[supported_channels[i]] =
                                        snd_mixer_selem_has_playback_channel(elem, supported_channels[i]);
index 0c2b9e074820de04147f6ff4c9b37115be898584..5013861102a02546fb5c14c744ac6e7dd21aeed9 100644 (file)
@@ -444,7 +444,6 @@ static void balance_volumes(void)
 {
        struct control *control;
        double left, right;
-       int err;
 
        control = get_focus_control(TYPE_PVOLUME | TYPE_CVOLUME);
        if (!control || !(control->flags & HAS_VOLUME_1))
index 1c0d7c45e6686239464e1b0bbc8983ea57f3914f..94bd0feacaa27f605dae4f7b1d47664e64c4637b 100644 (file)
@@ -31,7 +31,6 @@
  */
 
 #define _ISOC99_SOURCE /* lrint() */
-#define _GNU_SOURCE /* exp10() */
 #include "aconfig.h"
 #include <math.h>
 #include <stdbool.h>
index 75da4c2a106b1e3fb66009365c35e2e73f326e51..464f440e031ee295f5d141de4a2c5ebdd7317cb7 100644 (file)
@@ -33,7 +33,7 @@ static void widget_handle_key(int key)
 
 static void update_cursor_visibility(void)
 {
-       struct widget *active_widget;
+       const struct widget *active_widget;
 
        active_widget = get_active_widget();
        if (active_widget &&
@@ -112,7 +112,7 @@ void widget_free(struct widget *widget)
        update_cursor_visibility();
 }
 
-struct widget *get_active_widget(void)
+const struct widget *get_active_widget(void)
 {
        PANEL *active_panel;
 
@@ -126,7 +126,7 @@ struct widget *get_active_widget(void)
 void window_size_changed(void)
 {
        PANEL *panel, *below;
-       struct widget *widget;
+       const struct widget *widget;
 
        getmaxyx(stdscr, screen_lines, screen_cols);
        if (tigetflag("xenl") != 1 && tigetflag("am") != 1)
index 6adb5263d67661440d9cdc272727b599f12d57ac..58a132c74ea1e3b12be7038e3146c0e0be10b1a4 100644 (file)
@@ -27,7 +27,7 @@ void widget_init(struct widget *widget,
                 int lines_, int cols, int y, int x,
                 chtype bkgd, unsigned int flags);
 void widget_free(struct widget *widget);
-struct widget *get_active_widget(void);
+const struct widget *get_active_widget(void);
 void window_size_changed(void);
 
 #endif