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

@ -424,6 +424,7 @@ 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 needed for testing enable this to emulate a rig with 100hz resolution

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);
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:
retval = -RIG_ENIMPL;
}
return retval;
}

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,7 +374,8 @@ 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__,
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

@ -613,7 +613,8 @@ 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,

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;
@ -72,10 +73,12 @@ again:
printf("Turning power on due to 0xfe string\n");
powerstat = 1;
int j;
for (j = i; j < 175; ++j)
{
if (read(fd, &c, 1) < 0) break;
if (read(fd, &c, 1) < 0) { break; }
}
i = 0;
goto again;
}

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)

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)
{
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,
@ -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,6 +2390,7 @@ 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: ";
@ -2397,6 +2399,7 @@ declare_proto_rot(dump_state)
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: ";
@ -2405,6 +2408,7 @@ declare_proto_rot(dump_state)
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: ";
@ -2413,6 +2417,7 @@ declare_proto_rot(dump_state)
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: ";