astyle files

This commit is contained in:
mdblack98 2020-05-03 17:24:42 -05:00
parent 85ecc848f8
commit bf1a05084d
26 changed files with 127 additions and 69 deletions

View file

@ -564,7 +564,7 @@ static int netrigctl_close(RIG *rig)
}
rig_debug(RIG_DEBUG_ERR, "%s: done status=%s\n", __func__, rigerror(ret));
usleep(10*1000);
usleep(10 * 1000);
return RIG_OK;
}

View file

@ -1331,8 +1331,10 @@ int aor_get_channel(RIG *rig, channel_t *chan, int read_only)
retval = parse_chan_line(rig, chan, chanbuf, mem_caps);
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return retval;

View file

@ -806,8 +806,10 @@ int ar3030_get_channel(RIG *rig, channel_t *chan, int read_only)
chan->flags = infobuf[4] == '1' ? RIG_CHFLAG_SKIP : RIG_CHFLAG_NONE;
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -1755,8 +1755,10 @@ static int ar7030p_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return (rc);

View file

@ -1054,8 +1054,10 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -417,8 +417,10 @@ int icr75_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -718,8 +718,10 @@ int ic10_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -265,14 +265,17 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data,
if (cache_age_ms < 500) // 500ms cache time
{
rig_debug(RIG_DEBUG_TRACE, "%s: cache hit, age=%dms\n", __func__, cache_age_ms);
if (data) strncpy(data, priv->last_if_response, datasize);
if (data) { strncpy(data, priv->last_if_response, datasize); }
return RIG_OK;
}
// else we drop through and do the real IF command
}
if (strlen(cmdstr) > 2 || strcmp(cmdstr,"RX")==0 || strcmp(cmdstr,"TX") == 0)
if (strlen(cmdstr) > 2 || strcmp(cmdstr, "RX") == 0
|| strcmp(cmdstr, "TX") == 0)
{
// then we must be setting something so we'll invalidate the cache
rig_debug(RIG_DEBUG_TRACE, "%s: cache invalidated\n", __func__);
@ -494,12 +497,16 @@ transaction_read:
// seems some rigs will send back an IF response to RX/TX when it changes the status
// normally RX/TX returns nothing when it's a null effect
// TS-950SDX is known to behave this way
if (strncmp(cmdstr,"RX",2)==0 || strncmp(cmdstr,"TX",2)==0) {
if (strncmp(priv->verify_cmd,"IF",2)==0) {
rig_debug(RIG_DEBUG_TRACE,"%s: RX/TX got IF response so we're good\n", __func__);
if (strncmp(cmdstr, "RX", 2) == 0 || strncmp(cmdstr, "TX", 2) == 0)
{
if (strncmp(priv->verify_cmd, "IF", 2) == 0)
{
rig_debug(RIG_DEBUG_TRACE, "%s: RX/TX got IF response so we're good\n",
__func__);
goto transaction_quit;
}
}
if (priv->verify_cmd[0] != buffer[0]
|| (priv->verify_cmd[1] && priv->verify_cmd[1] != buffer[1]))
{
@ -699,10 +706,12 @@ int kenwood_open(RIG *rig)
err = kenwood_get_id(rig, id);
if (err == RIG_OK) { // some rigs give ID while in standby
if (err == RIG_OK) // some rigs give ID while in standby
{
powerstat_t powerstat = 0;
rig_debug(RIG_DEBUG_TRACE, "%s: got ID so try PS\n", __func__);
err = rig_get_powerstat(rig, &powerstat);
if (err == RIG_OK && powerstat == 0)
{
rig_debug(RIG_DEBUG_TRACE, "%s: got PS0 so powerup\n", __func__);
@ -716,9 +725,11 @@ int kenwood_open(RIG *rig)
rig_set_powerstat(rig, 1);
/* Try get id again */
err = kenwood_get_id(rig, id);
if (RIG_OK != err)
{
rig_debug(RIG_DEBUG_ERR, "%s: no response to get_id from rig...contintuing anyways.\n", __func__);
rig_debug(RIG_DEBUG_ERR,
"%s: no response to get_id from rig...contintuing anyways.\n", __func__);
}
}

View file

@ -567,8 +567,10 @@ int pihspdr_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -2227,8 +2227,10 @@ int th_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -1408,8 +1408,10 @@ static int thd72_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -1325,8 +1325,10 @@ static int thd74_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -1934,8 +1934,10 @@ int tmd710_get_channel(RIG *rig, channel_t *chan, int read_only)
chan->ext_levels = NULL;
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -650,8 +650,10 @@ int tmv7_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -594,8 +594,10 @@ int ts2000_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -330,8 +330,10 @@ int prm80_get_channel(RIG *rig, channel_t *chan, int read_only)
chan->rptr_offs = chan->tx_freq - chan->freq;
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -642,8 +642,10 @@ int uniden_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -3169,8 +3169,10 @@ int ft1000d_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -3116,8 +3116,10 @@ int ft990_get_channel(RIG *rig, channel_t *chan, int read_only)
}
#warning Need to add setting rig to channel values
if (!read_only) {
// Set rig to channel values
if (!read_only)
{
// Set rig to channel values
}
return RIG_OK;

View file

@ -383,29 +383,29 @@ static void debug_ft991info_data(const ft991info *rdata)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s command %2.2s\n",
__func__, rdata->command);
__func__, rdata->command);
rig_debug(RIG_DEBUG_VERBOSE, "%s memory_ch %3.3s\n",
__func__, rdata->memory_ch);
__func__, rdata->memory_ch);
rig_debug(RIG_DEBUG_VERBOSE, "%s vfo_freq %9.9s\n",
__func__, rdata->vfo_freq);
__func__, rdata->vfo_freq);
rig_debug(RIG_DEBUG_VERBOSE, "%s clarifier %5.5s\n",
__func__, rdata->clarifier);
__func__, rdata->clarifier);
rig_debug(RIG_DEBUG_VERBOSE, "%s rx_clarifier %c\n",
__func__, rdata->rx_clarifier);
__func__, rdata->rx_clarifier);
rig_debug(RIG_DEBUG_VERBOSE, "%s tx_clarifier %c\n",
__func__, rdata->tx_clarifier);
__func__, rdata->tx_clarifier);
rig_debug(RIG_DEBUG_VERBOSE, "%s mode %c\n",
__func__, rdata->mode);
__func__, rdata->mode);
rig_debug(RIG_DEBUG_VERBOSE, "%s vfo_memory %c\n",
__func__, rdata->vfo_memory);
__func__, rdata->vfo_memory);
rig_debug(RIG_DEBUG_VERBOSE, "%s tone_mode %c\n",
__func__, rdata->tone_mode);
__func__, rdata->tone_mode);
rig_debug(RIG_DEBUG_VERBOSE, "%s fixed %2.2s\n",
__func__, rdata->fixed);
__func__, rdata->fixed);
rig_debug(RIG_DEBUG_VERBOSE, "%s repeater_offset %c\n",
__func__, rdata->repeater_offset);
__func__, rdata->repeater_offset);
rig_debug(RIG_DEBUG_VERBOSE, "%s terminator %c\n",
__func__, rdata->terminator);
__func__, rdata->terminator);
}

View file

@ -5955,9 +5955,12 @@ int newcat_get_cmd(RIG *rig)
strcpy(priv->ret_data, priv->last_if_response);
return RIG_OK;
}
// we drop through and do the real IF command
}
if (priv->cmd_str[2] != ';') // then we must be setting something so we'll invalidate the cache
if (priv->cmd_str[2] !=
';') // then we must be setting something so we'll invalidate the cache
{
rig_debug(RIG_DEBUG_TRACE, "%s: cache invalidated\n", __func__);
priv->cache_start.tv_sec = 0;

View file

@ -549,7 +549,7 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val)
break;
case TOK_CACHE_TIMEOUT:
rig_set_cache_timeout_ms(rig,CACHE_ALL,atol(val));
rig_set_cache_timeout_ms(rig, CACHE_ALL, atol(val));
break;
default:
@ -857,11 +857,11 @@ static int frontend_get_conf(RIG *rig, token_t token, char *val)
break;
case TOK_LO_FREQ:
sprintf(val,"%g", rs->lo_freq);
sprintf(val, "%g", rs->lo_freq);
break;
case TOK_CACHE_TIMEOUT:
sprintf(val,"%d", rig_get_cache_timeout_ms(rig, CACHE_ALL));
sprintf(val, "%d", rig_get_cache_timeout_ms(rig, CACHE_ALL));
break;
default:

View file

@ -1260,7 +1260,8 @@ int HAMLIB_API elapsed_ms(struct timespec *start, int option)
struct timespec stop;
double elapsed_msec;
if (option == ELAPSED_SET) {
if (option == ELAPSED_SET)
{
start->tv_sec = start->tv_nsec = 0;
}
@ -1271,10 +1272,12 @@ int HAMLIB_API elapsed_ms(struct timespec *start, int option)
switch (option)
{
case ELAPSED_GET:
if (start->tv_nsec == 0) { // if we haven't done SET yet
if (start->tv_nsec == 0) // if we haven't done SET yet
{
clock_gettime(CLOCK_REALTIME, start);
return 1000 * 1000;
return 1000 * 1000;
}
clock_gettime(CLOCK_REALTIME, &stop);
break;
@ -1285,12 +1288,14 @@ int HAMLIB_API elapsed_ms(struct timespec *start, int option)
return 999 * 1000; // so we can tell the difference in debug where we came from
break;
case ELAPSED_INVALIDATE:
start->tv_sec -= 3600*24*365; // let's back off 1 year -- should expire most elapsed measurements
case ELAPSED_INVALIDATE:
start->tv_sec -= 3600 * 24 *
365; // let's back off 1 year -- should expire most elapsed measurements
break;
}
elapsed_msec = ((stop.tv_sec - start->tv_sec) + (stop.tv_nsec/1e9 -
start->tv_nsec/1e9)) * 1e3;
elapsed_msec = ((stop.tv_sec - start->tv_sec) + (stop.tv_nsec / 1e9 -
start->tv_nsec / 1e9)) * 1e3;
rig_debug(RIG_DEBUG_TRACE, "%s: elapsed_secs=%g\n", __func__, elapsed_msec);

View file

@ -1345,7 +1345,9 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
}
else
{
rig_debug(RIG_DEBUG_TRACE, "%s: cache miss age=%dms, cached_vfo=%s, asked_vfo=%s\n", __func__, cache_ms, rig_strvfo(rig->state.cache.vfo_freq), rig_strvfo(vfo));
rig_debug(RIG_DEBUG_TRACE,
"%s: cache miss age=%dms, cached_vfo=%s, asked_vfo=%s\n", __func__, cache_ms,
rig_strvfo(rig->state.cache.vfo_freq), rig_strvfo(vfo));
}
caps = rig->caps;
@ -1820,7 +1822,8 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo)
elapsed_ms(&rig->state.cache.time_freq, ELAPSED_INVALIDATE);
elapsed_ms(&rig->state.cache.time_mode, ELAPSED_INVALIDATE);
rig_debug(RIG_DEBUG_TRACE, "%s: return %d, vfo=%s\n", __func__, retcode, rig_strvfo(vfo));
rig_debug(RIG_DEBUG_TRACE, "%s: return %d, vfo=%s\n", __func__, retcode,
rig_strvfo(vfo));
return retcode;
}

View file

@ -130,7 +130,8 @@ int main(int argc, char *argv[])
if (retcode != RIG_OK) { printf("Get mode failed?? Err=%s\n", rigerror(retcode)); }
printf("%4dms: Current mode = %s, width = %ld\n", elapsed_ms(&start, ELAPSED_GET),
printf("%4dms: Current mode = %s, width = %ld\n", elapsed_ms(&start,
ELAPSED_GET),
rig_strrmode(mode), width);
elapsed_ms(&start, ELAPSED_SET);

View file

@ -969,7 +969,8 @@ void *handle_socket(void *arg)
if (!fsockin)
{
rig_debug(RIG_DEBUG_ERR, "fdopen(0x%d) in: %s\n", handle_data_arg->sock, strerror(errno));
rig_debug(RIG_DEBUG_ERR, "fdopen(0x%d) in: %s\n", handle_data_arg->sock,
strerror(errno));
goto handle_exit;
}