Still more cppcheck cleanups

pull/1783/head
George Baltz N3GB 2025-06-25 10:01:16 -04:00
rodzic 0b75b96ef1
commit 921a6a9de3
6 zmienionych plików z 13 dodań i 14 usunięć

2
NEWS
Wyświetl plik

@ -18,7 +18,7 @@ Version 4.7.0
such as the TM-D710/TM-V71 that use EOM_TH (\r) as the command terminator. such as the TM-D710/TM-V71 that use EOM_TH (\r) as the command terminator.
(TNX, Lars Kellogg-Stedman and George Baltz). (TNX, Lars Kellogg-Stedman and George Baltz).
* Reduce/repair excess output from cppcheck.sh - mostly cosmetic changes (WIP) * Reduce/repair excess output from cppcheck.sh - mostly cosmetic changes (WIP)
Output from `wc -l cppcheck.log` - 4.6.2: 981 now: 732 Output from `wc -l cppcheck.log` - 4.6.2: 981 now: 673
* Remove dead getopt code. GitHub PR #1709. (TNX Daniele Forsi) * Remove dead getopt code. GitHub PR #1709. (TNX Daniele Forsi)
* Move rig_cache to separate(calloc) storage. Prepare for other moves. * Move rig_cache to separate(calloc) storage. Prepare for other moves.
Issue #1420 Issue #1420

Wyświetl plik

@ -892,7 +892,7 @@ int HAMLIB_API serial_flush(hamlib_port_t *p)
{ {
// we pass an empty stopset so read_string can determine // we pass an empty stopset so read_string can determine
// the appropriate stopset for async data // the appropriate stopset for async data
const char stopset[1]; const char stopset[1] = "";
len = read_string(p, buf, sizeof(buf) - 1, stopset, 0, 1, 1); len = read_string(p, buf, sizeof(buf) - 1, stopset, 0, 1, 1);
if (len > 0) if (len > 0)

Wyświetl plik

@ -16,7 +16,7 @@ static int hash_model_list(const struct rig_caps *caps, void *data)
return 1; /* !=0, we want them all ! */ return 1; /* !=0, we want them all ! */
} }
int mycmp(const void *p1, const void *p2) static int mycmp(const void *p1, const void *p2)
{ {
const char **s1 = (const char **)p1; const char **s1 = (const char **)p1;
const char **s2 = (const char **)p2; const char **s2 = (const char **)p2;

Wyświetl plik

@ -17,7 +17,7 @@ double history[HISTORYSIZE];
int nhistory; int nhistory;
int historyinit = 1; int historyinit = 1;
double compute_mean(const double arr[], int length) static double compute_mean(const double arr[], int length)
{ {
double sum = 0.0; double sum = 0.0;
@ -29,7 +29,7 @@ double compute_mean(const double arr[], int length)
return sum / length; return sum / length;
} }
double sigma(double arr[], int length) static double sigma(double arr[], int length)
{ {
double mean = compute_mean(arr, length); double mean = compute_mean(arr, length);
double sum_of_squares = 0.0; double sum_of_squares = 0.0;

Wyświetl plik

@ -112,7 +112,7 @@ int print_caps_sum(struct rig_caps *caps, void *data)
/* /*
* IO params et al. * IO params et al.
*/ */
int print_caps_parameters(struct rig_caps *caps, void *data) static int print_caps_parameters(struct rig_caps *caps, void *data)
{ {
printf("<A NAME=\"parms%u\"><TR><TD>%s</TD><TD>", printf("<A NAME=\"parms%u\"><TR><TD>%s</TD><TD>",
caps->rig_model, caps->rig_model,
@ -223,7 +223,7 @@ int print_caps_parameters(struct rig_caps *caps, void *data)
* *
* TODO: add new API calls! * TODO: add new API calls!
*/ */
int print_caps_caps(struct rig_caps *caps, void *data) static int print_caps_caps(struct rig_caps *caps, void *data)
{ {
printf("<A NAME=\"caps%u\"><TR><TD>%s</TD>", printf("<A NAME=\"caps%u\"><TR><TD>%s</TD>",
caps->rig_model, caps->rig_model,
@ -271,7 +271,7 @@ int print_caps_caps(struct rig_caps *caps, void *data)
/* /*
* Get/Set parm abilities * Get/Set parm abilities
*/ */
int print_caps_parm(struct rig_caps *caps, void *data) static int print_caps_parm(struct rig_caps *caps, void *data)
{ {
setting_t parm; setting_t parm;
int i; int i;
@ -307,7 +307,7 @@ int print_caps_parm(struct rig_caps *caps, void *data)
/* /*
* VFO Ops capabilities * VFO Ops capabilities
*/ */
int print_caps_vfo_ops(struct rig_caps *caps, void *data) static int print_caps_vfo_ops(struct rig_caps *caps, void *data)
{ {
setting_t vfo_ops; setting_t vfo_ops;
int i; int i;
@ -345,7 +345,7 @@ int print_caps_vfo_ops(struct rig_caps *caps, void *data)
/* /*
* Get/Set level abilities * Get/Set level abilities
*/ */
int print_caps_level(struct rig_caps *caps, void *data) static int print_caps_level(struct rig_caps *caps, void *data)
{ {
setting_t level; setting_t level;
int i; int i;
@ -382,7 +382,7 @@ int print_caps_level(struct rig_caps *caps, void *data)
/* /*
* Get/Set func abilities * Get/Set func abilities
*/ */
int print_caps_func(struct rig_caps *caps, void *data) static int print_caps_func(struct rig_caps *caps, void *data)
{ {
setting_t func; setting_t func;
int i; int i;
@ -421,7 +421,7 @@ int print_caps_func(struct rig_caps *caps, void *data)
* *
* FIXME: default output pics is for region2: add region 1 too! * FIXME: default output pics is for region2: add region 1 too!
*/ */
int print_caps_range(struct rig_caps *caps, void *data) static int print_caps_range(struct rig_caps *caps, void *data)
{ {
create_png_range(caps->rx_range_list2, caps->tx_range_list2, create_png_range(caps->rx_range_list2, caps->tx_range_list2,
caps->rig_model); caps->rig_model);
@ -567,7 +567,7 @@ static void draw_range(const freq_range_t range_list[],
} }
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)
{ {

Wyświetl plik

@ -444,7 +444,6 @@ int main(int argc, char *argv[])
} }
} }
// cppcheck-suppress knownConditionTrueFalse
while (retcode == 0 || retcode == 2); while (retcode == 0 || retcode == 2);
#ifdef HAVE_LIBREADLINE #ifdef HAVE_LIBREADLINE