more unsigned char->char and int->size_t transitions

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2094 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.6rc1
Joop Stakenborg, PG4I 2006-03-14 20:29:41 +00:00
rodzic c2df1f92a8
commit 199f72d3cc
4 zmienionych plików z 85 dodań i 64 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Kenwood backend - TS570 description
* Copyright (c) 2001-2005 by Stephane Fillod
*
* $Id: ts570.c,v 1.23 2005-04-03 20:14:26 fillods Exp $
* $Id: ts570.c,v 1.24 2006-03-14 20:29:41 pa4tu Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -64,8 +64,9 @@ static const struct kenwood_priv_caps ts570_priv_caps = {
static int ts570_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
unsigned char buf[50];
int buf_len, retval;
char buf[50];
size_t buf_len;
int retval;
buf_len = 50;
@ -145,8 +146,9 @@ static int ts570_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
static int ts570_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
unsigned char buf[16],ackbuf[16];
int buf_len, ack_len, kmode, retval;
char buf[16],ackbuf[16];
int buf_len, kmode, retval;
size_t ack_len;
switch (mode)
{
@ -169,6 +171,7 @@ static int ts570_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
retval = kenwood_transaction (rig, buf, buf_len, ackbuf, &ack_len);
if (retval != RIG_OK) return retval;
ack_len = 0;
switch (mode)
{
case RIG_MODE_CW:
@ -176,7 +179,6 @@ static int ts570_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
case RIG_MODE_RTTY:
case RIG_MODE_RTTYR:
buf_len = sprintf(buf, "FW%04d;", (int)width);
ack_len = 0;
retval = kenwood_transaction (rig, buf, buf_len, ackbuf, &ack_len);
if (retval != RIG_OK) return retval;
break;
@ -185,7 +187,6 @@ static int ts570_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
case RIG_MODE_FM:
case RIG_MODE_AM:
buf_len = sprintf(buf, "SL%02d;", (int)width/50);
ack_len = 0;
retval = kenwood_transaction (rig, buf, buf_len, ackbuf, &ack_len);
if (retval != RIG_OK) return retval;
break;
@ -202,11 +203,12 @@ static int ts570_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
*/
static int ts570_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
{
unsigned char buf[6], ackbuf[16];
int len, ack_len, retval;
char buf[6], ackbuf[16];
int len, retval;
size_t ack_len;
len = sprintf(buf,"AN%c;", ant==RIG_ANT_1?'1':'2');
ack_len = 0;
retval = kenwood_transaction(rig, buf, len, ackbuf, &ack_len);
return retval;
@ -219,10 +221,11 @@ static int ts570_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
*/
static int ts570_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
{
unsigned char infobuf[50];
int info_len, retval;
char infobuf[50];
int retval;
size_t info_len;
info_len = 5;
info_len = 50;
retval = kenwood_transaction (rig, "AN;", 3, infobuf, &info_len);
if (retval != RIG_OK)
return retval;

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Kenwood backend - TS680 description
* Copyright (c) 2000-2005 by Stephane Fillod
*
* $Id: ts680.c,v 1.5 2005-04-03 20:14:26 fillods Exp $
* $Id: ts680.c,v 1.6 2006-03-14 20:29:41 pa4tu Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -62,8 +62,9 @@ static const struct kenwood_priv_caps ts680_priv_caps = {
static int ts680_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
unsigned char modebuf[50];
int mode_len, retval;
char modebuf[50];
size_t mode_len;
int retval;
mode_len = 50;
retval = kenwood_transaction (rig, "IF;", 3, modebuf, &mode_len);
@ -97,9 +98,10 @@ static int ts680_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
static int ts680_set_vfo(RIG *rig, vfo_t vfo)
{
unsigned char cmdbuf[16], ackbuf[16];
int cmd_len, ack_len, retval;
char cmdbuf[16], ackbuf[16];
int cmd_len, retval;
char vfo_function;
size_t ack_len;
switch (vfo) {
case RIG_VFO_VFO:
@ -123,8 +125,9 @@ static int ts680_set_vfo(RIG *rig, vfo_t vfo)
static int ts680_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
unsigned char freqbuf[50];
int freq_len, retval;
char freqbuf[50];
size_t freq_len;
int retval;
long long f;
/* We're using IF; here because the TS-680S is incapable of supplying
@ -151,8 +154,10 @@ static int ts680_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
static int ts680_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
{
unsigned char fctbuf[16], ackbuf[16];
int fct_len, ack_len;
char fctbuf[16], ackbuf[16];
int fct_len;
size_t ack_len;
ack_len = 0;
switch (func) {
case RIG_FUNC_LOCK:

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Kenwood backend - TS850 description
* Copyright (c) 2000-2004 by Stephane Fillod
*
* $Id: ts850.c,v 1.19 2005-04-03 20:14:26 fillods Exp $
* $Id: ts850.c,v 1.20 2006-03-14 20:29:41 pa4tu Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -225,9 +225,10 @@ const struct rig_caps ts850_caps = {
int ts850_set_rit(RIG * rig, vfo_t vfo, shortfreq_t rit)
{
unsigned char buf[50], infobuf[50], c;
int retval, info_len, len, i;
char buf[50], infobuf[50];
unsigned char c;
int retval, len, i;
size_t info_len;
info_len = 0;
if (rit == 0)
@ -254,8 +255,10 @@ int ts850_set_rit(RIG * rig, vfo_t vfo, shortfreq_t rit)
int ts850_set_xit(RIG * rig, vfo_t vfo, shortfreq_t xit)
{
unsigned char buf[50], infobuf[50], c;
int retval, info_len, len, i;
char buf[50], infobuf[50];
unsigned char c;
int retval, len, i;
size_t info_len;
info_len = 0;
if (xit == 0)
@ -296,9 +299,9 @@ int ts850_set_xit(RIG * rig, vfo_t vfo, shortfreq_t xit)
int ts850_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
unsigned char infobuf[50];
int info_len, retval;
int f,f1,f2;
char infobuf[50];
size_t info_len;
int f,f1,f2,retval;
info_len = 50;
retval = kenwood_transaction (rig, "IF;", 3, infobuf, &info_len)
@ -386,8 +389,9 @@ static char mode_to_char(rmode_t mode)
int ts850_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
unsigned char mdbuf[16],ackbuf[16];
int mdbuf_len, ack_len, kmode, retval;
char mdbuf[16],ackbuf[16];
int mdbuf_len, kmode, retval;
size_t ack_len;
kmode=mode_to_char(mode);
if(kmode==RIG_MODE_NONE) {
@ -425,9 +429,9 @@ int ts850_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
int ts850_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
{
const struct rig_caps *caps;
unsigned char tonebuf[16], ackbuf[16];
int tone_len, ack_len;
int i;
char tonebuf[16], ackbuf[16];
int i, tone_len;
size_t ack_len;
caps = rig->caps;
@ -446,8 +450,9 @@ int ts850_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
int ts850_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
{
unsigned char fctbuf[16], ackbuf[16];
int fct_len, ack_len;
char fctbuf[16], ackbuf[16];
int fct_len;
size_t ack_len;
if (vfo != RIG_VFO_CURR)
return -RIG_EINVAL;
@ -473,8 +478,9 @@ int ts850_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
int ts850_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
{
unsigned char fctbuf[16], ackbuf[16];
int retval, fct_len, ack_len;
char fctbuf[16], ackbuf[50];
int retval, fct_len;
size_t ack_len;
if (vfo != RIG_VFO_CURR)
return -RIG_EINVAL;
@ -491,7 +497,7 @@ int ts850_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
return -RIG_EINVAL;
}
ack_len = 16;
ack_len = 50;
retval = kenwood_transaction (rig, fctbuf, fct_len, ackbuf, &ack_len);
if (retval != RIG_OK)
@ -504,8 +510,9 @@ int ts850_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
int ts850_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char lvlbuf[50];
int i, lvl_len, retval;
char lvlbuf[50];
int i, retval;
size_t lvl_len;
if(vfo!=RIG_VFO_CURR)
return -RIG_EINVAL;
@ -586,8 +593,9 @@ int ts850_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
int ts850_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
unsigned char lvlbuf[16], ackbuf[16];
int lvl_len, ack_len;
char lvlbuf[16], ackbuf[16];
int lvl_len;
size_t ack_len;
if(level != RIG_LEVEL_CWPITCH)
return -RIG_EINVAL;
@ -603,8 +611,9 @@ int ts850_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
int ts850_get_mem(RIG *rig, vfo_t vfo, int *ch)
{
unsigned char infobuf[50];
int info_len, retval;
char infobuf[50];
size_t info_len;
int retval;
info_len = 50;
retval = kenwood_transaction (rig, "IF;", 3, infobuf, &info_len)
@ -641,13 +650,14 @@ static rmode_t char_to_mode(char c)
int ts850_get_channel (RIG * rig, channel_t * chan)
{
unsigned char cmdbuf[16], membuf[30];
int retval, cmd_len,mem_len,num;
char cmdbuf[16], membuf[50];
int retval, cmd_len, num;
size_t mem_len;
num=chan->channel_num;
cmd_len = sprintf(cmdbuf, "MR0 %02d;", num);
mem_len = 25;
mem_len = 50;
retval = kenwood_transaction (rig, cmdbuf, cmd_len, membuf, &mem_len);
if (retval != RIG_OK)
return retval;
@ -669,7 +679,7 @@ int ts850_get_channel (RIG * rig, channel_t * chan)
chan->freq=atoi(&membuf[6]);
cmd_len = sprintf(cmdbuf, "MR1 %02d;", num);
mem_len = 25;
mem_len = 50;
retval = kenwood_transaction (rig, cmdbuf, cmd_len, membuf, &mem_len);
if (retval != RIG_OK)
return retval;
@ -692,8 +702,9 @@ int ts850_get_channel (RIG * rig, channel_t * chan)
int ts850_set_channel (RIG * rig, const channel_t * chan)
{
unsigned char cmdbuf[30], membuf[30];
int retval, cmd_len,mem_len;
char cmdbuf[30], membuf[30];
int retval, cmd_len;
size_t mem_len;
int num,freq,tx_freq,tone;
char mode,tx_mode,split,tones;

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Kenwood backend - TS870S description
* Copyright (c) 2000-2005 by Stephane Fillod
*
* $Id: ts870s.c,v 1.45 2005-04-03 20:17:21 fillods Exp $
* $Id: ts870s.c,v 1.46 2006-03-14 20:29:41 pa4tu Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -73,8 +73,9 @@ static const struct kenwood_priv_caps ts870s_priv_caps = {
NOTE: using byte 31 in 'IF' will also work. TODO: check other rigs */
static int ts870s_get_vfo(RIG *rig, vfo_t *vfo)
{
unsigned char vfobuf[50];
int vfo_len, retval;
char vfobuf[50];
size_t vfo_len;
int retval;
/* query RX VFO */
@ -104,9 +105,9 @@ static int ts870s_get_vfo(RIG *rig, vfo_t *vfo)
static int ts870s_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
unsigned char buf[50];
int buf_len, retval;
char buf[50];
size_t buf_len;
int retval;
buf_len = 50;
retval = kenwood_transaction (rig, "MD;", 3, buf, &buf_len);
@ -156,8 +157,9 @@ static int ts870s_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
static int ts870s_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
unsigned char buf[16],ackbuf[16];
int buf_len, ack_len, kmode, retval;
char buf[16],ackbuf[16];
int buf_len, kmode, retval;
size_t ack_len;
switch (mode)
{
@ -194,9 +196,9 @@ static int ts870s_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
static int ts870s_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
unsigned char lvlbuf[50];
int lvl_len, retval;
int lvl;
char lvlbuf[50];
size_t lvl_len;
int lvl, retval;
int i, ret, agclevel;
lvl_len = 50;