kopia lustrzana https://github.com/Hamlib/Hamlib
Fix cppcheck warnings and fill out unused RIG_LEVEL items
rodzic
0b3605597f
commit
f8321a36f4
|
@ -23,11 +23,17 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// cppcheck-suppress *
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
// cppcheck-suppress *
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
// cppcheck-suppress *
|
||||||
#include <string.h> /* String function definitions */
|
#include <string.h> /* String function definitions */
|
||||||
|
// cppcheck-suppress *
|
||||||
#include <unistd.h> /* UNIX standard function definitions */
|
#include <unistd.h> /* UNIX standard function definitions */
|
||||||
|
// cppcheck-suppress *
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
// cppcheck-suppress *
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "hamlib/rig.h"
|
#include "hamlib/rig.h"
|
||||||
|
@ -991,6 +997,7 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
uint64_t level1, level2;
|
||||||
/* make S-Meter jiggle */
|
/* make S-Meter jiggle */
|
||||||
int qrm = -56;
|
int qrm = -56;
|
||||||
|
|
||||||
|
@ -1007,9 +1014,12 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
qrm = -50;
|
qrm = -50;
|
||||||
}
|
}
|
||||||
|
|
||||||
curr->levels[idx].i = qrm + time(NULL) % 32 + rand() % 4
|
// cppcheck-suppress *
|
||||||
- curr->levels[LVL_ATT].i
|
level1 = LVL_ATT;
|
||||||
+ curr->levels[LVL_PREAMP].i;
|
// cppcheck-suppress *
|
||||||
|
level2 = LVL_PREAMP;
|
||||||
|
curr->levels[idx].i = qrm + (time(NULL) % 32) + (rand() % 4)
|
||||||
|
- curr->levels[level1].i + curr->levels[level2].i;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -867,6 +867,31 @@ enum rig_level_e {
|
||||||
RIG_LEVEL_NOTCHF_RAW = CONSTANT_64BIT_FLAG(36), /*!< \c NOTCHF_RAW -- Notch Freq., arg float [0.0 ... 1.0] */
|
RIG_LEVEL_NOTCHF_RAW = CONSTANT_64BIT_FLAG(36), /*!< \c NOTCHF_RAW -- Notch Freq., arg float [0.0 ... 1.0] */
|
||||||
RIG_LEVEL_MONITOR_GAIN = CONSTANT_64BIT_FLAG(37), /*!< \c MONITOR_GAIN -- Monitor gain (level for monitoring of transmitted audio), arg float [0.0 ... 1.0] */
|
RIG_LEVEL_MONITOR_GAIN = CONSTANT_64BIT_FLAG(37), /*!< \c MONITOR_GAIN -- Monitor gain (level for monitoring of transmitted audio), arg float [0.0 ... 1.0] */
|
||||||
RIG_LEVEL_NB = CONSTANT_64BIT_FLAG(38), /*!< \c NB -- Noise Blanker level, arg float [0.0 ... 1.0] */
|
RIG_LEVEL_NB = CONSTANT_64BIT_FLAG(38), /*!< \c NB -- Noise Blanker level, arg float [0.0 ... 1.0] */
|
||||||
|
RIG_LEVEL_39 = CONSTANT_64BIT_FLAG(39), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_40 = CONSTANT_64BIT_FLAG(40), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_41 = CONSTANT_64BIT_FLAG(41), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_42 = CONSTANT_64BIT_FLAG(42), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_43 = CONSTANT_64BIT_FLAG(43), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_44 = CONSTANT_64BIT_FLAG(44), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_45 = CONSTANT_64BIT_FLAG(45), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_46 = CONSTANT_64BIT_FLAG(46), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_47 = CONSTANT_64BIT_FLAG(47), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_48 = CONSTANT_64BIT_FLAG(48), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_49 = CONSTANT_64BIT_FLAG(49), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_50 = CONSTANT_64BIT_FLAG(50), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_51 = CONSTANT_64BIT_FLAG(51), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_52 = CONSTANT_64BIT_FLAG(52), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_53 = CONSTANT_64BIT_FLAG(53), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_54 = CONSTANT_64BIT_FLAG(54), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_55 = CONSTANT_64BIT_FLAG(55), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_56 = CONSTANT_64BIT_FLAG(56), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_57 = CONSTANT_64BIT_FLAG(57), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_58 = CONSTANT_64BIT_FLAG(58), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_59 = CONSTANT_64BIT_FLAG(59), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_60 = CONSTANT_64BIT_FLAG(60), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_61 = CONSTANT_64BIT_FLAG(61), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_62 = CONSTANT_64BIT_FLAG(62), /*!< \c Future use */
|
||||||
|
RIG_LEVEL_63 = CONSTANT_64BIT_FLAG(63), /*!< \c Future use */
|
||||||
};
|
};
|
||||||
|
|
||||||
//! @cond Doxygen_Suppress
|
//! @cond Doxygen_Suppress
|
||||||
|
|
|
@ -37,9 +37,9 @@
|
||||||
* Of course, it can't work with setting2idx_builtin(RIG_LEVEL_XX|RIG_LEVEL_YY)
|
* Of course, it can't work with setting2idx_builtin(RIG_LEVEL_XX|RIG_LEVEL_YY)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Note that 1<<0 is satisfied by the last clause here == 0
|
// This is future-proofed for 64 levels
|
||||||
// This is future-proofed for 63 levels
|
|
||||||
#define setting2idx_builtin(s) (( \
|
#define setting2idx_builtin(s) (( \
|
||||||
|
(s)==(1ull<<0)?0: \
|
||||||
(s)==(1ull<<1)?1: \
|
(s)==(1ull<<1)?1: \
|
||||||
(s)==(1ull<<2)?2: \
|
(s)==(1ull<<2)?2: \
|
||||||
(s)==(1ull<<3)?3: \
|
(s)==(1ull<<3)?3: \
|
||||||
|
@ -75,83 +75,114 @@
|
||||||
(s)==(1ull<<33)?33: \
|
(s)==(1ull<<33)?33: \
|
||||||
(s)==(1ull<<34)?34: \
|
(s)==(1ull<<34)?34: \
|
||||||
(s)==(1ull<<35)?35: \
|
(s)==(1ull<<35)?35: \
|
||||||
(s)==(1ull<<35)?36: \
|
(s)==(1ull<<36)?36: \
|
||||||
(s)==(1ull<<35)?37: \
|
(s)==(1ull<<37)?37: \
|
||||||
(s)==(1ull<<35)?38: \
|
(s)==(1ull<<38)?38: \
|
||||||
(s)==(1ull<<35)?39: \
|
(s)==(1ull<<39)?39: \
|
||||||
(s)==(1ull<<40)?40: \
|
(s)==(1ull<<40)?40: \
|
||||||
(s)==(1ull<<41)?41: \
|
(s)==(1ull<<41)?41: \
|
||||||
(s)==(1ull<<42)?42: \
|
(s)==(1ull<<42)?42: \
|
||||||
(s)==(1ull<<43)?43: \
|
(s)==(1ull<<43)?43: \
|
||||||
(s)==(1ull<<44)?44: \
|
(s)==(1ull<<44)?44: \
|
||||||
(s)==(1ull<<45)?45: \
|
(s)==(1ull<<45)?45: \
|
||||||
(s)==(1ull<<45)?46: \
|
(s)==(1ull<<46)?46: \
|
||||||
(s)==(1ull<<45)?47: \
|
(s)==(1ull<<47)?47: \
|
||||||
(s)==(1ull<<45)?48: \
|
(s)==(1ull<<48)?48: \
|
||||||
(s)==(1ull<<45)?49: \
|
(s)==(1ull<<49)?49: \
|
||||||
(s)==(1ull<<50)?50: \
|
(s)==(1ull<<50)?50: \
|
||||||
(s)==(1ull<<51)?51: \
|
(s)==(1ull<<51)?51: \
|
||||||
(s)==(1ull<<52)?52: \
|
(s)==(1ull<<52)?52: \
|
||||||
(s)==(1ull<<53)?53: \
|
(s)==(1ull<<53)?53: \
|
||||||
(s)==(1ull<<54)?54: \
|
(s)==(1ull<<54)?54: \
|
||||||
(s)==(1ull<<55)?55: \
|
(s)==(1ull<<55)?55: \
|
||||||
(s)==(1ull<<55)?56: \
|
(s)==(1ull<<56)?56: \
|
||||||
(s)==(1ull<<55)?57: \
|
(s)==(1ull<<57)?57: \
|
||||||
(s)==(1ull<<55)?58: \
|
(s)==(1ull<<58)?58: \
|
||||||
(s)==(1ull<<55)?59: \
|
(s)==(1ull<<59)?59: \
|
||||||
(s)==(1ull<<60)?60: \
|
(s)==(1ull<<60)?60: \
|
||||||
(s)==(1ull<<61)?61: \
|
(s)==(1ull<<61)?61: \
|
||||||
(s)==(1ull<<62)?62: \
|
(s)==(1ull<<62)?62: \
|
||||||
(s)==(1ull<<63)?63: \
|
(s)==(1ull<<63)?63: \
|
||||||
0) \
|
-1) \
|
||||||
)
|
)
|
||||||
|
|
||||||
#define LVL_PREAMP setting2idx_builtin(RIG_LEVEL_PREAMP)
|
#define LVL_PREAMP setting2idx_builtin(RIG_LEVEL_PREAMP)
|
||||||
#define LVL_ATT setting2idx_builtin(RIG_LEVEL_ATT)
|
#define LVL_ATT setting2idx_builtin(RIG_LEVEL_ATT)
|
||||||
#define LVL_VOXDELAY setting2idx_builtin(RIG_LEVEL_VOXDELAY)
|
#define LVL_VOXDELAY setting2idx_builtin(RIG_LEVEL_VOXDELAY)
|
||||||
#define LVL_AF setting2idx_builtin(RIG_LEVEL_AF)
|
#define LVL_AF setting2idx_builtin(RIG_LEVEL_AF)
|
||||||
#define LVL_RF setting2idx_builtin(RIG_LEVEL_RF)
|
#define LVL_RF setting2idx_builtin(RIG_LEVEL_RF)
|
||||||
#define LVL_SQL setting2idx_builtin(RIG_LEVEL_SQL)
|
#define LVL_SQL setting2idx_builtin(RIG_LEVEL_SQL)
|
||||||
#define LVL_IF setting2idx_builtin(RIG_LEVEL_IF)
|
#define LVL_IF setting2idx_builtin(RIG_LEVEL_IF)
|
||||||
#define LVL_APF setting2idx_builtin(RIG_LEVEL_APF)
|
#define LVL_APF setting2idx_builtin(RIG_LEVEL_APF)
|
||||||
#define LVL_NR setting2idx_builtin(RIG_LEVEL_NR)
|
#define LVL_NR setting2idx_builtin(RIG_LEVEL_NR)
|
||||||
#define LVL_PBT_IN setting2idx_builtin(RIG_LEVEL_PBT_IN)
|
#define LVL_PBT_IN setting2idx_builtin(RIG_LEVEL_PBT_IN)
|
||||||
#define LVL_PBT_OUT setting2idx_builtin(RIG_LEVEL_PBT_OUT)
|
#define LVL_PBT_OUT setting2idx_builtin(RIG_LEVEL_PBT_OUT)
|
||||||
#define LVL_CWPITCH setting2idx_builtin(RIG_LEVEL_CWPITCH)
|
#define LVL_CWPITCH setting2idx_builtin(RIG_LEVEL_CWPITCH)
|
||||||
#define LVL_RFPOWER setting2idx_builtin(RIG_LEVEL_RFPOWER)
|
#define LVL_RFPOWER setting2idx_builtin(RIG_LEVEL_RFPOWER)
|
||||||
#define LVL_MICGAIN setting2idx_builtin(RIG_LEVEL_MICGAIN)
|
#define LVL_MICGAIN setting2idx_builtin(RIG_LEVEL_MICGAIN)
|
||||||
#define LVL_KEYSPD setting2idx_builtin(RIG_LEVEL_KEYSPD)
|
#define LVL_KEYSPD setting2idx_builtin(RIG_LEVEL_KEYSPD)
|
||||||
#define LVL_NOTCHF setting2idx_builtin(RIG_LEVEL_NOTCHF)
|
#define LVL_NOTCHF setting2idx_builtin(RIG_LEVEL_NOTCHF)
|
||||||
#define LVL_COMP setting2idx_builtin(RIG_LEVEL_COMP)
|
#define LVL_COMP setting2idx_builtin(RIG_LEVEL_COMP)
|
||||||
#define LVL_AGC setting2idx_builtin(RIG_LEVEL_AGC)
|
#define LVL_AGC setting2idx_builtin(RIG_LEVEL_AGC)
|
||||||
#define LVL_BKINDL setting2idx_builtin(RIG_LEVEL_BKINDL)
|
#define LVL_BKINDL setting2idx_builtin(RIG_LEVEL_BKINDL)
|
||||||
#define LVL_BALANCE setting2idx_builtin(RIG_LEVEL_BALANCE)
|
#define LVL_BALANCE setting2idx_builtin(RIG_LEVEL_BALANCE)
|
||||||
#define LVL_METER setting2idx_builtin(RIG_LEVEL_METER)
|
#define LVL_METER setting2idx_builtin(RIG_LEVEL_METER)
|
||||||
#define LVL_VOXGAIN setting2idx_builtin(RIG_LEVEL_VOXGAIN)
|
#define LVL_VOXGAIN setting2idx_builtin(RIG_LEVEL_VOXGAIN)
|
||||||
#define LVL_ANTIVOX setting2idx_builtin(RIG_LEVEL_ANTIVOX)
|
#define LVL_ANTIVOX setting2idx_builtin(RIG_LEVEL_ANTIVOX)
|
||||||
|
#define LVL_SLOPE_LOW setting2idx_builtin(RIG_LEVEL_SLOPE_LOW)
|
||||||
|
#define LVL_SLOPE_HIGH setting2idx_builtin(RIG_LEVEL_SLOPE_HIGH)
|
||||||
|
#define LVL_BKIN_DLYMS setting2idx_builtin(RIG_LEVEL_BKIN_DLYMS)
|
||||||
|
|
||||||
#define LVL_RAWSTR setting2idx_builtin(RIG_LEVEL_RAWSTR)
|
#define LVL_RAWSTR setting2idx_builtin(RIG_LEVEL_RAWSTR)
|
||||||
#define LVL_SQLSTAT setting2idx_builtin(RIG_LEVEL_SQLSTAT)
|
#define LVL_SQLSTAT setting2idx_builtin(RIG_LEVEL_SQLSTAT)
|
||||||
#define LVL_SWR setting2idx_builtin(RIG_LEVEL_SWR)
|
#define LVL_SWR setting2idx_builtin(RIG_LEVEL_SWR)
|
||||||
#define LVL_ALC setting2idx_builtin(RIG_LEVEL_ALC)
|
#define LVL_ALC setting2idx_builtin(RIG_LEVEL_ALC)
|
||||||
#define LVL_STRENGTH setting2idx_builtin(RIG_LEVEL_STRENGTH)
|
#define LVL_STRENGTH setting2idx_builtin(RIG_LEVEL_STRENGTH)
|
||||||
/*#define LVL_BWC setting2idx_builtin(RIG_LEVEL_BWC)*/
|
/*#define LVL_BWC setting2idx_builtin(RIG_LEVEL_BWC)*/
|
||||||
|
|
||||||
#define LVL_RFPOWER_METER setting2idx_builtin(RIG_LEVEL_RFPOWER_METER)
|
#define LVL_RFPOWER_METER setting2idx_builtin(RIG_LEVEL_RFPOWER_METER)
|
||||||
#define LVL_COMP_METER setting2idx_builtin(RIG_LEVEL_COMP_METER)
|
#define LVL_COMP_METER setting2idx_builtin(RIG_LEVEL_COMP_METER)
|
||||||
#define LVL_VD_METER setting2idx_builtin(RIG_LEVEL_VD_METER)
|
#define LVL_VD_METER setting2idx_builtin(RIG_LEVEL_VD_METER)
|
||||||
#define LVL_ID_METER setting2idx_builtin(RIG_LEVEL_ID_METER)
|
#define LVL_ID_METER setting2idx_builtin(RIG_LEVEL_ID_METER)
|
||||||
|
|
||||||
#define LVL_NOTCHF_RAW setting2idx_builtin(RIG_LEVEL_NOTCHF_RAW)
|
#define LVL_NOTCHF_RAW setting2idx_builtin(RIG_LEVEL_NOTCHF_RAW)
|
||||||
#define LVL_MONITOR_GAIN setting2idx_builtin(RIG_LEVEL_MONITOR_GAIN)
|
#define LVL_MONITOR_GAIN setting2idx_builtin(RIG_LEVEL_MONITOR_GAIN)
|
||||||
|
|
||||||
#define PARM_ANN setting2idx_builtin(RIG_PARM_ANN)
|
#define LVL_NB setting2idx_builtin(RIG_LEVEL_NB)
|
||||||
#define PARM_APO setting2idx_builtin(RIG_PARM_APO)
|
|
||||||
#define PARM_BACKLIGHT setting2idx_builtin(RIG_PARM_BACKLIGHT)
|
#define LVL_39 setting2idx_builtin(RIG_LEVEL_41)
|
||||||
#define PARM_BEEP setting2idx_builtin(RIG_PARM_BEEP)
|
#define LVL_40 setting2idx_builtin(RIG_LEVEL_40)
|
||||||
#define PARM_TIME setting2idx_builtin(RIG_PARM_TIME)
|
#define LVL_41 setting2idx_builtin(RIG_LEVEL_41)
|
||||||
#define PARM_BAT setting2idx_builtin(RIG_PARM_BAT)
|
#define LVL_42 setting2idx_builtin(RIG_LEVEL_42)
|
||||||
#define PARM_KEYLIGHT setting2idx_builtin(RIG_PARM_KEYLIGHT)
|
#define LVL_43 setting2idx_builtin(RIG_LEVEL_43)
|
||||||
|
#define LVL_44 setting2idx_builtin(RIG_LEVEL_44)
|
||||||
|
#define LVL_45 setting2idx_builtin(RIG_LEVEL_45)
|
||||||
|
#define LVL_46 setting2idx_builtin(RIG_LEVEL_46)
|
||||||
|
#define LVL_47 setting2idx_builtin(RIG_LEVEL_47)
|
||||||
|
#define LVL_48 setting2idx_builtin(RIG_LEVEL_48)
|
||||||
|
#define LVL_49 setting2idx_builtin(RIG_LEVEL_49)
|
||||||
|
#define LVL_50 setting2idx_builtin(RIG_LEVEL_50)
|
||||||
|
#define LVL_51 setting2idx_builtin(RIG_LEVEL_51)
|
||||||
|
#define LVL_52 setting2idx_builtin(RIG_LEVEL_52)
|
||||||
|
#define LVL_53 setting2idx_builtin(RIG_LEVEL_53)
|
||||||
|
#define LVL_54 setting2idx_builtin(RIG_LEVEL_54)
|
||||||
|
#define LVL_55 setting2idx_builtin(RIG_LEVEL_55)
|
||||||
|
#define LVL_56 setting2idx_builtin(RIG_LEVEL_56)
|
||||||
|
#define LVL_57 setting2idx_builtin(RIG_LEVEL_57)
|
||||||
|
#define LVL_58 setting2idx_builtin(RIG_LEVEL_58)
|
||||||
|
#define LVL_59 setting2idx_builtin(RIG_LEVEL_59)
|
||||||
|
#define LVL_60 setting2idx_builtin(RIG_LEVEL_60)
|
||||||
|
#define LVL_61 setting2idx_builtin(RIG_LEVEL_61)
|
||||||
|
#define LVL_62 setting2idx_builtin(RIG_LEVEL_62)
|
||||||
|
#define LVL_63 setting2idx_builtin(RIG_LEVEL_63)
|
||||||
|
|
||||||
|
#define PARM_ANN setting2idx_builtin(RIG_PARM_ANN)
|
||||||
|
#define PARM_APO setting2idx_builtin(RIG_PARM_APO)
|
||||||
|
#define PARM_BACKLIGHT setting2idx_builtin(RIG_PARM_BACKLIGHT)
|
||||||
|
#define PARM_BEEP setting2idx_builtin(RIG_PARM_BEEP)
|
||||||
|
#define PARM_TIME setting2idx_builtin(RIG_PARM_TIME)
|
||||||
|
#define PARM_BAT setting2idx_builtin(RIG_PARM_BAT)
|
||||||
|
#define PARM_KEYLIGHT setting2idx_builtin(RIG_PARM_KEYLIGHT)
|
||||||
|
|
||||||
|
|
||||||
#endif /* _IDX_BUILTIN_H */
|
#endif /* _IDX_BUILTIN_H */
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "iofunc.h"
|
#include "iofunc.h"
|
||||||
|
|
||||||
#ifdef HAVE_LINUX_PARPORT_H
|
#ifdef HAVE_LINUX_PARPORT_H
|
||||||
|
// cppcheck-suppress *
|
||||||
# include <linux/parport.h>
|
# include <linux/parport.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -735,6 +735,7 @@ static int handle_ts2000(void *arg)
|
||||||
int p15 = 0; // P15 Shift status dummy value for now
|
int p15 = 0; // P15 Shift status dummy value for now
|
||||||
int retval = rig_get_freq(my_rig, RIG_VFO_A, &freq);
|
int retval = rig_get_freq(my_rig, RIG_VFO_A, &freq);
|
||||||
char response[64];
|
char response[64];
|
||||||
|
// cppcheck-suppress *
|
||||||
char *fmt = "IF%011"PRIll"%04d+%05d%1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;";
|
char *fmt = "IF%011"PRIll"%04d+%05d%1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;";
|
||||||
|
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
|
|
Ładowanie…
Reference in New Issue