diff --git a/amplifiers/elecraft/kpa.c b/amplifiers/elecraft/kpa.c index 8ffbbe28e..b7bf05a05 100644 --- a/amplifiers/elecraft/kpa.c +++ b/amplifiers/elecraft/kpa.c @@ -90,7 +90,7 @@ int kpa_close(AMP *amp) return RIG_OK; } -int kpa_flushbuffer(AMP *amp) +static int kpa_flushbuffer(AMP *amp) { rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index f165dca29..814eb2921 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -3888,7 +3888,7 @@ locator2longlat HAMLIB_PARAMS((double *longitude, double *latitude, const char *locator)); -extern HAMLIB_EXPORT(char*) rig_make_md5(char *pass); +extern HAMLIB_EXPORT(char*) rig_make_md5(const char *pass); extern HAMLIB_EXPORT(int) rig_set_lock_mode(RIG *rig, int lock); extern HAMLIB_EXPORT(int) rig_get_lock_mode(RIG *rig, int *lock); diff --git a/rigs/kenwood/xg3.c b/rigs/kenwood/xg3.c index 271bebca2..de65d8282 100644 --- a/rigs/kenwood/xg3.c +++ b/rigs/kenwood/xg3.c @@ -75,22 +75,22 @@ static struct kenwood_priv_caps xg3_priv_caps = /* XG3 specific rig_caps API function declarations */ -int xg3_init(RIG *rig); -int xg3_open(RIG *rig); -int xg3_set_vfo(RIG *rig, vfo_t vfo); -int xg3_get_vfo(RIG *rig, vfo_t *vfo); -int xg3_set_freq(RIG *rig, vfo_t vfo, freq_t freq); -int xg3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); -int xg3_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); -int xg3_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); -int xg3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); -int xg3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); -int xg3_set_powerstat(RIG *rig, powerstat_t status); -int xg3_get_powerstat(RIG *rig, powerstat_t *status); -int xg3_set_mem(RIG *rig, vfo_t vfo, int ch); -int xg3_get_mem(RIG *rig, vfo_t vfo, int *ch); -int xg3_set_parm(RIG *rig, setting_t parm, value_t val); -int xg3_get_parm(RIG *rig, setting_t parm, value_t *val); +static int xg3_init(RIG *rig); +static int xg3_open(RIG *rig); +static int xg3_set_vfo(RIG *rig, vfo_t vfo); +static int xg3_get_vfo(RIG *rig, vfo_t *vfo); +static int xg3_set_freq(RIG *rig, vfo_t vfo, freq_t freq); +static int xg3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); +static int xg3_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); +static int xg3_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); +static int xg3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); +static int xg3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +static int xg3_set_powerstat(RIG *rig, powerstat_t status); +static int xg3_get_powerstat(RIG *rig, powerstat_t *status); +static int xg3_set_mem(RIG *rig, vfo_t vfo, int ch); +static int xg3_get_mem(RIG *rig, vfo_t vfo, int *ch); +static int xg3_set_parm(RIG *rig, setting_t parm, value_t val); +static int xg3_get_parm(RIG *rig, setting_t parm, value_t *val); /* @@ -183,7 +183,7 @@ struct rig_caps xg3_caps = /* * xg3_init() */ -int xg3_init(RIG *rig) +static int xg3_init(RIG *rig) { struct kenwood_priv_data *priv; int i; @@ -225,7 +225,7 @@ int xg3_init(RIG *rig) /* * xg3_open() */ -int xg3_open(RIG *rig) +static int xg3_open(RIG *rig) { int err; ptt_t ptt; @@ -245,7 +245,7 @@ int xg3_open(RIG *rig) } -int xg3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) +static int xg3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { char levelbuf[16]; @@ -275,7 +275,7 @@ int xg3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) /* * kenwood_get_level */ -int xg3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) +static int xg3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { char cmdbuf[32], replybuf[32]; int retval; @@ -343,7 +343,7 @@ int xg3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) /* * xg3_get_vfo */ -int xg3_get_vfo(RIG *rig, vfo_t *vfo) +static int xg3_get_vfo(RIG *rig, vfo_t *vfo) { rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -359,7 +359,7 @@ int xg3_get_vfo(RIG *rig, vfo_t *vfo) /* * xg3_set_vfo */ -int xg3_set_vfo(RIG *rig, vfo_t vfo) +static int xg3_set_vfo(RIG *rig, vfo_t vfo) { rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -379,7 +379,7 @@ int xg3_set_vfo(RIG *rig, vfo_t vfo) /* * xg3_set_freq */ -int xg3_set_freq(RIG *rig, vfo_t vfo, freq_t freq) +static int xg3_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { int err; vfo_t tvfo; @@ -422,7 +422,7 @@ int xg3_set_freq(RIG *rig, vfo_t vfo, freq_t freq) /* * xg3_get_freq */ -int xg3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) +static int xg3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { struct hamlib_port *rp; char freqbuf[50]; @@ -494,7 +494,7 @@ int xg3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) /* * xg3_set_powerstat */ -int xg3_set_powerstat(RIG *rig, powerstat_t status) +static int xg3_set_powerstat(RIG *rig, powerstat_t status) { rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -514,7 +514,7 @@ int xg3_set_powerstat(RIG *rig, powerstat_t status) /* * xg3_get_powerstat */ -int xg3_get_powerstat(RIG *rig, powerstat_t *status) +static int xg3_get_powerstat(RIG *rig, powerstat_t *status) { const char *cmd = "G"; // any command to test will do char buf[6]; @@ -540,7 +540,7 @@ int xg3_get_powerstat(RIG *rig, powerstat_t *status) /* * xg3_set_mem */ -int xg3_set_mem(RIG *rig, vfo_t vfo, int ch) +static int xg3_set_mem(RIG *rig, vfo_t vfo, int ch) { char cmdbuf[32]; int retval; @@ -569,7 +569,7 @@ int xg3_set_mem(RIG *rig, vfo_t vfo, int ch) /* * xg3_get_mem */ -int xg3_get_mem(RIG *rig, vfo_t vfo, int *ch) +static int xg3_get_mem(RIG *rig, vfo_t vfo, int *ch) { char cmdbuf[32]; char reply[32]; @@ -602,7 +602,7 @@ int xg3_get_mem(RIG *rig, vfo_t vfo, int *ch) /* * xg3_set_ptt */ -int xg3_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) +static int xg3_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { int retval; @@ -622,7 +622,7 @@ int xg3_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) /* * kenwood_get_ptt */ -int xg3_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) +static int xg3_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { char pttbuf[6]; int retval; @@ -650,7 +650,7 @@ int xg3_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) /* * xg3_set_parm */ -int xg3_set_parm(RIG *rig, setting_t parm, value_t val) +static int xg3_set_parm(RIG *rig, setting_t parm, value_t val) { int ival; char cmdbuf[16]; @@ -679,7 +679,7 @@ int xg3_set_parm(RIG *rig, setting_t parm, value_t val) /* * xg3_get_parm */ -int xg3_get_parm(RIG *rig, setting_t parm, value_t *val) +static int xg3_get_parm(RIG *rig, setting_t parm, value_t *val) { int ival; char replybuf[6]; diff --git a/rigs/tentec/jupiter.c b/rigs/tentec/jupiter.c index 3a28dc677..ed9bcf8f6 100644 --- a/rigs/tentec/jupiter.c +++ b/rigs/tentec/jupiter.c @@ -257,7 +257,7 @@ static int tt538_transaction(RIG *rig, const char *cmd, int cmd_len, retval = tentec_transaction(rig, cmd, cmd_len, data, data_len); - if (data == NULL || (data != NULL && data_len > 0)) + if (data == NULL || data_len > 0) { return retval; } diff --git a/security/aes.c b/security/aes.c index a46bdfdb4..9333b8a04 100644 --- a/security/aes.c +++ b/security/aes.c @@ -434,7 +434,7 @@ uint32 KT3[256]; /* AES key scheduling routine */ -int aes_set_key(aes_context *ctx, uint8 *key, int nbits) +int aes_set_key(aes_context *ctx, const uint8 *key, int nbits) { int i; uint32 *RK, *SK; @@ -591,7 +591,7 @@ int aes_set_key(aes_context *ctx, uint8 *key, int nbits) /* AES 128-bit block encryption routine */ -void aes_encrypt(aes_context *ctx, uint8 input[16], uint8 output[16]) +void aes_encrypt(aes_context *ctx, const uint8 input[16], uint8 output[16]) { uint32 *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3; @@ -681,7 +681,7 @@ void aes_encrypt(aes_context *ctx, uint8 input[16], uint8 output[16]) /* AES 128-bit block decryption routine */ -void aes_decrypt(aes_context *ctx, uint8 input[16], uint8 output[16]) +void aes_decrypt(aes_context *ctx, const uint8 input[16], uint8 output[16]) { uint32 *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3; diff --git a/security/aes.h b/security/aes.h index 7c39f9eed..8b960ac3f 100755 --- a/security/aes.h +++ b/security/aes.h @@ -17,8 +17,8 @@ typedef struct } aes_context; -int aes_set_key( aes_context *ctx, uint8 *key, int nbits ); -void aes_encrypt( aes_context *ctx, uint8 input[16], uint8 output[16] ); -void aes_decrypt( aes_context *ctx, uint8 input[16], uint8 output[16] ); +int aes_set_key( aes_context *ctx, const uint8 *key, int nbits ); +void aes_encrypt( aes_context *ctx, const uint8 input[16], uint8 output[16] ); +void aes_decrypt( aes_context *ctx, const uint8 input[16], uint8 output[16] ); #endif /* aes.h */ diff --git a/security/md5.c b/security/md5.c index b5ceb3883..9baf0a048 100644 --- a/security/md5.c +++ b/security/md5.c @@ -292,7 +292,7 @@ unsigned char *make_hash(const char *arg) return digest; } -char *rig_make_md5(char *pass) +char *rig_make_md5(const char *pass) { const unsigned char *hash = make_hash(pass); char *md5str = make_digest(hash, 16); diff --git a/security/sha256.c b/security/sha256.c index 73224a3e9..811cee623 100644 --- a/security/sha256.c +++ b/security/sha256.c @@ -53,7 +53,7 @@ void sha256_starts(sha256_context *ctx) ctx->state[7] = 0x5BE0CD19; } -void sha256_process(sha256_context *ctx, uint8 data[64]) +void sha256_process(sha256_context *ctx, const uint8 data[64]) { uint32 temp1, temp2, W[64]; uint32 A, B, C, D, E, F, G, H;