kopia lustrzana https://github.com/Hamlib/Hamlib
A few more cppcheck messages silenced
rodzic
e172d34381
commit
72bc62366d
|
@ -46,7 +46,7 @@
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "anytone.h"
|
#include "anytone.h"
|
||||||
int anytone_transaction(RIG *rig, unsigned char *cmd, int cmd_len,
|
static int anytone_transaction(RIG *rig, unsigned char *cmd, int cmd_len,
|
||||||
unsigned char *reply, int reply_len, int expected_len);
|
unsigned char *reply, int reply_len, int expected_len);
|
||||||
|
|
||||||
DECLARE_INITRIG_BACKEND(anytone)
|
DECLARE_INITRIG_BACKEND(anytone)
|
||||||
|
@ -94,7 +94,7 @@ DECLARE_PROBERIG_BACKEND(anytone)
|
||||||
|
|
||||||
// AnyTone needs a keep-alive to emulate the MIC
|
// AnyTone needs a keep-alive to emulate the MIC
|
||||||
// Apparently to keep the rig from getting stuck in PTT if mic disconnects
|
// Apparently to keep the rig from getting stuck in PTT if mic disconnects
|
||||||
void *anytone_thread(void *vrig)
|
static void *anytone_thread(void *vrig)
|
||||||
{
|
{
|
||||||
RIG *rig = (RIG *)vrig;
|
RIG *rig = (RIG *)vrig;
|
||||||
hamlib_port_t *rp = RIGPORT(rig);
|
hamlib_port_t *rp = RIGPORT(rig);
|
||||||
|
@ -135,7 +135,7 @@ void *anytone_thread(void *vrig)
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// anytone_send
|
// anytone_send
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
int anytone_send(RIG *rig,
|
static int anytone_send(RIG *rig,
|
||||||
unsigned char *cmd, int cmd_len)
|
unsigned char *cmd, int cmd_len)
|
||||||
{
|
{
|
||||||
int retval = RIG_OK;
|
int retval = RIG_OK;
|
||||||
|
@ -154,7 +154,7 @@ int anytone_send(RIG *rig,
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// anytone_receive
|
// anytone_receive
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
int anytone_receive(RIG *rig, unsigned char *buf, int buf_len, int expected)
|
static int anytone_receive(RIG *rig, unsigned char *buf, int buf_len, int expected)
|
||||||
{
|
{
|
||||||
int retval = RIG_OK;
|
int retval = RIG_OK;
|
||||||
hamlib_port_t *rp = RIGPORT(rig);
|
hamlib_port_t *rp = RIGPORT(rig);
|
||||||
|
@ -178,7 +178,7 @@ int anytone_receive(RIG *rig, unsigned char *buf, int buf_len, int expected)
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// anytone_transaction
|
// anytone_transaction
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
int anytone_transaction(RIG *rig, unsigned char *cmd, int cmd_len,
|
static int anytone_transaction(RIG *rig, unsigned char *cmd, int cmd_len,
|
||||||
unsigned char *reply, int reply_len, int expected_len)
|
unsigned char *reply, int reply_len, int expected_len)
|
||||||
{
|
{
|
||||||
int retval = RIG_OK;
|
int retval = RIG_OK;
|
||||||
|
@ -293,8 +293,12 @@ int anytone_open(RIG *rig)
|
||||||
int anytone_close(RIG *rig)
|
int anytone_close(RIG *rig)
|
||||||
{
|
{
|
||||||
int retval = RIG_OK;
|
int retval = RIG_OK;
|
||||||
|
anytone_priv_data_t *p = STATE(rig)->priv;
|
||||||
|
|
||||||
ENTERFUNC;
|
ENTERFUNC;
|
||||||
|
|
||||||
|
// Tell thread to give up
|
||||||
|
p->runflag = 0;
|
||||||
char *cmd = "+ADATA:00,000\r\n";
|
char *cmd = "+ADATA:00,000\r\n";
|
||||||
anytone_transaction(rig, (unsigned char *)cmd, strlen(cmd), NULL, 0, 0);
|
anytone_transaction(rig, (unsigned char *)cmd, strlen(cmd), NULL, 0, 0);
|
||||||
|
|
||||||
|
|
|
@ -62,9 +62,9 @@
|
||||||
*/
|
*/
|
||||||
void drake_fix_string(char* inStr)
|
void drake_fix_string(char* inStr)
|
||||||
{
|
{
|
||||||
char chChkAry[3] = {0x20, 0x0d, 0x0a};
|
const char chChkAry[3] = {0x20, 0x0d, 0x0a};
|
||||||
char* chRepAry[3] = {"<SP>", "<CR>", "<LF>"};
|
const char* chRepAry[3] = {"<SP>", "<CR>", "<LF>"};
|
||||||
char* chPos;
|
const char* chPos;
|
||||||
int newLen;
|
int newLen;
|
||||||
int offset;
|
int offset;
|
||||||
int i;
|
int i;
|
||||||
|
@ -108,7 +108,7 @@ void drake_trans_rept(char* hdrStr, char* sentStr, int sentLen, char* recdStr, i
|
||||||
{
|
{
|
||||||
char sent[BUFSZ];
|
char sent[BUFSZ];
|
||||||
char recd[BUFSZ];
|
char recd[BUFSZ];
|
||||||
char nullStr[7] = {'<','N','U','L','L','>',0x00};
|
const char nullStr[7] = {'<','N','U','L','L','>',0x00};
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
//in most cases each string is a buffer, so we need to ensure both command and response
|
//in most cases each string is a buffer, so we need to ensure both command and response
|
||||||
|
@ -1583,7 +1583,7 @@ DECLARE_PROBERIG_BACKEND(drake)
|
||||||
|
|
||||||
close(port->fd);
|
close(port->fd);
|
||||||
|
|
||||||
if (retval != RIG_OK || id_len <= 0 || id_len >= BUFSZ)
|
if (retval != RIG_OK || id_len <= 1 || id_len >= BUFSZ)
|
||||||
{
|
{
|
||||||
return RIG_MODEL_NONE;
|
return RIG_MODEL_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,6 @@ const struct rot_caps androidsensor_rot_caps =
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
||||||
// cppcheck-suppress syntaxError
|
|
||||||
DECLARE_INITROT_BACKEND(androidsensor)
|
DECLARE_INITROT_BACKEND(androidsensor)
|
||||||
{
|
{
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||||
|
|
|
@ -462,9 +462,7 @@ int RotINDIClient::setPosition(azimuth_t az, elevation_t el)
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
|
||||||
void RotINDIClient::removeDevice(INDI::BaseDevice *dp) {}
|
void RotINDIClient::removeDevice(INDI::BaseDevice *dp) {}
|
||||||
// cppcheck-suppress unusedFunction
|
|
||||||
void RotINDIClient::newProperty(INDI::Property *property)
|
void RotINDIClient::newProperty(INDI::Property *property)
|
||||||
{
|
{
|
||||||
std::string name(property->getName());
|
std::string name(property->getName());
|
||||||
|
@ -491,13 +489,9 @@ void RotINDIClient::newProperty(INDI::Property *property)
|
||||||
mEl = property->getNumber()->np[1].value;
|
mEl = property->getNumber()->np[1].value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// cppcheck-suppress unusedFunction
|
|
||||||
void RotINDIClient::removeProperty(INDI::Property *property) {}
|
void RotINDIClient::removeProperty(INDI::Property *property) {}
|
||||||
// cppcheck-suppress unusedFunction
|
|
||||||
void RotINDIClient::newBLOB(IBLOB *bp) {}
|
void RotINDIClient::newBLOB(IBLOB *bp) {}
|
||||||
// cppcheck-suppress unusedFunction
|
|
||||||
void RotINDIClient::newSwitch(ISwitchVectorProperty *svp) {}
|
void RotINDIClient::newSwitch(ISwitchVectorProperty *svp) {}
|
||||||
// cppcheck-suppress unusedFunction
|
|
||||||
void RotINDIClient::newNumber(INumberVectorProperty *nvp)
|
void RotINDIClient::newNumber(INumberVectorProperty *nvp)
|
||||||
{
|
{
|
||||||
std::string name(nvp->name);
|
std::string name(nvp->name);
|
||||||
|
@ -508,22 +502,16 @@ void RotINDIClient::newNumber(INumberVectorProperty *nvp)
|
||||||
mEl = nvp->np[1].value;
|
mEl = nvp->np[1].value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// cppcheck-suppress unusedFunction
|
|
||||||
void RotINDIClient::newMessage(INDI::BaseDevice *dp, int messageID) {}
|
void RotINDIClient::newMessage(INDI::BaseDevice *dp, int messageID) {}
|
||||||
// cppcheck-suppress unusedFunction
|
|
||||||
void RotINDIClient::newText(ITextVectorProperty *tvp) {}
|
void RotINDIClient::newText(ITextVectorProperty *tvp) {}
|
||||||
// cppcheck-suppress unusedFunction
|
|
||||||
void RotINDIClient::newLight(ILightVectorProperty *lvp) {}
|
void RotINDIClient::newLight(ILightVectorProperty *lvp) {}
|
||||||
// cppcheck-suppress unusedFunction
|
|
||||||
void RotINDIClient::newDevice(INDI::BaseDevice *dp) {}
|
void RotINDIClient::newDevice(INDI::BaseDevice *dp) {}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
|
||||||
void RotINDIClient::serverConnected()
|
void RotINDIClient::serverConnected()
|
||||||
{
|
{
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "indi: server connected\n");
|
rig_debug(RIG_DEBUG_VERBOSE, "indi: server connected\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// cppcheck-suppress unusedFunction
|
|
||||||
void RotINDIClient::serverDisconnected(int exit_code)
|
void RotINDIClient::serverDisconnected(int exit_code)
|
||||||
{
|
{
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "indi: server disconnected\n");
|
rig_debug(RIG_DEBUG_VERBOSE, "indi: server disconnected\n");
|
||||||
|
|
|
@ -1000,7 +1000,7 @@ static int multicast_publisher_read_packet(multicast_publisher_args
|
||||||
return (RIG_OK);
|
return (RIG_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *multicast_publisher(void *arg)
|
static void *multicast_publisher(void *arg)
|
||||||
{
|
{
|
||||||
unsigned char spectrum_data[HAMLIB_MAX_SPECTRUM_DATA];
|
unsigned char spectrum_data[HAMLIB_MAX_SPECTRUM_DATA];
|
||||||
char snapshot_buffer[HAMLIB_MAX_SNAPSHOT_PACKET_SIZE];
|
char snapshot_buffer[HAMLIB_MAX_SNAPSHOT_PACKET_SIZE];
|
||||||
|
@ -1257,7 +1257,7 @@ int is_wireless()
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <ifaddrs.h>
|
#include <ifaddrs.h>
|
||||||
|
|
||||||
int is_networked(char *ipv4, int ipv4_length)
|
static int is_networked(char *ipv4, int ipv4_length)
|
||||||
{
|
{
|
||||||
struct ifaddrs *interfaces, *iface;
|
struct ifaddrs *interfaces, *iface;
|
||||||
char addr_str[INET_ADDRSTRLEN];
|
char addr_str[INET_ADDRSTRLEN];
|
||||||
|
@ -1345,7 +1345,7 @@ int is_wireless()
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void *multicast_receiver(void *arg)
|
static void *multicast_receiver(void *arg)
|
||||||
{
|
{
|
||||||
char data[4096];
|
char data[4096];
|
||||||
char ip4[INET6_ADDRSTRLEN];
|
char ip4[INET6_ADDRSTRLEN];
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
static setting_t bitmap_func, bitmap_level, bitmap_parm, bitmap_vfo_ops;
|
static setting_t bitmap_func, bitmap_level, bitmap_parm, bitmap_vfo_ops;
|
||||||
|
|
||||||
int create_png_range(const freq_range_t rx_range_list[],
|
static int create_png_range(const freq_range_t rx_range_list[],
|
||||||
const freq_range_t tx_range_list[], int num);
|
const freq_range_t tx_range_list[], int num);
|
||||||
|
|
||||||
int print_caps_sum(struct rig_caps *caps, void *data)
|
int print_caps_sum(struct rig_caps *caps, void *data)
|
||||||
|
@ -566,7 +566,6 @@ static void draw_range(const freq_range_t range_list[],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int create_png_range(const freq_range_t rx_range_list[],
|
static int create_png_range(const freq_range_t rx_range_list[],
|
||||||
const freq_range_t tx_range_list[],
|
const freq_range_t tx_range_list[],
|
||||||
int num)
|
int num)
|
||||||
|
|
|
@ -58,7 +58,7 @@ void usage();
|
||||||
void version();
|
void version();
|
||||||
static int set_conf(RIG *rig, char *conf_parms);
|
static int set_conf(RIG *rig, char *conf_parms);
|
||||||
|
|
||||||
int clear_chans(RIG *rig, const char *infilename);
|
static int clear_chans(RIG *rig, const char *infilename);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reminder: when adding long options,
|
* Reminder: when adding long options,
|
||||||
|
@ -450,7 +450,7 @@ static int set_conf(RIG *rig, char *conf_parms)
|
||||||
/*
|
/*
|
||||||
* Pretty nasty, clears everything you have in rig memory
|
* Pretty nasty, clears everything you have in rig memory
|
||||||
*/
|
*/
|
||||||
int clear_chans(RIG *rig, const char *infilename)
|
static int clear_chans(RIG *rig, const char *infilename)
|
||||||
{
|
{
|
||||||
int i, j, ret;
|
int i, j, ret;
|
||||||
channel_t chan;
|
channel_t chan;
|
||||||
|
|
|
@ -246,7 +246,7 @@ struct test_table test_list[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct test_table *find_cmd_entry(int cmd)
|
static struct test_table *find_cmd_entry(int cmd)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ struct mod_lst
|
||||||
struct mod_lst *models = NULL;
|
struct mod_lst *models = NULL;
|
||||||
|
|
||||||
/* Add model information to the hash */
|
/* Add model information to the hash */
|
||||||
void hash_add_model(int id,
|
static void hash_add_model(int id,
|
||||||
const char *mfg_name,
|
const char *mfg_name,
|
||||||
const char *model_name,
|
const char *model_name,
|
||||||
const char *version,
|
const char *version,
|
||||||
|
@ -309,20 +309,20 @@ void hash_add_model(int id,
|
||||||
|
|
||||||
|
|
||||||
/* Hash sorting functions */
|
/* Hash sorting functions */
|
||||||
int hash_model_id_sort(const struct mod_lst *a, const struct mod_lst *b)
|
static int hash_model_id_sort(const struct mod_lst *a, const struct mod_lst *b)
|
||||||
{
|
{
|
||||||
return (a->id > b->id);
|
return (a->id > b->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void hash_sort_by_model_id()
|
static void hash_sort_by_model_id()
|
||||||
{
|
{
|
||||||
HASH_SORT(models, hash_model_id_sort);
|
HASH_SORT(models, hash_model_id_sort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Delete hash */
|
/* Delete hash */
|
||||||
void hash_delete_all()
|
static void hash_delete_all()
|
||||||
{
|
{
|
||||||
struct mod_lst *current_model, *tmp = NULL;
|
struct mod_lst *current_model, *tmp = NULL;
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ static void rp_getline(const char *s)
|
||||||
/*
|
/*
|
||||||
* TODO: use Lex?
|
* TODO: use Lex?
|
||||||
*/
|
*/
|
||||||
char parse_arg(const char *arg)
|
static char parse_arg(const char *arg)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ Does fail when compiled with gcc -m32 -o test2038 test2038.c
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int test2038(void)
|
static int test2038(void)
|
||||||
{
|
{
|
||||||
time_t x;
|
time_t x;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
# include <arpa/inet.h>
|
# include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int rig_network_addr(char *hoststr, char *portstr)
|
static int rig_network_addr(char *hoststr, char *portstr)
|
||||||
{
|
{
|
||||||
|
|
||||||
struct in6_addr serveraddr;
|
struct in6_addr serveraddr;
|
||||||
|
@ -73,7 +73,7 @@ int rig_network_addr(char *hoststr, char *portstr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_host(char *hoststr, char host[256], char port[6])
|
static int test_host(char *hoststr, char host[256], char port[6])
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
char host2[256], port2[6];
|
char host2[256], port2[6];
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#define SERIAL_PORT "/dev/ttyS0"
|
#define SERIAL_PORT "/dev/ttyS0"
|
||||||
|
|
||||||
|
|
||||||
int myfreq_event(RIG *rig, vfo_t vfo, freq_t freq, rig_ptr_t arg)
|
static int myfreq_event(RIG *rig, vfo_t vfo, freq_t freq, rig_ptr_t arg)
|
||||||
{
|
{
|
||||||
int *count_ptr = (int *) arg;
|
int *count_ptr = (int *) arg;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue