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"
|
||||
#endif
|
||||
|
||||
// cppcheck-suppress *
|
||||
#include <stdio.h>
|
||||
// cppcheck-suppress *
|
||||
#include <stdlib.h>
|
||||
// cppcheck-suppress *
|
||||
#include <string.h> /* String function definitions */
|
||||
// cppcheck-suppress *
|
||||
#include <unistd.h> /* UNIX standard function definitions */
|
||||
// cppcheck-suppress *
|
||||
#include <math.h>
|
||||
// cppcheck-suppress *
|
||||
#include <time.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
|
||||
{
|
||||
uint64_t level1, level2;
|
||||
/* make S-Meter jiggle */
|
||||
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;
|
||||
}
|
||||
|
||||
curr->levels[idx].i = qrm + time(NULL) % 32 + rand() % 4
|
||||
- curr->levels[LVL_ATT].i
|
||||
+ curr->levels[LVL_PREAMP].i;
|
||||
// cppcheck-suppress *
|
||||
level1 = LVL_ATT;
|
||||
// cppcheck-suppress *
|
||||
level2 = LVL_PREAMP;
|
||||
curr->levels[idx].i = qrm + (time(NULL) % 32) + (rand() % 4)
|
||||
- curr->levels[level1].i + curr->levels[level2].i;
|
||||
}
|
||||
|
||||
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_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_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
|
||||
|
|
|
@ -37,9 +37,9 @@
|
|||
* 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 63 levels
|
||||
// This is future-proofed for 64 levels
|
||||
#define setting2idx_builtin(s) (( \
|
||||
(s)==(1ull<<0)?0: \
|
||||
(s)==(1ull<<1)?1: \
|
||||
(s)==(1ull<<2)?2: \
|
||||
(s)==(1ull<<3)?3: \
|
||||
|
@ -75,35 +75,35 @@
|
|||
(s)==(1ull<<33)?33: \
|
||||
(s)==(1ull<<34)?34: \
|
||||
(s)==(1ull<<35)?35: \
|
||||
(s)==(1ull<<35)?36: \
|
||||
(s)==(1ull<<35)?37: \
|
||||
(s)==(1ull<<35)?38: \
|
||||
(s)==(1ull<<35)?39: \
|
||||
(s)==(1ull<<36)?36: \
|
||||
(s)==(1ull<<37)?37: \
|
||||
(s)==(1ull<<38)?38: \
|
||||
(s)==(1ull<<39)?39: \
|
||||
(s)==(1ull<<40)?40: \
|
||||
(s)==(1ull<<41)?41: \
|
||||
(s)==(1ull<<42)?42: \
|
||||
(s)==(1ull<<43)?43: \
|
||||
(s)==(1ull<<44)?44: \
|
||||
(s)==(1ull<<45)?45: \
|
||||
(s)==(1ull<<45)?46: \
|
||||
(s)==(1ull<<45)?47: \
|
||||
(s)==(1ull<<45)?48: \
|
||||
(s)==(1ull<<45)?49: \
|
||||
(s)==(1ull<<46)?46: \
|
||||
(s)==(1ull<<47)?47: \
|
||||
(s)==(1ull<<48)?48: \
|
||||
(s)==(1ull<<49)?49: \
|
||||
(s)==(1ull<<50)?50: \
|
||||
(s)==(1ull<<51)?51: \
|
||||
(s)==(1ull<<52)?52: \
|
||||
(s)==(1ull<<53)?53: \
|
||||
(s)==(1ull<<54)?54: \
|
||||
(s)==(1ull<<55)?55: \
|
||||
(s)==(1ull<<55)?56: \
|
||||
(s)==(1ull<<55)?57: \
|
||||
(s)==(1ull<<55)?58: \
|
||||
(s)==(1ull<<55)?59: \
|
||||
(s)==(1ull<<56)?56: \
|
||||
(s)==(1ull<<57)?57: \
|
||||
(s)==(1ull<<58)?58: \
|
||||
(s)==(1ull<<59)?59: \
|
||||
(s)==(1ull<<60)?60: \
|
||||
(s)==(1ull<<61)?61: \
|
||||
(s)==(1ull<<62)?62: \
|
||||
(s)==(1ull<<63)?63: \
|
||||
0) \
|
||||
-1) \
|
||||
)
|
||||
|
||||
#define LVL_PREAMP setting2idx_builtin(RIG_LEVEL_PREAMP)
|
||||
|
@ -129,6 +129,9 @@
|
|||
#define LVL_METER setting2idx_builtin(RIG_LEVEL_METER)
|
||||
#define LVL_VOXGAIN setting2idx_builtin(RIG_LEVEL_VOXGAIN)
|
||||
#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_SQLSTAT setting2idx_builtin(RIG_LEVEL_SQLSTAT)
|
||||
|
@ -145,6 +148,34 @@
|
|||
#define LVL_NOTCHF_RAW setting2idx_builtin(RIG_LEVEL_NOTCHF_RAW)
|
||||
#define LVL_MONITOR_GAIN setting2idx_builtin(RIG_LEVEL_MONITOR_GAIN)
|
||||
|
||||
#define LVL_NB setting2idx_builtin(RIG_LEVEL_NB)
|
||||
|
||||
#define LVL_39 setting2idx_builtin(RIG_LEVEL_41)
|
||||
#define LVL_40 setting2idx_builtin(RIG_LEVEL_40)
|
||||
#define LVL_41 setting2idx_builtin(RIG_LEVEL_41)
|
||||
#define LVL_42 setting2idx_builtin(RIG_LEVEL_42)
|
||||
#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)
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "iofunc.h"
|
||||
|
||||
#ifdef HAVE_LINUX_PARPORT_H
|
||||
// cppcheck-suppress *
|
||||
# include <linux/parport.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -735,6 +735,7 @@ static int handle_ts2000(void *arg)
|
|||
int p15 = 0; // P15 Shift status dummy value for now
|
||||
int retval = rig_get_freq(my_rig, RIG_VFO_A, &freq);
|
||||
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;";
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
|
Ładowanie…
Reference in New Issue