]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
some "cppcheck" code polishing (unused variables etc.)
authorc vw <dl1ycf@darc.de>
Fri, 6 Mar 2020 10:54:33 +0000 (11:54 +0100)
committerc vw <dl1ycf@darc.de>
Fri, 6 Mar 2020 10:54:33 +0000 (11:54 +0100)
diversity_menu.c
diversity_menu.h
gpio.c
meter.c
rigctl.c
tx_menu.c
xvtr_menu.c

index eac362e037303bf08865dc1203cdfcdcd34ec41e..47ac76dda2c6f2eade3ec8b844cbdd9bb2a07b60 100644 (file)
@@ -150,34 +150,6 @@ void update_diversity_gain(double increment) {
   set_gain_phase();
 }
 
-void update_diversity_gain_coarse(double increment) {
-  double g=gain_coarse+increment;
-  if(g<-25.0) g=-25.0;
-  if(g>25.0) g=25.0;
-  gain_coarse=g;
-  div_gain=gain_coarse+gain_fine;
-  if(gain_coarse_scale!=NULL) {
-    gtk_range_set_value(GTK_RANGE(gain_coarse_scale),gain_coarse);
-  } else {
-    show_diversity_gain();
-  }
-  set_gain_phase();
-}
-
-void update_diversity_gain_fine(double increment) {
-  double g=gain_fine+(increment/100);
-  if(g<-2.0) g=-2.0;
-  if(g>2.0) g=2.0;
-  gain_fine=g;
-  div_gain=gain_coarse+gain_fine;
-  if(gain_fine_scale!=NULL) {
-    gtk_range_set_value(GTK_RANGE(gain_fine_scale),gain_fine);
-  } else {
-    show_diversity_gain();
-  }
-  set_gain_phase();
-}
 void update_diversity_phase(double increment) {
   double p=div_phase+increment;
   while (p >  180.0) p -= 360.0;
@@ -197,34 +169,6 @@ void update_diversity_phase(double increment) {
   set_gain_phase();
 }
 
-void update_diversity_phase_coarse(double increment) {
-  double p=phase_coarse+increment;
-  if (p >  180.0) p = 180.0;
-  if (p < -180.0) p = -180.0;
-  phase_coarse=p;
-  if(phase_coarse_scale!=NULL) {
-    gtk_range_set_value(GTK_RANGE(phase_coarse_scale),phase_coarse);
-  } else {
-    show_diversity_phase();
-  }
-  div_phase=phase_coarse+phase_fine;
-  set_gain_phase();
-}
-
-void update_diversity_phase_fine(double increment) {
-  double p=phase_fine+(increment/10.0);
-  while (p >  5.0) p = 5.0;
-  while (p < -5.0) p = -5.0;
-  phase_fine=p;
-  if(phase_fine_scale!=NULL) {
-    gtk_range_set_value(GTK_RANGE(phase_fine_scale),phase_fine);
-  } else {
-    show_diversity_phase();
-  }
-  div_phase=phase_coarse+phase_fine;
-  set_gain_phase();
-}
-
 void diversity_menu(GtkWidget *parent) {
 
   parent_window=parent;
index 59d63b825514eb61729501635d0ee573b8fcf921..b71588f9f0609304b9a4e1f186c727873323269a 100644 (file)
@@ -19,8 +19,4 @@
 
 extern void diversity_menu(GtkWidget *parent);
 extern void update_diversity_gain(double increment);
-extern void update_diversity_gain_coarse(double increment);
-extern void update_diversity_gain_fine(double increment);
 extern void update_diversity_phase(double increment);
-extern void update_diversity_phase_coarse(double increment);
-extern void update_diversity_phase_fine(double increment);
diff --git a/gpio.c b/gpio.c
index 2ab33d5792e3d81111e2d8f0fe2adefc1d5ee404..57fd76afcb45a809165a3c70e51b5126775a0845 100644 (file)
--- a/gpio.c
+++ b/gpio.c
@@ -1378,11 +1378,11 @@ void gpio_save_state() {
 
   if(controller!=CONTROLLER1) {
     setProperty("i2c_device",i2c_device);              
-    sprintf(value,"%d",i2c_address_1);
+    sprintf(value,"%ud",i2c_address_1);
     setProperty("i2c_address_1",value);                
     for(int i=0;i<16;i++) {
       sprintf(name,"i2c_sw[%d]",i);
-      sprintf(value,"%d",i2c_sw[i]);
+      sprintf(value,"%ud",i2c_sw[i]);
       setProperty(name,value);         
     }
 
diff --git a/meter.c b/meter.c
index 1a691d51cad21ef5f4696e10dcdba8665df10a29..4441f248df4caf1bf804cc3944032670fbcbe786 100644 (file)
--- a/meter.c
+++ b/meter.c
@@ -147,7 +147,6 @@ void meter_update(RECEIVER *rx,int meter_type,double value,double reverse,double
   char sf[32];
   int text_location;
   double offset;
-  int max_power=100;
   char *units="W";
   double interval=10.0;
   cairo_t *cr = cairo_create (meter_surface);
@@ -159,33 +158,26 @@ void meter_update(RECEIVER *rx,int meter_type,double value,double reverse,double
     }
     switch(pa_power) {
       case PA_1W:
-        max_power=1000;
         units="mW";
         interval=100.0;
         level=level*1000.0;
         break;
       case PA_10W:
-        max_power=10;
         interval=1.0;
         break;
       case PA_30W:
-        max_power=30;
         interval=3.0;
         break;
       case PA_50W:
-        max_power=50;
         interval=5.0;
         break;
       case PA_100W:
-        max_power=100;
         interval=10.0;
         break;
       case PA_200W:
-        max_power=200;
         interval=20.0;
         break;
       case PA_500W:
-        max_power=500;
         interval=50.0;
         break;
     }
@@ -339,37 +331,29 @@ if(analog_meter) {
       cairo_set_line_width(cr, 1.0);
       cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
 
-      int max_power=100;
       char *units="W";
       double interval=10.0;
       switch(pa_power) {
         case PA_1W:
-          max_power=1000;
           units="mW";
           interval=100.0;
           break;
         case PA_10W:
-          max_power=10;
           interval=1.0;
           break;
         case PA_30W:
-          max_power=30;
           interval=3.0;
           break;
         case PA_50W:
-          max_power=50;
           interval=5.0;
           break;
         case PA_100W:
-          max_power=100;
           interval=10.0;
           break;
         case PA_200W:
-          max_power=200;
           interval=20.0;
           break;
         case PA_500W:
-          max_power=500;
           interval=50.0;
           break;
       }
index d452ca5f935f95d978b571942361caa16c0c4619..ba0c1b47084f43930533b814068d65d79221f266 100644 (file)
--- a/rigctl.c
+++ b/rigctl.c
@@ -84,8 +84,6 @@ int connect_cnt = 0;
 
 int rigctlGetFilterLow();
 int rigctlGetFilterHigh();
-void rigctlSetFilterLow(int val);
-void rigctlSetFilterHigh(int val);
 int new_level;
 int active_transmitter = 0;
 int rigctl_busy = 0;  // Used to tell rigctl_menu that launch has already occured
@@ -3956,12 +3954,6 @@ int rigctlGetMode()  {
         }
 }
 
-// Changed these two functions to void
-void rigctlSetFilterLow(int val){
-};
-void rigctlSetFilterHigh(int val){
-};
-
 void set_freqB(long long new_freqB) {      
 
    vfo[VFO_B].frequency = new_freqB;   
index f519912579c52175b736744132aa7fbe89045f84..3ee551357d9c62ded2800b28216702ea31e8eb2c 100644 (file)
--- a/tx_menu.c
+++ b/tx_menu.c
@@ -405,8 +405,6 @@ void tx_menu(GtkWidget *parent) {
   row++;
   col=0;
 
-  int saved_row=row;
-
   GtkWidget *panadapter_high_label=gtk_label_new(NULL);
   gtk_label_set_markup(GTK_LABEL(panadapter_high_label), "<b>Panadapter High: </b>");
 #ifdef GTK316
index c8b7d83ef3acd5aa088d2c67c7248c25c80fd700..7126cc17546bd89fa958db6af7e13ae1cce5d85e 100644 (file)
@@ -52,8 +52,6 @@ static void save_xvtr () {
     const char *maxf;
     const char *lof;
     const char *loerr;
-    const char *txlof;   // used in temporarily de-activated code
-    const char *txloerr; // used in temporarily de-activated code
     for(i=BANDS;i<BANDS+XVTRS;i++) {
       BAND *xvtr=band_get_band(i);
       BANDSTACK *bandstack=xvtr->bandstack;