Fix compile warnings for kenwood

pull/15/merge
Michael Black W9MDB 2018-04-16 10:38:09 -05:00 zatwierdzone przez Nate Bargmann
rodzic a1a860621b
commit dcb8b3f91f
7 zmienionych plików z 30 dodań i 30 usunięć

Wyświetl plik

@ -353,7 +353,7 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
int err;
char cmd_m[4];
char cmd_s[16];
char cmd_s[64];
switch (mode) {
case RIG_MODE_PKTLSB:
@ -402,7 +402,7 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width > pb_wid)
width = pb_wid;
sprintf(cmd_s, "BW%04ld", width / 10);
snprintf(cmd_s, sizeof(cmd_s), "BW%04ld", width / 10);
err = kenwood_transaction(rig, cmd_s, NULL, 0);
if (err != RIG_OK)
return err;
@ -605,7 +605,7 @@ int k3_set_split_mode(RIG * rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width)
int err;
char cmd_m[4];
char cmd_s[16];
char cmd_s[32];
switch (tx_mode)
{
@ -638,7 +638,7 @@ int k3_set_split_mode(RIG * rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width)
#endif
struct kenwood_priv_caps *caps = kenwood_caps(rig);
char buf[6];
char buf[32];
char kmode;
kmode = rmode2kenwood(tx_mode, caps->mode_table);
@ -678,7 +678,7 @@ int k3_set_split_mode(RIG * rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width)
else if (tx_width > pb_wid)
tx_width = pb_wid;
sprintf(cmd_s, "BW$%04ld", tx_width / 10);
snprintf(cmd_s, sizeof(cmd_s), "BW$%04ld", tx_width / 10);
err = kenwood_transaction(rig, cmd_s, NULL, 0);
if (err != RIG_OK)
return err;

Wyświetl plik

@ -2762,7 +2762,7 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
if (!rig || !msg)
return -RIG_EINVAL;
char morsebuf[30], m2[30];
char morsebuf[40], m2[30];
int msg_len, buff_len, retval, i;
const char *p;
@ -3069,7 +3069,7 @@ int kenwood_set_channel(RIG *rig, const channel_t *chan)
if (!rig || !chan)
return -RIG_EINVAL;
char buf[26];
char buf[128];
char mode, tx_mode = 0;
int err;
int tone = 0;

Wyświetl plik

@ -501,7 +501,7 @@ int pihspdr_set_channel(RIG *rig, const channel_t *chan)
if (!rig || !chan)
return -RIG_EINVAL;
char buf[55];
char buf[128];
char mode, tx_mode = 0;
int err;
int tone = 0;
@ -616,7 +616,7 @@ int pihspdr_set_channel(RIG *rig, const channel_t *chan)
return err;
if( chan->split == RIG_SPLIT_ON ){
sprintf(buf, "MW1%03d%011u%c%c%c%02d%02d%03d%c%c%09d0%c%c%s;\n",
snprintf(buf, sizeof(buf), "MW1%03d%011u%c%c%c%02d%02d%03d%c%c%09d0%c%c%s;\n",
chan->channel_num,
(unsigned) chan->tx_freq, /* 4 - frequency */
'0' + tx_mode, /* 5 - mode */

Wyświetl plik

@ -1563,7 +1563,7 @@ int th_get_channel(RIG *rig, channel_t *chan)
char membuf[64],ackbuf[ACKBUF_LEN];
int retval;
freq_t freq,offset;
char req[16],scf[128];
char req[32],scf[128];
int step, shift, rev, tone, ctcss, tonefq, ctcssfq, dcs, dcscode, mode, lockout;
const char *mr_extra;
int channel_num;
@ -1606,20 +1606,20 @@ int th_get_channel(RIG *rig, channel_t *chan)
case RIG_MTYPE_EDGE:
if (chan_caps[1].type == RIG_MTYPE_EDGE) {
sprintf(req, "MR %s0,L%01d",mr_extra,channel_num);
snprintf(req, sizeof(req), "MR %s0,L%01d",mr_extra,channel_num);
sprintf(chan->channel_desc, "L%01d",channel_num);
} else {
sprintf(req, "MR %s0,U%01d",mr_extra,channel_num);
snprintf(req, sizeof(req), "MR %s0,U%01d",mr_extra,channel_num);
sprintf(chan->channel_desc, "U%01d",channel_num);
}
break;
case RIG_MTYPE_PRIO:
if (chan_caps->start == chan_caps->end) {
sprintf(req, "MR %s0,PR",mr_extra);
snprintf(req, sizeof(req), "MR %s0,PR",mr_extra);
sprintf(chan->channel_desc, "Pr");
} else {
sprintf(req, "MR %s0,PR%01d",mr_extra,channel_num+1);
snprintf(req, sizeof(req), "MR %s0,PR%01d",mr_extra,channel_num+1);
sprintf(chan->channel_desc, "Pr%01d",channel_num+1);
}
break;
@ -1792,7 +1792,7 @@ static int find_tone_index(const tone_t *tone_list, tone_t tone)
/* --------------------------------------------------------------------- */
int th_set_channel(RIG *rig, const channel_t *chan)
{
char membuf[ACKBUF_LEN];
char membuf[150];
int retval;
char req[64];
char lockoutstr[8];
@ -1938,7 +1938,7 @@ int th_set_channel(RIG *rig, const channel_t *chan)
}
/* Step can be hexa */
retval = sprintf(membuf, "%s,%011"PRIll",%X,%d,%d,%d,%d,%d,%02d,%02d,%03d,%09"PRIll",%d%s",
retval = snprintf(membuf, sizeof(membuf), "%s,%011"PRIll",%X,%d,%d,%d,%d,%d,%02d,%02d,%03d,%09"PRIll",%d%s",
req, (int64_t)chan->freq, step, shift, rev, tone,
ctcss, dcs, tonefq, ctcssfq, dcscode,
(int64_t)labs((long)(chan->rptr_offs)), mode, lockoutstr

Wyświetl plik

@ -433,44 +433,44 @@ int tmv7_get_channel(RIG *rig, channel_t *chan)
char membuf[64],ackbuf[ACKBUF_LEN];
int retval;
freq_t freq;
char req[16],scf[128];
char req[32],scf[128];
int step, shift, rev, tone, ctcss, tonefq, ctcssfq;
if(chan->channel_num<100)
sprintf(req,"MR 0,0,%03d",chan->channel_num);
snprintf(req, sizeof(req), "MR 0,0,%03d",chan->channel_num);
else
if(chan->channel_num<200)
sprintf(req,"MR 1,0,%03d",chan->channel_num-100);
snprintf(req, sizeof(req), "MR 1,0,%03d",chan->channel_num-100);
else
if(chan->channel_num<204) {
sprintf(req,"MR 0,0,L%01d",chan->channel_num-200);
snprintf(req, sizeof(req), "MR 0,0,L%01d",chan->channel_num-200);
sprintf(chan->channel_desc,"L%01d/V",chan->channel_num-200);
} else
if(chan->channel_num<211) {
sprintf(req,"MR 1,0,L%01d",chan->channel_num-203);
snprintf(req, sizeof(req), "MR 1,0,L%01d",chan->channel_num-203);
sprintf(chan->channel_desc,"L%01d/U",chan->channel_num-203);
} else
if(chan->channel_num<214) {
sprintf(req,"MR 0,0,U%01d",chan->channel_num-210);
snprintf(req, sizeof(req), "MR 0,0,U%01d",chan->channel_num-210);
sprintf(chan->channel_desc,"U%01d/V",chan->channel_num-210);
} else
if(chan->channel_num<220) {
sprintf(req,"MR 1,0,U%01d",chan->channel_num-213);
snprintf(req, sizeof(req), "MR 1,0,U%01d",chan->channel_num-213);
sprintf(chan->channel_desc,"U%01d/U",chan->channel_num-213);
} else
if(chan->channel_num<223) {
if(chan->channel_num==221) {
sprintf(req,"CR 0,0");
snprintf(req, sizeof(req), "CR 0,0");
sprintf(chan->channel_desc,"Call V");
}
if(chan->channel_num==222) {
sprintf(req,"CR 1,0");
snprintf(req, sizeof(req), "CR 1,0");
sprintf(chan->channel_desc,"Call U");
}
} else
return -RIG_EINVAL;
sprintf(membuf,"%s",req);
snprintf(membuf, sizeof(membuf), "%s",req);
retval = kenwood_transaction(rig, membuf, ackbuf, sizeof (ackbuf));
if (retval != RIG_OK)
return retval;

Wyświetl plik

@ -533,7 +533,7 @@ int ts2000_set_channel(RIG *rig, const channel_t *chan)
if (!rig || !chan)
return -RIG_EINVAL;
char buf[55];
char buf[128];
char mode, tx_mode = 0;
int err;
int tone = 0;
@ -625,7 +625,7 @@ int ts2000_set_channel(RIG *rig, const channel_t *chan)
}
/* P-number 2-3 4 5 6 7 8 9 101112 13 141516 */
sprintf(buf, "MW0%03d%011u%c%c%c%02d%02d%03d%c%c%09d0%c%c%s;",
snprintf(buf, sizeof(buf), "MW0%03d%011u%c%c%c%02d%02d%03d%c%c%09d0%c%c%s;",
chan->channel_num,
(unsigned) chan->freq, /* 4 - frequency */
'0' + mode, /* 5 - mode */

Wyświetl plik

@ -406,7 +406,7 @@ int xg3_get_freq(RIG * rig, vfo_t vfo, freq_t * freq)
char freqbuf[50];
int freqsize = sizeof(freqbuf);
char cmdbuf[4];
char cmdbuf[16];
int retval;
vfo_t tvfo;
@ -612,7 +612,7 @@ int xg3_set_parm(RIG *rig, setting_t parm, value_t val)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
int ival;
char cmdbuf[6];
char cmdbuf[16];
int retval=-RIG_EINVAL;
switch (parm)