From 96b1460e242f932014dbb05b080b9eb3cf3819b8 Mon Sep 17 00:00:00 2001 From: Nate Bargmann Date: Fri, 26 Aug 2011 15:07:40 -0500 Subject: [PATCH] Remove set but unused variable errors in tests. --- tests/memcsv.c | 3 +++ tests/rigsmtr.c | 13 ++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/memcsv.c b/tests/memcsv.c index 79f034598..724911e83 100644 --- a/tests/memcsv.c +++ b/tests/memcsv.c @@ -147,6 +147,9 @@ int csv_parm_save (RIG *rig, const char *outfilename) if (!ms || !ms[0]) continue; ret = rig_get_parm(rig, parm, &val); + if (ret != RIG_OK) + return ret; + if (RIG_PARM_IS_FLOAT(parm)) fprintf(f, "%f%c", val.f, csv_sep); else diff --git a/tests/rigsmtr.c b/tests/rigsmtr.c index e2a678c33..46c39d466 100644 --- a/tests/rigsmtr.c +++ b/tests/rigsmtr.c @@ -90,7 +90,7 @@ int main (int argc, char *argv[]) char rig_conf_parms[MAXCONFLEN] = ""; char rot_conf_parms[MAXCONFLEN] = ""; - int with_rot = 1; + /* int with_rot = 1; */ azimuth_t azimuth; elevation_t elevation; unsigned step = 1000000; /* 1e6 us */ @@ -260,8 +260,8 @@ int main (int argc, char *argv[]) strncpy(rot->state.rotport.pathname, rot_file, FILPATHLEN); /* FIXME: bound checking and port type == serial */ - if (serial_rate != 0) - rot->state.rotport.parm.serial.rate = serial_rate; + if (rot_serial_rate != 0) + rot->state.rotport.parm.serial.rate = rot_serial_rate; retcode = rot_open(rot); if (retcode != RIG_OK && rot_model != ROT_MODEL_DUMMY) { @@ -269,8 +269,11 @@ int main (int argc, char *argv[]) exit(2); } - if (rot_model == ROT_MODEL_DUMMY) - with_rot = 1; + /* Commenting out to quell "set but not used" warning. + * Enable when needed for further functionality. -N0NB + */ + /* if (rot_model == ROT_MODEL_DUMMY) */ + /* with_rot = 1; */ if (verbose > 0) printf("Opened rotator model %d, '%s'\n", rot->caps->rot_model,