Still more cppcheck tweaks

pull/1821/head
George Baltz N3GB 2025-07-29 13:10:28 -04:00
rodzic 72bc62366d
commit 1c36377480
12 zmienionych plików z 20 dodań i 20 usunięć

Wyświetl plik

@ -57,7 +57,7 @@
{ 238, 60 }, \
} }
int icr8500_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
static int icr8500_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
static struct icom_priv_caps icr8500_priv_caps =
{
@ -199,7 +199,7 @@ struct rig_caps icr8500_caps =
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
int icr8500_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
static int icr8500_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
{
switch (func)
{

Wyświetl plik

@ -674,7 +674,7 @@ static inline long timediff(const struct timeval *tv1,
return ((tv.tv_sec * 1000L) + (tv.tv_usec / 1000L));
}
static int check_cache_timeout(struct timeval *tv)
static int check_cache_timeout(const struct timeval *tv)
{
struct timeval curr;
long t;

Wyświetl plik

@ -460,7 +460,7 @@ static inline long timediff(const struct timeval *tv1,
return ((tv.tv_sec * 1000L) + (tv.tv_usec / 1000L));
}
static int check_cache_timeout(struct timeval *tv)
static int check_cache_timeout(const struct timeval *tv)
{
struct timeval curr;
long t;

Wyświetl plik

@ -594,7 +594,7 @@ static inline long timediff(const struct timeval *tv1,
return ((tv.tv_sec * 1000L) + (tv.tv_usec / 1000L));
}
static int check_cache_timeout(struct timeval *tv)
static int check_cache_timeout(const struct timeval *tv)
{
struct timeval curr;
long t;

Wyświetl plik

@ -4,7 +4,7 @@
#include<stdio.h>
#include<fcntl.h>
unsigned int parseBinary(char *str)
unsigned int parseBinary(const char *str)
{
unsigned int val = 0;

Wyświetl plik

@ -76,7 +76,7 @@ empty_calibration:
return 0;
}
void write_calibration(int cal[NUM_CHANNELS][2])
void write_calibration(const int cal[NUM_CHANNELS][2])
{
unsigned short buf[16];
int i, j, k = 0;
@ -107,7 +107,7 @@ static void erase_calibration()
}
int check_calibration(int cal[NUM_CHANNELS][2],
int stored_cal[NUM_CHANNELS][2], int state)
const int stored_cal[NUM_CHANNELS][2], int state)
{
double pcnt_diff;
int i, j, erase_cal = 0;

Wyświetl plik

@ -74,7 +74,7 @@ empty_calibration:
return 0;
}
void write_calibration(int cal[NUM_CHANNELS][2])
void write_calibration(const int cal[NUM_CHANNELS][2])
{
unsigned short buf[16];
int i, j, k = 0;
@ -105,7 +105,7 @@ static void erase_calibration()
}
int check_calibration(int cal[NUM_CHANNELS][2],
int stored_cal[NUM_CHANNELS][2], int state)
const int stored_cal[NUM_CHANNELS][2], int state)
{
double pcnt_diff;
int i, j, erase_cal = 0;

Wyświetl plik

@ -63,7 +63,7 @@ int do_init = 1;
#define XTIME(x) ( ( x << 1 ) ^ ( ( x & 0x80 ) ? 0x1B : 0x00 ) )
#define MUL(x,y) ( ( x && y ) ? pow[(log[x] + log[y]) % 255] : 0 )
void aes_gen_tables(void)
static void aes_gen_tables(void)
{
int i;
uint8 x, y;

Wyświetl plik

@ -1,6 +1,6 @@
#include "md5.h"
char *make_digest(const unsigned char *digest, int len) /* {{{ */
static char *make_digest(const unsigned char *digest, int len) /* {{{ */
{
int md5len = sizeof(char) * (len * 2 + 1);
char *md5str = (char *) calloc(1, md5len);
@ -64,7 +64,7 @@ char *make_digest(const unsigned char *digest, int len) /* {{{ */
* This processes one or more 64-byte data blocks, but does NOT update
* the bit counters. There are no alignment requirements.
*/
const void *body(void *ctxBuf, const void *data, size_t size)
static const void *body(void *ctxBuf, const void *data, size_t size)
{
MD5_CTX *ctx = (MD5_CTX *)ctxBuf;
const unsigned char *ptr;
@ -174,7 +174,7 @@ const void *body(void *ctxBuf, const void *data, size_t size)
return ptr;
}
void MD5Init(void *ctxBuf)
static void MD5Init(void *ctxBuf)
{
MD5_CTX *ctx = (MD5_CTX *)ctxBuf;
ctx->a = 0x67452301;
@ -186,7 +186,7 @@ void MD5Init(void *ctxBuf)
ctx->hi = 0;
}
void MD5Update(void *ctxBuf, const void *data, size_t size)
static void MD5Update(void *ctxBuf, const void *data, size_t size)
{
MD5_CTX *ctx = (MD5_CTX *)ctxBuf;
MD5_u32plus saved_lo;
@ -229,7 +229,7 @@ void MD5Update(void *ctxBuf, const void *data, size_t size)
memcpy(ctx->buffer, data, size);
}
void MD5Final(unsigned char *result, void *ctxBuf)
static void MD5Final(unsigned char *result, void *ctxBuf)
{
MD5_CTX *ctx = (MD5_CTX *)ctxBuf;
MD5_u32plus used, free;
@ -282,7 +282,7 @@ void MD5Final(unsigned char *result, void *ctxBuf)
memset(ctx, 0, sizeof(*ctx));
}
unsigned char *make_hash(const char *arg)
static unsigned char *make_hash(const char *arg)
{
MD5_CTX context;
static unsigned char digest[65];

Wyświetl plik

@ -53,7 +53,7 @@ void sha256_starts(sha256_context *ctx)
ctx->state[7] = 0x5BE0CD19;
}
void sha256_process(sha256_context *ctx, const uint8 data[64])
static void sha256_process(sha256_context *ctx, const uint8 data[64])
{
uint32 temp1, temp2, W[64];
uint32 A, B, C, D, E, F, G, H;

Wyświetl plik

@ -49,7 +49,7 @@ typedef enum nc_rigid_e
NC_RIGID_FTDX101MP = 682
} nc_rigid_t;
void load_dat(const char *filename, unsigned char buf[1492])
static void load_dat(const char *filename, unsigned char buf[1492])
{
FILE *fp = fopen(filename, "r");
char line[4096];

Wyświetl plik

@ -106,7 +106,7 @@ static int test_host(char *hoststr, char host[256], char port[6])
}
int
main(int argc, char *argv[])
main(int argc, const char *argv[])
{
// IPV4
test_host("127.0.0.1", "127.0.0.1", "");