From f71c12da942f9e289bfe70fe2072aa3203c343cb Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Tue, 9 Jun 2020 22:37:03 -0500 Subject: [PATCH] astyle files --- dummy/netrigctl.c | 7 +++++-- rigs/icom/icom.c | 6 ++++-- rigs/kenwood/flex.c | 4 +++- rigs/kenwood/kenwood.c | 4 +++- rigs/tentec/rx340.c | 2 +- rotators/gs232a/gs232b.c | 3 ++- rotators/meade/meade.c | 1 + src/rig.c | 6 ++++-- tests/cachetest.c | 9 ++++++--- tests/rigctlcom.c | 3 ++- tests/rotctl_parse.c | 3 ++- 11 files changed, 33 insertions(+), 15 deletions(-) diff --git a/dummy/netrigctl.c b/dummy/netrigctl.c index 52df37c68..0d5a20a40 100644 --- a/dummy/netrigctl.c +++ b/dummy/netrigctl.c @@ -535,11 +535,13 @@ static int netrigctl_open(RIG *rig) if (strcmp(setting, "vfo_ops") == 0) { rig->caps->vfo_ops = strtol(value, NULL, 0); - rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %d\n", __func__, setting, rig->caps->vfo_ops); + rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %d\n", __func__, setting, + rig->caps->vfo_ops); } else if (strcmp(setting, "ptt_type") == 0) { ptt_type_t temp = (ptt_type_t)strtol(value, NULL, 0); + if (RIG_PTT_RIG_MICDATA == rig->state.pttport.type.ptt && RIG_PTT_NONE == temp) { /* @@ -548,7 +550,8 @@ static int netrigctl_open(RIG *rig) * locally overridden it */ rig->state.pttport.type.ptt = temp; - rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %d\n", __func__, setting, rig->state.pttport.type.ptt); + rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %d\n", __func__, setting, + rig->state.pttport.type.ptt); } } else diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 9a134ef58..c6603a8e8 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -4522,9 +4522,11 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq, rig_strvfo(priv->rx_vfo), rig_strvfo(priv->tx_vfo)); // if not asking for RIG_VFO_CURR we'll use the requested VFO in the function call as tx_vfo - if (!priv->split_on && vfo != RIG_VFO_CURR) { + if (!priv->split_on && vfo != RIG_VFO_CURR) + { tx_vfo = vfo; - rig_debug(RIG_DEBUG_TRACE, "%s: split not on so using requested vfo=%s\n", __func__, rig_strvfo(tx_vfo)); + rig_debug(RIG_DEBUG_TRACE, "%s: split not on so using requested vfo=%s\n", + __func__, rig_strvfo(tx_vfo)); } if (RIG_OK != (retval = icom_set_vfo(rig, tx_vfo))) diff --git a/rigs/kenwood/flex.c b/rigs/kenwood/flex.c index ffb286e4e..d64bf6fac 100644 --- a/rigs/kenwood/flex.c +++ b/rigs/kenwood/flex.c @@ -70,7 +70,8 @@ int verify_flexradio_id(RIG *rig, char *id) if (strcmp("900", idptr) == 0) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: Rig ID is %s (PowerSDR compatible)\n", __func__, id); + rig_debug(RIG_DEBUG_VERBOSE, "%s: Rig ID is %s (PowerSDR compatible)\n", + __func__, id); } else if (strcmp("904", idptr) == 0) { @@ -134,6 +135,7 @@ int flexradio_open(RIG *rig) { case RIG_MODEL_F6K: break; + case RIG_MODEL_POWERSDR: break; diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 39f1a6ffb..3bed53a8f 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1375,7 +1375,9 @@ int kenwood_get_vfo_if(RIG *rig, vfo_t *vfo) { case '0': *vfo = priv->tx_vfo = split_and_transmitting ? RIG_VFO_B : RIG_VFO_A; - if (priv->info[32] == '1') priv->tx_vfo = RIG_VFO_B; + + if (priv->info[32] == '1') { priv->tx_vfo = RIG_VFO_B; } + break; case '1': diff --git a/rigs/tentec/rx340.c b/rigs/tentec/rx340.c index cb3b1daf2..b6f03ea73 100644 --- a/rigs/tentec/rx340.c +++ b/rigs/tentec/rx340.c @@ -580,7 +580,7 @@ int rx340_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) const char *rx340_get_info(RIG *rig) { static char buf[BUFSZ]; /* FIXME: reentrancy */ - int firmware_len=0, retval; + int firmware_len = 0, retval; #define REPORT_FIRM "V"EOM retval = rx340_transaction(rig, REPORT_FIRM, strlen(REPORT_FIRM), buf, diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index a33e1ecd2..dd12cb6bd 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -188,12 +188,13 @@ gs232b_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) #if 0 // do any GS232B models need a reply to the W command? retval = gs232b_transaction(rot, cmdstr, buf, sizeof(buf), 0); #else - retval = gs232b_transaction(rot, cmdstr, NULL, 0 , 0); + retval = gs232b_transaction(rot, cmdstr, NULL, 0, 0); if (retval != RIG_OK) { return retval; } + #endif return RIG_OK; diff --git a/rotators/meade/meade.c b/rotators/meade/meade.c index 3c9ea81d6..eaef6e483 100644 --- a/rotators/meade/meade.c +++ b/rotators/meade/meade.c @@ -234,6 +234,7 @@ static int meade_open(ROT *rot) { retval = meade_transaction(rot, ":AL#:So00#:Sh90#", NULL, 0, 0); } + { // Audiostar elevation is in arcminutes retval = meade_transaction(rot, ":So00#:Sh5400#", NULL, 0, 0); diff --git a/src/rig.c b/src/rig.c index 0db77f89b..a5e613acc 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1354,7 +1354,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) curr_vfo = rig->state.current_vfo; retcode = caps->set_vfo(rig, vfo); - // why is the line below here? + // why is the line below here? // it's causing set_freq on the wrong vfo //vfo = rig->state.current_vfo; // can't call get_vfo since Icoms don't have it @@ -1533,6 +1533,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) else { int rc2; + if (!caps->set_vfo) { return -RIG_ENAVAIL; @@ -1997,7 +1998,8 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) { rig->state.current_vfo = vfo; rig->state.cache.vfo = vfo; - rig_debug(RIG_DEBUG_TRACE, "%s: rig->state.current_vfo=%s\n", __func__, rig_strvfo(vfo)); + rig_debug(RIG_DEBUG_TRACE, "%s: rig->state.current_vfo=%s\n", __func__, + rig_strvfo(vfo)); } else { diff --git a/tests/cachetest.c b/tests/cachetest.c index 213584c85..f92758f48 100644 --- a/tests/cachetest.c +++ b/tests/cachetest.c @@ -117,14 +117,16 @@ int main(int argc, char *argv[]) if (retcode != RIG_OK) { printf("Get vfo failed?? Err=%s\n", rigerror(retcode)); } - printf("%4dms: VFO = %s\n", (int)elapsed_ms(&start, ELAPSED_GET), rig_strvfo(vfo)); + printf("%4dms: VFO = %s\n", (int)elapsed_ms(&start, ELAPSED_GET), + rig_strvfo(vfo)); elapsed_ms(&start, ELAPSED_SET); retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &freq); if (retcode != RIG_OK) { printf("Get freq failed?? Err=%s\n", rigerror(retcode)); } - printf("%4dms: VFO freq. = %.1f Hz\n", (int)elapsed_ms(&start, ELAPSED_GET), freq); + printf("%4dms: VFO freq. = %.1f Hz\n", (int)elapsed_ms(&start, ELAPSED_GET), + freq); elapsed_ms(&start, ELAPSED_SET); retcode = rig_get_mode(my_rig, RIG_VFO_CURR, &mode, &width); @@ -147,7 +149,8 @@ int main(int argc, char *argv[]) if (retcode != RIG_OK) { printf("Get split_vfo failed?? Err=%s\n", rigerror(retcode)); } - printf("%4dms: split=%d, tx_vfo=%s\n", (int)elapsed_ms(&start, ELAPSED_GET), split, + printf("%4dms: split=%d, tx_vfo=%s\n", (int)elapsed_ms(&start, ELAPSED_GET), + split, rig_strvfo(vfo)); #endif } diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 93bd633ee..a2b63ec8f 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -704,7 +704,8 @@ static int write_block2(void *func, */ static int handle_ts2000(void *arg) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd=%s\n", __func__, (char*)arg); + rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd=%s\n", __func__, (char *)arg); + // Handle all the queries if (strcmp(arg, "ID;") == 0) { diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 08908c0a6..87fb78c79 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -2155,7 +2155,8 @@ declare_proto_rot(d_mm2dec) CHKSCN1ARG(sscanf(arg2, "%lf", &min)); CHKSCN1ARG(sscanf(arg3, "%d", &sw)); - dec_deg = dmmm2dec(deg, min, sw, 0.0); // we'll add real seconds when somebody asks for it + dec_deg = dmmm2dec(deg, min, sw, + 0.0); // we'll add real seconds when somebody asks for it if ((interactive && prompt) || (interactive && !prompt && ext_resp)) {