A few more cppcheck messages silenced

pull/1821/head
George Baltz N3GB 2025-07-28 19:31:20 -04:00
rodzic e172d34381
commit 72bc62366d
11 zmienionych plików z 30 dodań i 40 usunięć

Wyświetl plik

@ -46,7 +46,7 @@
// ---------------------------------------------------------------------------
#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);
DECLARE_INITRIG_BACKEND(anytone)
@ -94,7 +94,7 @@ DECLARE_PROBERIG_BACKEND(anytone)
// AnyTone needs a keep-alive to emulate the MIC
// 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;
hamlib_port_t *rp = RIGPORT(rig);
@ -135,7 +135,7 @@ void *anytone_thread(void *vrig)
// ---------------------------------------------------------------------------
// anytone_send
// ---------------------------------------------------------------------------
int anytone_send(RIG *rig,
static int anytone_send(RIG *rig,
unsigned char *cmd, int cmd_len)
{
int retval = RIG_OK;
@ -154,7 +154,7 @@ int anytone_send(RIG *rig,
// ---------------------------------------------------------------------------
// 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;
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
// ---------------------------------------------------------------------------
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)
{
int retval = RIG_OK;
@ -293,8 +293,12 @@ int anytone_open(RIG *rig)
int anytone_close(RIG *rig)
{
int retval = RIG_OK;
anytone_priv_data_t *p = STATE(rig)->priv;
ENTERFUNC;
// Tell thread to give up
p->runflag = 0;
char *cmd = "+ADATA:00,000\r\n";
anytone_transaction(rig, (unsigned char *)cmd, strlen(cmd), NULL, 0, 0);

Wyświetl plik

@ -62,9 +62,9 @@
*/
void drake_fix_string(char* inStr)
{
char chChkAry[3] = {0x20, 0x0d, 0x0a};
char* chRepAry[3] = {"<SP>", "<CR>", "<LF>"};
char* chPos;
const char chChkAry[3] = {0x20, 0x0d, 0x0a};
const char* chRepAry[3] = {"<SP>", "<CR>", "<LF>"};
const char* chPos;
int newLen;
int offset;
int i;
@ -108,7 +108,7 @@ void drake_trans_rept(char* hdrStr, char* sentStr, int sentLen, char* recdStr, i
{
char sent[BUFSZ];
char recd[BUFSZ];
char nullStr[7] = {'<','N','U','L','L','>',0x00};
const char nullStr[7] = {'<','N','U','L','L','>',0x00};
int i;
//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);
if (retval != RIG_OK || id_len <= 0 || id_len >= BUFSZ)
if (retval != RIG_OK || id_len <= 1 || id_len >= BUFSZ)
{
return RIG_MODEL_NONE;
}

Wyświetl plik

@ -143,7 +143,6 @@ const struct rot_caps androidsensor_rot_caps =
/* ************************************************************************* */
// cppcheck-suppress syntaxError
DECLARE_INITROT_BACKEND(androidsensor)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);

Wyświetl plik

@ -462,9 +462,7 @@ int RotINDIClient::setPosition(azimuth_t az, elevation_t el)
return RIG_OK;
}
// cppcheck-suppress unusedFunction
void RotINDIClient::removeDevice(INDI::BaseDevice *dp) {}
// cppcheck-suppress unusedFunction
void RotINDIClient::newProperty(INDI::Property *property)
{
std::string name(property->getName());
@ -491,13 +489,9 @@ void RotINDIClient::newProperty(INDI::Property *property)
mEl = property->getNumber()->np[1].value;
}
}
// cppcheck-suppress unusedFunction
void RotINDIClient::removeProperty(INDI::Property *property) {}
// cppcheck-suppress unusedFunction
void RotINDIClient::newBLOB(IBLOB *bp) {}
// cppcheck-suppress unusedFunction
void RotINDIClient::newSwitch(ISwitchVectorProperty *svp) {}
// cppcheck-suppress unusedFunction
void RotINDIClient::newNumber(INumberVectorProperty *nvp)
{
std::string name(nvp->name);
@ -508,22 +502,16 @@ void RotINDIClient::newNumber(INumberVectorProperty *nvp)
mEl = nvp->np[1].value;
}
}
// cppcheck-suppress unusedFunction
void RotINDIClient::newMessage(INDI::BaseDevice *dp, int messageID) {}
// cppcheck-suppress unusedFunction
void RotINDIClient::newText(ITextVectorProperty *tvp) {}
// cppcheck-suppress unusedFunction
void RotINDIClient::newLight(ILightVectorProperty *lvp) {}
// cppcheck-suppress unusedFunction
void RotINDIClient::newDevice(INDI::BaseDevice *dp) {}
// cppcheck-suppress unusedFunction
void RotINDIClient::serverConnected()
{
rig_debug(RIG_DEBUG_VERBOSE, "indi: server connected\n");
}
// cppcheck-suppress unusedFunction
void RotINDIClient::serverDisconnected(int exit_code)
{
rig_debug(RIG_DEBUG_VERBOSE, "indi: server disconnected\n");

Wyświetl plik

@ -1000,7 +1000,7 @@ static int multicast_publisher_read_packet(multicast_publisher_args
return (RIG_OK);
}
void *multicast_publisher(void *arg)
static void *multicast_publisher(void *arg)
{
unsigned char spectrum_data[HAMLIB_MAX_SPECTRUM_DATA];
char snapshot_buffer[HAMLIB_MAX_SNAPSHOT_PACKET_SIZE];
@ -1257,7 +1257,7 @@ int is_wireless()
#include <unistd.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;
char addr_str[INET_ADDRSTRLEN];
@ -1345,7 +1345,7 @@ int is_wireless()
#endif
#endif
void *multicast_receiver(void *arg)
static void *multicast_receiver(void *arg)
{
char data[4096];
char ip4[INET6_ADDRSTRLEN];

Wyświetl plik

@ -34,7 +34,7 @@
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);
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[],
const freq_range_t tx_range_list[],
int num)

Wyświetl plik

@ -58,7 +58,7 @@ void usage();
void version();
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,
@ -450,7 +450,7 @@ static int set_conf(RIG *rig, char *conf_parms)
/*
* 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;
channel_t chan;

Wyświetl plik

@ -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;
@ -286,7 +286,7 @@ struct mod_lst
struct mod_lst *models = NULL;
/* 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 *model_name,
const char *version,
@ -309,20 +309,20 @@ void hash_add_model(int id,
/* 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);
}
void hash_sort_by_model_id()
static void hash_sort_by_model_id()
{
HASH_SORT(models, hash_model_id_sort);
}
/* Delete hash */
void hash_delete_all()
static void hash_delete_all()
{
struct mod_lst *current_model, *tmp = NULL;
@ -372,7 +372,7 @@ static void rp_getline(const char *s)
/*
* TODO: use Lex?
*/
char parse_arg(const char *arg)
static char parse_arg(const char *arg)
{
int i;

Wyświetl plik

@ -6,7 +6,7 @@ Does fail when compiled with gcc -m32 -o test2038 test2038.c
#include <time.h>
#include <string.h>
int test2038(void)
static int test2038(void)
{
time_t x;

Wyświetl plik

@ -25,7 +25,7 @@
# include <arpa/inet.h>
#endif
int rig_network_addr(char *hoststr, char *portstr)
static int rig_network_addr(char *hoststr, char *portstr)
{
struct in6_addr serveraddr;
@ -73,7 +73,7 @@ int rig_network_addr(char *hoststr, char *portstr)
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;
char host2[256], port2[6];

Wyświetl plik

@ -14,7 +14,7 @@
#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;