be freq_t and setting_t type agnostic

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1641 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.0
Stéphane Fillod, F8CFE 2004-01-15 22:43:59 +00:00
rodzic eb06897dab
commit 64d539acd9
8 zmienionych plików z 42 dodań i 35 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Dummy backend - main file
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: dummy.c,v 1.37 2003-12-08 08:37:05 fillods Exp $
* $Id: dummy.c,v 1.38 2004-01-15 22:43:59 fillods 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
@ -984,9 +984,16 @@ static int dummy_send_morse(RIG *rig, vfo_t vfo, const char *msg)
* Dummy rig capabilities.
*/
#if 0
#define DUMMY_FUNC 0x7fffffffffffffLL /* has it all */
#define DUMMY_LEVEL 0x7ffffffffffffffLL
#define DUMMY_PARM 0x7ffffffffffffffLL
#else
#define DUMMY_FUNC ((setting_t)-1) /* has it all */
#define DUMMY_LEVEL ((setting_t)-1)
#define DUMMY_PARM ((setting_t)-1)
#endif
#define DUMMY_VFO_OP 0x7ffffffL
#define DUMMY_SCAN 0x7ffffffL

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Kenwood backend - TH-G71 description
* Copyright (c) 2003 by Stephane Fillod
*
* $Id: thg71.c,v 1.9 2003-12-08 21:41:31 fillods Exp $
* $Id: thg71.c,v 1.10 2004-01-15 22:43:59 fillods 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
@ -216,7 +216,7 @@ int thg71_decode_event (RIG *rig)
freq_t freq, offset;
int step, shift, rev, tone, ctcss, tonefq, ctcssfq;
retval = sscanf(asyncbuf, "BUF 0,%lld,%d,%d,%d,%d,%d,,%d,,%d,%lld",
retval = sscanf(asyncbuf, "BUF 0,%"FREQFMT",%d,%d,%d,%d,%d,,%d,,%d,%"FREQFMT,
&freq, &step, &shift, &rev, &tone,
&ctcss, &tonefq, &ctcssfq, &offset);
if (retval != 11) {
@ -224,7 +224,7 @@ int thg71_decode_event (RIG *rig)
return -RIG_ERJCTED;
}
rig_debug(RIG_DEBUG_TRACE, "%s: Buffer (freq %lld Hz, mode %d)\n", __FUNCTION__, freq);
rig_debug(RIG_DEBUG_TRACE, "%s: Buffer (freq %"FREQFMT" Hz, mode %d)\n", __FUNCTION__, freq);
/* Callback execution */
if (rig->callbacks.vfo_event) {
@ -311,7 +311,7 @@ int thg71_get_mode (RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
char ackbuf[ACKBUF_LEN];
int retval,ack_len=ACKBUF_LEN;
int step;
long long freq;
freq_t freq;
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __FUNCTION__);
@ -328,7 +328,7 @@ int thg71_get_mode (RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
if (retval != RIG_OK)
return retval;
sscanf(ackbuf,"FQ %lld,%d",&freq,&step);
sscanf(ackbuf,"FQ %"FREQFMT",%d",&freq,&step);
if(freq <MHz(136) ) {
*mode=RIG_MODE_AM;
@ -425,7 +425,7 @@ int thg71_get_channel(RIG *rig, channel_t *chan)
int retval,ack_len;
long long freq,offset;
char req[16],scf[128];
int chn, step, shift, rev, tone, ctcss, tonefq, ctcssfq;
int step, shift, rev, tone, ctcss, tonefq, ctcssfq;
if(chan->channel_num<200)
sprintf(req,"MR 0,0,%03d",chan->channel_num);
@ -460,7 +460,7 @@ int thg71_get_channel(RIG *rig, channel_t *chan)
return retval;
strcpy(scf,req);
strcat(scf,",%lld,%d,%d,%d,%d,%d,,%d,,%d,%lld");
strcat(scf,",%"FREQFMT",%d,%d,%d,%d,%d,,%d,,%d,%"FREQFMT);
retval = sscanf(ackbuf, scf,
&freq, &step, &shift, &rev, &tone,
&ctcss, &tonefq, &ctcssfq, &offset);
@ -504,7 +504,7 @@ int thg71_get_channel(RIG *rig, channel_t *chan)
ack_len=ACKBUF_LEN;
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
if (retval == RIG_OK) {
strcat(req,",%lld,%d");
strcat(req,",%"FREQFMT",%d");
retval = sscanf(ackbuf, req, &freq, &step);
chan->tx_freq=freq;
}
@ -596,12 +596,12 @@ int thg71_set_channel(RIG *rig, const channel_t *chan)
if(chan->channel_num<=220)
sprintf(membuf, "%s,%011lld,%01d,%01d,0,%01d,%01d,,%02d,,%02d,%09lld,0"EOM,
req,freq, step, shift, tone,
ctcss, tonefq, ctcssfq, offset);
req,(long long)freq, step, shift, tone,
ctcss, tonefq, ctcssfq, (long long)offset);
else
sprintf(membuf, "%s,%011lld,%01d,%01d,0,%01d,%01d,,%02d,,%02d,%09lld"EOM,
req, freq, step, shift, tone,
ctcss, tonefq, ctcssfq, offset);
req, (long long)freq, step, shift, tone,
ctcss, tonefq, ctcssfq, (long long)offset);
ack_len=ACKBUF_LEN;
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
@ -610,7 +610,7 @@ int thg71_set_channel(RIG *rig, const channel_t *chan)
if(chan->channel_num<223 && chan->tx_freq!=RIG_FREQ_NONE) {
req[5]='1';
sprintf(membuf, "%s,%011lld,%01d"EOM, req,chan->tx_freq, step);
sprintf(membuf, "%s,%011lld,%01d"EOM, req,(long long)chan->tx_freq, step);
ack_len=ACKBUF_LEN;
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
if (retval != RIG_OK)

Wyświetl plik

@ -4,7 +4,7 @@
* This program exercises the backup and restore of a radio
* using Hamlib. CSV primitives
*
* $Id: memcsv.c,v 1.2 2003-12-08 08:46:11 fillods Exp $
* $Id: memcsv.c,v 1.3 2004-01-15 22:43:59 fillods Exp $
*
*
* This program is free software; you can redistribute it and/or
@ -325,7 +325,7 @@ void dump_csv_chan(const channel_cap_t *mem_caps, const channel_t *chan, FILE *f
fprintf(f,"%d;",(int)chan->xit);
}
if (mem_caps->funcs) {
fprintf(f,"%llx;",chan->funcs);
fprintf(f,"%llx;",(long long)chan->funcs);
}
if (mem_caps->ctcss_tone) {
fprintf(f,"%d;",chan->ctcss_tone);

Wyświetl plik

@ -2,7 +2,7 @@
* memload.c - Copyright (C) 2003 Thierry Leconte
*
*
* $Id: memload.c,v 1.1 2003-12-04 23:15:02 fillods Exp $
* $Id: memload.c,v 1.2 2004-01-15 22:43:59 fillods Exp $
*
*
* This program is free software; you can redistribute it and/or
@ -45,7 +45,6 @@ static int set_chan(RIG *rig, channel_t *chan ,xmlNodePtr node);
int xml_load (RIG *my_rig, const char *infilename)
{
#ifdef HAVE_XML2
int c,m=0;
xmlDocPtr Doc;
xmlNodePtr node;
@ -222,7 +221,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
if (rig->state.chan_list[i].mem_caps.funcs) {
prop=xmlGetProp(node, "funcs");
if(prop!=NULL)
sscanf(prop,"%llx",&chan->funcs);
sscanf(prop,"%lx",&chan->funcs);
}
if (rig->state.chan_list[i].mem_caps.ctcss_tone) {
prop=xmlGetProp(node, "ctcss_tone");

Wyświetl plik

@ -2,7 +2,7 @@
* memsave.c - Copyright (C) 2003 Thierry Leconte
*
*
* $Id: memsave.c,v 1.2 2003-12-05 22:08:17 f4dwv Exp $
* $Id: memsave.c,v 1.3 2004-01-15 22:43:59 fillods Exp $
*
*
* This program is free software; you can redistribute it and/or
@ -138,7 +138,7 @@ int dump_xml_chan(RIG *rig, xmlNodePtr root, int i, int chan_num)
xmlNewProp(node, "ant", attrbuf);
}
if (rig->state.chan_list[i].mem_caps.freq && chan.freq != RIG_FREQ_NONE) {
sprintf(attrbuf,"%lld",chan.freq);
sprintf(attrbuf,"%lld",(long long)chan.freq);
xmlNewProp(node, "freq", attrbuf);
}
if (rig->state.chan_list[i].mem_caps.mode && chan.mode != RIG_MODE_NONE) {
@ -149,7 +149,7 @@ int dump_xml_chan(RIG *rig, xmlNodePtr root, int i, int chan_num)
xmlNewProp(node, "width", attrbuf);
}
if (rig->state.chan_list[i].mem_caps.tx_freq && chan.tx_freq != RIG_FREQ_NONE) {
sprintf(attrbuf,"%lld",chan.tx_freq);
sprintf(attrbuf,"%lld",(long long)chan.tx_freq);
xmlNewProp(node, "tx_freq", attrbuf);
}
if (rig->state.chan_list[i].mem_caps.tx_mode && chan.tx_mode != RIG_MODE_NONE) {
@ -203,7 +203,7 @@ int dump_xml_chan(RIG *rig, xmlNodePtr root, int i, int chan_num)
xmlNewProp(node, "xit", attrbuf);
}
if (rig->state.chan_list[i].mem_caps.funcs) {
sprintf(attrbuf,"%llx",chan.funcs);
sprintf(attrbuf,"%llx",(long long)chan.funcs);
xmlNewProp(node, "funcs", attrbuf);
}
if (rig->state.chan_list[i].mem_caps.ctcss_tone && chan.ctcss_tone !=0) {

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Interface - sprintf toolbox
* Copyright (c) 2000-2003 by Stephane Fillod and Frank Singleton
*
* $Id: sprintflst.c,v 1.3 2003-12-08 08:42:11 fillods Exp $
* $Id: sprintflst.c,v 1.4 2004-01-15 22:43:59 fillods 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
@ -37,7 +37,8 @@
#include "sprintflst.h"
#include "misc.h"
#define DUMMY_ALL 0x7ffffffffffffffLL
/* #define DUMMY_ALL 0x7ffffffffffffffLL */
#define DUMMY_ALL ((setting_t)-1)
int sprintf_vfo(char *str, vfo_t vfo)
{

Wyświetl plik

@ -3,7 +3,7 @@
* Copyright (C) 2001 pab@users.sourceforge.net
* Derived from hamlib code (C) 2000-2003 Stephane Fillod.
*
* $Id: winradio.c,v 1.19 2003-09-07 14:07:48 fillods Exp $
* $Id: winradio.c,v 1.20 2004-01-15 22:43:59 fillods 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
@ -79,11 +79,11 @@ int wr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) {
case RIG_MODE_FM:
switch ( width ) {
case RIG_PASSBAND_NORMAL:
case kHz(17):
case kHz(15): m = RMD_FMN; break;
case (int)kHz(17):
case (int)kHz(15): m = RMD_FMN; break;
case kHz(6): m = RMD_FM6; break;
case kHz(50): m = RMD_FMM; break;
case (int)kHz(6): m = RMD_FM6; break;
case (int)kHz(50): m = RMD_FMM; break;
default: return -RIG_EINVAL;
}
default: return -RIG_EINVAL;

Wyświetl plik

@ -7,7 +7,7 @@
* The starting point for this code was Frank's ft847 implementation.
*
*
* $Id: ft100.c,v 1.12 2003-12-22 17:56:46 fillods Exp $
* $Id: ft100.c,v 1.13 2004-01-15 22:43:59 fillods Exp $
*
*
* This library is free software; you can redistribute it and/or
@ -399,7 +399,7 @@ int ft100_set_freq(RIG *rig, vfo_t vfo, freq_t freq) {
rig_s = &rig->state;
rig_debug(RIG_DEBUG_VERBOSE,"ft100: requested freq = %lli Hz \n", freq);
rig_debug(RIG_DEBUG_VERBOSE,"ft100: requested freq = %"FREQFMT" Hz \n", freq);
rig_debug(RIG_DEBUG_VERBOSE,"ft100: vfo =%i \n", vfo);
if( ( vfo != RIG_VFO_CURR ) &&
@ -423,7 +423,7 @@ int ft100_set_freq(RIG *rig, vfo_t vfo, freq_t freq) {
to_bcd(p->p_cmd,freq,8); /* store bcd format in in p_cmd */
/* TODO -- fix 10Hz resolution -- FS */
rig_debug(RIG_DEBUG_VERBOSE,"ft100: requested freq after conversion = %lli Hz \n", from_bcd_be(p->p_cmd,8)* 10 );
rig_debug(RIG_DEBUG_VERBOSE,"ft100: requested freq after conversion = %"FREQFMT" Hz \n", from_bcd_be(p->p_cmd,8)* 10 );
cmd = p->p_cmd; /* get native sequence */
write_block(&rig_s->rigport, cmd, YAESU_CMD_LENGTH);
@ -465,9 +465,9 @@ int ft100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) {
d1=strtol(freq_str,NULL,16);
d2=(d1*1.25); /* fixed 10Hz bug by OH2MMY */
rig_debug(RIG_DEBUG_VERBOSE,"ft100: d1=%lld d2=%lld\n",d1,d2);
rig_debug(RIG_DEBUG_VERBOSE,"ft100: d1=%"FREQFMT" d2=%"FREQFMT"\n",d1,d2);
sprintf(sfreq,"%8lli",d2);
sprintf(sfreq,"%8lli",(long long)d2);
rig_debug(RIG_DEBUG_VERBOSE,"ft100: get_freq= %s \n",sfreq);