Update astyle formatting

pull/1161/head
Mike Black W9MDB 2022-11-16 15:30:36 -06:00
rodzic 2b487fe718
commit 6c5e0e6974
28 zmienionych plików z 97 dodań i 59 usunięć

Wyświetl plik

@ -210,7 +210,7 @@ const struct rig_caps dx77_caps =
},
{
.startf = kHz(500), .endf = MHz(30), .modes = DX77_AM_TX_MODES,
.low_power = -1, .high_power = -1 , RIG_VFO_A, RIG_ANT_NONE
.low_power = -1, .high_power = -1, RIG_VFO_A, RIG_ANT_NONE
},
RIG_FRNG_END,
},

Wyświetl plik

@ -424,7 +424,8 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
if (vfo == RIG_VFO_CURR) { vfo = priv->curr_vfo; }
if (vfo == RIG_VFO_CURR || RIG_VFO_TX) { vfo = vfo_fixup(rig,vfo,rig->state.cache.split); }
if (vfo == RIG_VFO_CURR || RIG_VFO_TX) { vfo = vfo_fixup(rig, vfo, rig->state.cache.split); }
// if needed for testing enable this to emulate a rig with 100hz resolution
#if 0
@ -934,7 +935,7 @@ static int dummy_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
int retval;
ENTERFUNC;
retval = dummy_set_freq(rig, vfo, tx_freq);
priv->curr->tx_freq = tx_freq;
rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->curr->tx_freq = %.0f\n", __func__,

Wyświetl plik

@ -2362,20 +2362,25 @@ HAMLIB_EXPORT(int) flrig_cat_string(RIG *rig, const char *arg)
return retval;
}
HAMLIB_EXPORT(int) flrig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
HAMLIB_EXPORT(int) flrig_set_func(RIG *rig, vfo_t vfo, setting_t func,
int status)
{
int retval;
char cmd_arg[MAXARGLEN];
rig_debug(RIG_DEBUG_VERBOSE, "%s called: level=%s, status=%d\n", __func__, rig_strfunc(func), status);
switch(func)
rig_debug(RIG_DEBUG_VERBOSE, "%s called: level=%s, status=%d\n", __func__,
rig_strfunc(func), status);
switch (func)
{
case RIG_FUNC_TUNER:
SNPRINTF(cmd_arg, sizeof(cmd_arg),
"<params><param><value>%d</value></param></params>", status);
retval = flrig_transaction(rig, "rig.tune", cmd_arg, NULL, 0);
default:
case RIG_FUNC_TUNER:
SNPRINTF(cmd_arg, sizeof(cmd_arg),
"<params><param><value>%d</value></param></params>", status);
retval = flrig_transaction(rig, "rig.tune", cmd_arg, NULL, 0);
default:
retval = -RIG_ENIMPL;
}
return retval;
}

Wyświetl plik

@ -382,7 +382,7 @@ const struct rig_caps ic7610_caps =
[LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
[LVL_SPECTRUM_REF] = {.min = {.f = -30.0f}, .max = {.f = 10.0f}, .step = {.f = 0.5f}},
[LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
[LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f/255.0f }},
[LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f }},
},
.parm_gran = {},
.ext_tokens = ic7610_ext_tokens,

Wyświetl plik

@ -274,7 +274,7 @@ const struct rig_caps ic785x_caps =
[LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
[LVL_SPECTRUM_REF] = {.min = {.f = -20.0f}, .max = {.f = 20.0f}, .step = {.f = 0.5f}},
[LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
[LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f/255.0f }},
[LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f }},
},
.parm_gran = {},
.ext_tokens = ic785x_ext_tokens,

Wyświetl plik

@ -8076,7 +8076,7 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status)
rig->state.rigport.retry = 0;
int retval = rig_get_freq(rig, RIG_VFO_A, &freq);
rig->state.rigport.retry = retrysave;
*status = retval==RIG_OK ? RIG_POWER_ON : RIG_POWER_OFF;
*status = retval == RIG_OK ? RIG_POWER_ON : RIG_POWER_OFF;
return retval;
}
else

Wyświetl plik

@ -119,7 +119,7 @@ const struct rig_caps icr6_caps =
.tuning_steps = {
{ICR6_MODES, Hz(5000)},
{ICR6_MODES, Hz(6250)},
{ICR6_MODES, Hz(8330)}, // Air band only
{ICR6_MODES, Hz(8330)}, // Air band only
{ICR6_MODES, Hz(9000)}, // AM broadcast band only
{ICR6_MODES, Hz(10000)},
{ICR6_MODES, Hz(12500)},

Wyświetl plik

@ -160,7 +160,7 @@ const struct rig_caps icr8600_caps =
[LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
[LVL_SPECTRUM_REF] = {.min = {.f = -20.0f}, .max = {.f = 20.0f}, .step = {.f = 0.5f}},
[LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
[LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f/255.0f }},
[LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f }},
},
.parm_gran = { [PARM_TIME] = { .min = { .i = 0 }, .max = { .i = 86399} } },
.ext_tokens = icr8600_tokens,

Wyświetl plik

@ -245,7 +245,8 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data,
struct kenwood_priv_caps *caps = kenwood_caps(rig);
struct rig_state *rs;
rig_debug(RIG_DEBUG_VERBOSE, "%s called cmd=%s datasize=%d\n", __func__, cmdstr, (int)datasize);
rig_debug(RIG_DEBUG_VERBOSE, "%s called cmd=%s datasize=%d\n", __func__, cmdstr,
(int)datasize);
if ((!cmdstr && !datasize) || (datasize && !data))
{
@ -373,8 +374,9 @@ transaction_read:
KENWOOD_MAX_BUF_LEN);
retval = read_string(&rs->rigport, (unsigned char *) buffer, len,
cmdtrm_str, strlen(cmdtrm_str), 0, 1);
rig_debug(RIG_DEBUG_TRACE, "%s: read_string(expected=%d, len=%d)='%s'\n", __func__,
len,(int)strlen(buffer), buffer);
rig_debug(RIG_DEBUG_TRACE, "%s: read_string(expected=%d, len=%d)='%s'\n",
__func__,
len, (int)strlen(buffer), buffer);
if (retval < 0)
{
@ -637,7 +639,8 @@ int kenwood_safe_transaction(RIG *rig, const char *cmd, char *buf,
int err;
int retry = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s called, cmd=%s, expected=%d\n", __func__, cmd, (int)expected);
rig_debug(RIG_DEBUG_VERBOSE, "%s called, cmd=%s, expected=%d\n", __func__, cmd,
(int)expected);
if (!cmd)
{
@ -1844,12 +1847,14 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
// cppcheck-suppress *
SNPRINTF(freqbuf, sizeof(freqbuf), "F%c%011"PRIll, vfo_letter, (int64_t)freq);
// we need to modify priv->verify_cmd if ID is not being used
// if FB command than we change to FB and back again to avoid VFO blinking
if (priv->verify_cmd[1]=='A' && vfo_letter == 'B') priv->verify_cmd[1]='A';
if (priv->verify_cmd[1] == 'A' && vfo_letter == 'B') { priv->verify_cmd[1] = 'A'; }
err = kenwood_transaction(rig, freqbuf, NULL, 0);
if (priv->verify_cmd[1]=='B' && vfo_letter == 'B') priv->verify_cmd[1]='A';
if (priv->verify_cmd[1] == 'B' && vfo_letter == 'B') { priv->verify_cmd[1] = 'A'; }
if (RIG_OK == err && RIG_IS_TS590S
&& priv->fw_rev_uint <= 107 && ('A' == vfo_letter || 'B' == vfo_letter))

Wyświetl plik

@ -40,7 +40,7 @@
#define TS950_GET_LEVEL (RIG_LEVEL_RAWSTR)
// STR_CAL borrowed from TS850
// STR_CAL borrowed from TS850
#define TS950_STR_CAL { 4, \
{ \
{ 0, -54 }, \

Wyświetl plik

@ -613,15 +613,16 @@ const struct rig_caps mds_caps =
// .vfo_ops = DUMMY_VFO_OP,
.transceive = RIG_TRN_RIG,
.rx_range_list1 = {
{.startf = MHz(380), .endf = MHz(530), .modes = RIG_MODE_ALL,
{
.startf = MHz(380), .endf = MHz(530), .modes = RIG_MODE_ALL,
.low_power = 0, .high_power = 0, MDS_VFOS, RIG_ANT_1
},
RIG_FRNG_END,
},
.rx_range_list2 = {RIG_FRNG_END,},
.tx_range_list1 = {
{MHz(380), MHz(530), RIG_MODE_ALL, W(.1), W(5), RIG_VFO_A, RIG_ANT_NONE},
RIG_FRNG_END,
.tx_range_list1 = {
{MHz(380), MHz(530), RIG_MODE_ALL, W(.1), W(5), RIG_VFO_A, RIG_ANT_NONE},
RIG_FRNG_END,
},
// .tx_range_list2 = {RIG_FRNG_END,}
.tuning_steps = {

Wyświetl plik

@ -101,7 +101,7 @@ const struct rig_caps tt516_caps =
.has_set_level = RIG_LEVEL_SET(TT516_LEVELS),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -108,7 +108,7 @@ const struct rig_caps rx350_caps =
.has_set_parm = RX350_PARMS,
.level_gran =
{
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }
},
.parm_gran = {},
.ctcss_list = NULL,

Wyświetl plik

@ -626,8 +626,8 @@ const struct rig_caps ft650_caps =
RIG_FRNG_END,
}, /* tx range end */
.tuning_steps = {
{RIG_MODE_ALL, 1},
.tuning_steps = {
{RIG_MODE_ALL, 1},
RIG_TS_END,
},

Wyświetl plik

@ -166,7 +166,7 @@ const struct rig_caps ft991_caps =
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
#include "level_gran_yaesu.h"
[LVL_NR] = { .min = { .f = 0 }, .max = { .f = 1 }, .step = { .f = 1.0f/15.0f } },
[LVL_NR] = { .min = { .f = 0 }, .max = { .f = 1 }, .step = { .f = 1.0f / 15.0f } },
},
.ctcss_list = common_ctcss_list,
.dcs_list = common_dcs_list,

Wyświetl plik

@ -4190,13 +4190,16 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
if (is_ft991)
{
fpf = newcat_scale_float(15, val.f);
if (fpf > 15) fpf=15;
if (fpf < 1) fpf=1;
if (fpf > 15) { fpf = 15; }
if (fpf < 1) { fpf = 1; }
}
else
{
fpf = newcat_scale_float(15, val.f);
if (fpf > 15) fpf=10;
if (fpf > 15) { fpf = 10; }
}
if (fpf < 0)
@ -11563,7 +11566,7 @@ int newcat_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
RETURNFUNC2(err);
}
if (hour < 0) RETURNFUNC2(RIG_OK);
if (hour < 0) { RETURNFUNC2(RIG_OK); }
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "DT1%02d%02d%02d%c", hour, min,
sec, cat_term);

Wyświetl plik

@ -110,10 +110,12 @@ int main(int argc, char *argv[])
while (1)
{
buf[0] = 0;
if (getmyline(fd, buf))
{
printf("Cmd:%s\n", buf);
}
//else { return 0; }
if (strcmp(buf, "RM5;") == 0)

Wyświetl plik

@ -244,6 +244,7 @@ void frameParse(int fd, unsigned char *frame, int len)
frame[6] = 0xfd;
n = write(fd, frame, 7);
break;
case 0x1a: // miscellaneous things
switch (frame[5])
{

Wyświetl plik

@ -56,6 +56,7 @@ frameGet(int fd, unsigned char *buf)
unsigned char c;
again:
while (read(fd, &c, 1) > 0)
{
buf[i++] = c;
@ -67,16 +68,18 @@ again:
return i;
}
if (i > 2 && c==0xfe)
if (i > 2 && c == 0xfe)
{
printf("Turning power on due to 0xfe string\n");
powerstat = 1;
int j;
for(j=i;j<175;++j)
for (j = i; j < 175; ++j)
{
if (read(fd, &c, 1) < 0) break;
if (read(fd, &c, 1) < 0) { break; }
}
i=0;
i = 0;
goto again;
}
}

Wyświetl plik

@ -221,7 +221,7 @@ int main(int argc, char *argv[])
//usleep(mysleep * 1000);
pbuf = "FW240";
n = write(fd, pbuf, strlen(pbuf));
usleep(20*1000);
usleep(20 * 1000);
pbuf = "0;";
n = write(fd, pbuf, strlen(pbuf));
continue;

Wyświetl plik

@ -322,7 +322,8 @@ int main(int argc, char *argv[])
}
else if (strncmp(buf, "ZZMN", 4) == 0)
{
SNPRINTF(buf, sizeof(buf), "ZZMN01 5.0k 5100 100 4.4k 4500 100 3.8k 3900 100 3.3k 3400 100 2.9k 3000 100 2.7k 2800 100 2.4k 2500 100 2.1k 2200 100 1.8k 1900 100 1.0k 1100 100Var 1 3150 100Var 2 2800 100;");
SNPRINTF(buf, sizeof(buf),
"ZZMN01 5.0k 5100 100 4.4k 4500 100 3.8k 3900 100 3.3k 3400 100 2.9k 3000 100 2.7k 2800 100 2.4k 2500 100 2.1k 2200 100 1.8k 1900 100 1.0k 1100 100Var 1 3150 100Var 2 2800 100;");
n = write(fd, buf, strlen(buf));
printf("%s\n", buf);
continue;

Wyświetl plik

@ -119,6 +119,7 @@ int main(int argc, char *argv[])
{
printf("Cmd:%s\n", buf);
}
//else { return 0; }
if (buf[0] == 0x0a)

Wyświetl plik

@ -1262,7 +1262,8 @@ static int read_string_generic(hamlib_port_t *p,
return -RIG_EINTERNAL;
}
rig_debug(RIG_DEBUG_TRACE, "%s called, rxmax=%d direct=%d, expected_len=%d\n", __func__,
rig_debug(RIG_DEBUG_TRACE, "%s called, rxmax=%d direct=%d, expected_len=%d\n",
__func__,
(int)rxmax, direct, expected_len);
if (!p || !rxbuffer)
@ -1341,8 +1342,8 @@ static int read_string_generic(hamlib_port_t *p,
{
#if 0
#ifndef __MINGW32__
// The ioctl works on Linux but not mingw
int avail=0;
// The ioctl works on Linux but not mingw
int avail = 0;
ioctl(p->fd, FIONREAD, &avail);
//rig_debug(RIG_DEBUG_ERR, "xs: avail=%d expected_len=%d, minlen=%d, direct=%d\n", __func__, avail, expected_len, minlen, direct);
#endif

Wyświetl plik

@ -2253,9 +2253,12 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
rmode_t mode_curr;
pbwidth_t width_curr;
retcode = caps->get_mode(rig, vfo, &mode_curr, &width_curr);
if (retcode == RIG_OK && mode==mode_curr)
if (retcode == RIG_OK && mode == mode_curr)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: mode already %s and bw change not requested\n", __func__, rig_strrmode(mode));
rig_debug(RIG_DEBUG_VERBOSE,
"%s: mode already %s and bw change not requested\n", __func__,
rig_strrmode(mode));
ELAPSED2;
RETURNFUNC2(RIG_OK);
}

Wyświetl plik

@ -154,7 +154,8 @@ int main(int argc, char *argv[])
char vbuf[1024];
int err = setvbuf(stderr, vbuf, _IOFBF, sizeof(vbuf));
if (err) rig_debug(RIG_DEBUG_ERR, "%s: setvbuf err=%s\n", __func__, strerror(err));
if (err) { rig_debug(RIG_DEBUG_ERR, "%s: setvbuf err=%s\n", __func__, strerror(err)); }
while (1)
{

Wyświetl plik

@ -4891,7 +4891,8 @@ declare_proto_rig(send_cmd)
++rxbytes; // need length + 1 for end of string
eom_buf[0] = 0;
}
if (arg2[0] == ';') eom_buf[0] = ';';
if (arg2[0] == ';') { eom_buf[0] = ';'; }
/* Assumes CR or LF is end of line char for all ASCII protocols. */
retval = read_string(&rs->rigport, buf, rxbytes, eom_buf,
@ -5174,8 +5175,8 @@ declare_proto_rig(get_cache)
declare_proto_rig(set_clock)
{
int year, mon, day, hour = -1, min = -1, sec = 0;
double msec=-1;
int utc_offset = 0;
double msec = -1;
int utc_offset = 0;
int n;
char timebuf[64];
@ -5198,17 +5199,20 @@ declare_proto_rig(set_clock)
&min, &sec, &msec, &utc_offset);
}
else if (arg1[16] == '+' || arg1[16] == '-')
{ // YYYY-MM-DDTHH:MM+ZZ
{
// YYYY-MM-DDTHH:MM+ZZ
n = sscanf(arg1, "%04d-%02d-%02dT%02d:%02d%d", &year, &mon, &day, &hour,
&min, &utc_offset);
}
else if (arg1[19] == '+' || arg1[19] == '-')
{ // YYYY-MM-DDTHH:MM:SS+ZZ
{
// YYYY-MM-DDTHH:MM:SS+ZZ
n = sscanf(arg1, "%04d-%02d-%02dT%02d:%02d:%02d%d", &year, &mon, &day, &hour,
&min, &sec, &utc_offset);
}
else if (arg1[23] == '+' || arg1[23] == '-')
{ // YYYY-MM-DDTHH:MM:SS.SSS+ZZ
{
// YYYY-MM-DDTHH:MM:SS.SSS+ZZ
n = sscanf(arg1, "%04d-%02d-%02dT%02d:%02d:%02d%lf%d", &year, &mon, &day, &hour,
&min, &sec, &msec, &utc_offset);
}

Wyświetl plik

@ -284,7 +284,8 @@ int main(int argc, char *argv[])
is_rigctld = 1;
int err = setvbuf(stderr, vbuf, _IOFBF, sizeof(vbuf));
if (err) rig_debug(RIG_DEBUG_ERR, "%s: setvbuf err=%s\n", __func__, strerror(err));
if (err) { rig_debug(RIG_DEBUG_ERR, "%s: setvbuf err=%s\n", __func__, strerror(err)); }
while (1)

Wyświetl plik

@ -2381,6 +2381,7 @@ declare_proto_rot(dump_state)
fprintf(fout, "%d%c", rot->caps->rot_model, resp_sep);
tag = "min_az=";
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{
tag = "Minimum Azimuth: ";
@ -2389,33 +2390,37 @@ declare_proto_rot(dump_state)
fprintf(fout, "%s%lf%c", tag, rs->min_az + rot->state.az_offset, resp_sep);
tag = "max_az=";
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{
tag= "Maximum Azimuth: ";
tag = "Maximum Azimuth: ";
}
fprintf(fout, "%s%lf%c", tag, rs->max_az + rot->state.az_offset, resp_sep);
tag = "min_el=";
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{
tag= "Minimum Elevation: ";
tag = "Minimum Elevation: ";
}
fprintf(fout, "%s%lf%c", tag, rs->min_el + rot->state.el_offset, resp_sep);
tag = "max_el=";
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{
tag= "Maximum Elevation: ";
tag = "Maximum Elevation: ";
}
fprintf(fout, "%s%lf%c", tag, rs->max_el + rot->state.el_offset, resp_sep);
tag = "south_zero=";
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{
tag= "South Zero: ";
tag = "South Zero: ";
}
fprintf(fout, "%s%d%c", tag, rs->south_zero, resp_sep);