From 6a6caa92161b8966abb5e237b96d34f3a7f8d1f3 Mon Sep 17 00:00:00 2001 From: c vw Date: Fri, 28 May 2021 11:49:53 +0200 Subject: [PATCH] Silenced some compiler warnings --- midi2.c | 2 +- midi3.c | 11 +++++++++-- midi_menu.c | 6 +----- vfo_menu.c | 4 ---- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/midi2.c b/midi2.c index 1f1562d..7fa75d0 100644 --- a/midi2.c +++ b/midi2.c @@ -327,7 +327,7 @@ int MIDIstartup(char *filename) { int chan; int t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12; int onoff, delay; - struct desc *desc, *dp; + struct desc *desc; enum MIDItype type; enum MIDIevent event; char c; diff --git a/midi3.c b/midi3.c index 5abf73f..0b5b7ee 100644 --- a/midi3.c +++ b/midi3.c @@ -803,10 +803,17 @@ int DoTheRestOfTheMIDI(void *data) { break; /////////////////////////////////////////////////////////// "RFGAIN" case MIDI_ACTION_RF_GAIN: // knob or wheel supported - if (type == MIDI_TYPE_KNOB) { + switch (type) { + case MIDI_TYPE_KNOB: dnew=val; - } else if (type == MIDI_TYPE_WHEEL) { + break; + case MIDI_TYPE_WHEEL: dnew=adc[active_receiver->id].gain+val; + break; + default: + // Arriving here means there is an error somewhere else + dnew=0.0; + break; } if (dnew < 0.0) dnew = 0.0; if (dnew > 100.0) dnew = 100.0; diff --git a/midi_menu.c b/midi_menu.c index bf32e3b..3c5ff64 100644 --- a/midi_menu.c +++ b/midi_menu.c @@ -1,4 +1,4 @@ -/* cOpyright (C) +/* Copyright (C) * 2020 - John Melton, G0ORX/N6LYT * * This program is free software; you can redistribute it and/or @@ -399,7 +399,6 @@ static void save_cb(GtkWidget *widget,gpointer user_data) { GtkFileChooser *chooser; GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE; gint res; - struct desc *cmd; save_dialog = gtk_file_chooser_dialog_new ("Save File", GTK_WINDOW(dialog), @@ -427,7 +426,6 @@ static void load_cb(GtkWidget *widget,gpointer user_data) { GtkWidget *load_dialog; GtkFileChooser *chooser; GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN; - gchar *filename; gint res; load_dialog = gtk_file_chooser_dialog_new ("Open MIDI File", @@ -1214,8 +1212,6 @@ void midi_menu(GtkWidget *parent) { static int update(void *data) { int state=GPOINTER_TO_INT(data); gchar text[32]; - gint i=1; - gint j; switch(state) { case UPDATE_NEW: diff --git a/vfo_menu.c b/vfo_menu.c index 2cf8b84..22c5b4e 100644 --- a/vfo_menu.c +++ b/vfo_menu.c @@ -84,7 +84,6 @@ static gboolean freqent_select_cb (GtkWidget *widget, gpointer data) { double mult; long long f; static int set = 0; - SET_FREQUENCY *fp; // Instead of messing with LOCALE settings, // we print a "0.0" and look what the decimal @@ -210,8 +209,6 @@ static void lock_cb(GtkWidget *widget, gpointer data) { g_idle_add(ext_vfo_update,NULL); } -static GtkWidget *last_mode; - void vfo_menu(GtkWidget *parent,int vfo) { int i; @@ -256,7 +253,6 @@ void vfo_menu(GtkWidget *parent,int vfo) { gtk_misc_set_alignment (GTK_MISC (label), 1, .5); gtk_grid_attach(GTK_GRID(grid),label,0,1,3,1); - GtkWidget *step_rb=NULL; for (i=0; i<16; i++) { btn[i]=gtk_button_new_with_label(btn_labels[i]); set_button_text_color(btn[i],"black"); -- 2.45.2