From 46cb356f11f0771c6a6ea28e0c508704e98f1923 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Sat, 4 Apr 2020 22:49:27 -0500 Subject: [PATCH] Fix numerous gcc v10 warnings --- include/hamlib/amplifier.h | 2 +- include/hamlib/amplist.h | 4 ++-- include/hamlib/rotlist.h | 4 ++-- rigs/tentec/omnivii.c | 2 +- rigs/tentec/rx331.c | 2 +- rigs/yaesu/newcat.c | 2 +- src/amp_reg.c | 2 +- src/cm108.c | 14 +++++++------- src/debug.c | 2 +- src/rig.c | 8 ++++---- src/rot_reg.c | 2 +- src/sleep.c | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/hamlib/amplifier.h b/include/hamlib/amplifier.h index e938cc64a..faefcb739 100644 --- a/include/hamlib/amplifier.h +++ b/include/hamlib/amplifier.h @@ -31,7 +31,7 @@ */ /** - * \file amp.h + * \file amplifier.h * \brief Hamlib amplifier data structures. * * This file contains the data structures and declarations for the Hamlib diff --git a/include/hamlib/amplist.h b/include/hamlib/amplist.h index fbeea553f..4742193cd 100644 --- a/include/hamlib/amplist.h +++ b/include/hamlib/amplist.h @@ -81,10 +81,10 @@ */ /** - * \def AMP_MODEL_ELECRAFT1 + * \def AMP_MODEL_ELECRAFT * \brief A macro that returns the model number of the EasyComm 1 backend. * - * The Elecraft 1 backend can be used with amplifiers that support the + * The Elecraft #1 backend can be used with amplifiers that support the * KPA1500 protocol. */ #define AMP_ELECRAFT 2 diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index 8ecc0d77d..c83630e58 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -205,8 +205,8 @@ * GS23 protocol. */ /** - * \def ROT_MODEL_AMSAT_LVB - * \brief A macro that returns the model number of the AMSAT_LVB TRACKER backend. + * \def ROT_MODEL_LVB + * \brief A macro that returns the model number of the LVB TRACKER backend. * * The AMSAT LVB TRACKER backend can be used with rotators that support the * AMSAT LVB TRACKER GS232 based protocol. diff --git a/rigs/tentec/omnivii.c b/rigs/tentec/omnivii.c index 720106d18..8fa6351ac 100644 --- a/rigs/tentec/omnivii.c +++ b/rigs/tentec/omnivii.c @@ -1433,7 +1433,7 @@ int tt588_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) const char *tt588_get_info(RIG *rig) { static char cmdbuf[16], firmware[64]; - int cmd_len, firmware_len, retval; + int cmd_len, firmware_len=sizeof(firmware), retval; cmd_len = sprintf(cmdbuf, "?V" EOM); memset(firmware, 0, sizeof(firmware)); diff --git a/rigs/tentec/rx331.c b/rigs/tentec/rx331.c index 97c90720c..88e04e1aa 100644 --- a/rigs/tentec/rx331.c +++ b/rigs/tentec/rx331.c @@ -909,7 +909,7 @@ int rx331_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) const char *rx331_get_info(RIG *rig) { static char buf[BUFSZ]; /* FIXME: reentrancy */ - int firmware_len, retval; + int firmware_len = sizeof(buf), retval; retval = rx331_transaction(rig, REPORT_FIRM, strlen(REPORT_FIRM), buf, &firmware_len); diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index cb6984921..753391180 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6337,7 +6337,7 @@ int newcat_set_cmd(RIG *rig) correct - alternative is response is longer that the buffer */ if (strncmp(verify_cmd, priv->ret_data, strlen(verify_cmd) - 1) - || !strchr(&cat_term, priv->ret_data[strlen(priv->ret_data) - 1])) + || (cat_term != priv->ret_data[strlen(priv->ret_data) - 1])) { rig_debug(RIG_DEBUG_ERR, "%s: Unexpected verify command response '%s'\n", __func__, priv->ret_data); diff --git a/src/amp_reg.c b/src/amp_reg.c index cc807829b..b9fb59ae1 100644 --- a/src/amp_reg.c +++ b/src/amp_reg.c @@ -68,7 +68,7 @@ DEFINE_INITAMP_BACKEND(dummy); DEFINE_INITAMP_BACKEND(kpa1500); /** - * \def AMP_BACKEND_LIST + * \def amp_backend_list * \brief Static list of amplifier models. * * This is a NULL terminated list of available amplifier backends. Each entry diff --git a/src/cm108.c b/src/cm108.c index a08c6a853..2de83c94f 100644 --- a/src/cm108.c +++ b/src/cm108.c @@ -77,7 +77,7 @@ * \param port * \return file descriptor */ -int cm108_open(hamlib_port_t *p) +int cm108_open(hamlib_port_t *port) { int fd; #ifdef HAVE_LINUX_HIDRAW_H @@ -86,19 +86,19 @@ int cm108_open(hamlib_port_t *p) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (!p->pathname[0]) + if (!port->pathname[0]) { return -RIG_EINVAL; } - fd = open(p->pathname, O_RDWR); + fd = open(port->pathname, O_RDWR); if (fd < 0) { rig_debug(RIG_DEBUG_ERR, "%s: opening device \"%s\": %s\n", __func__, - p->pathname, + port->pathname, strerror(errno)); return -RIG_EIO; } @@ -138,7 +138,7 @@ int cm108_open(hamlib_port_t *p) #endif - p->fd = fd; + port->fd = fd; return fd; } @@ -147,11 +147,11 @@ int cm108_open(hamlib_port_t *p) * \brief Close CM108 HID port * \param port */ -int cm108_close(hamlib_port_t *p) +int cm108_close(hamlib_port_t *port) { rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - return close(p->fd); + return close(port->fd); } diff --git a/src/debug.c b/src/debug.c index d5d5bb1a8..40ee7dad9 100644 --- a/src/debug.c +++ b/src/debug.c @@ -134,7 +134,7 @@ int HAMLIB_API rig_need_debug(enum rig_debug_level_e debug_level) } /** - * \param debug_time_stamp + * \param flag * \brief Enbable/disable time stamp on debug output */ void HAMLIB_API rig_set_debug_time_stamp(int flag) diff --git a/src/rig.c b/src/rig.c index f206a2189..dbf713533 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1084,17 +1084,17 @@ int HAMLIB_API rig_cleanup(RIG *rig) /** * \brief timeout (secs) to stop rigctld when VFO is manually changed * \param rig The rig handle - * \param timeout_secs The timeout to set to + * \param seconds The timeout to set to * - * timeout (secs) to stop rigctld when VFO is manually changed + * timeout seconds to stop rigctld when VFO is manually changed * turns on/off the radio. - * See \set_twiddle + * See \rig_set_twiddle * * \return RIG_OK if the operation has been sucessful, ortherwise * a negative value if an error occured (in which case, cause is * set appropriately). * - * \sa rig_set_twiddle() + * \sa rig_get_twiddle() */ int HAMLIB_API rig_set_twiddle(RIG *rig, int seconds) { diff --git a/src/rot_reg.c b/src/rot_reg.c index 58e9f3016..17d05fb5c 100644 --- a/src/rot_reg.c +++ b/src/rot_reg.c @@ -85,7 +85,7 @@ DEFINE_INITROT_BACKEND(meade); DEFINE_INITROT_BACKEND(ioptron); /** - * \def ROT_BACKEND_LIST + * \def rot_backend_list * \brief Static list of rotator models. * * This is a NULL terminated list of available rotator backends. Each entry diff --git a/src/sleep.c b/src/sleep.c index eed6a193f..54f0d520d 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -32,7 +32,7 @@ /** * \brief provide sleep and usleep replacements - * \param same as man page for each + * \note parameters are same as man page for each * */ #include @@ -99,7 +99,7 @@ int usleep(useconds_t usec) return 0; } #endif // HAVE_NANOSLEEP - +#pragma GCC diagnostic ignored "-Wall" #ifdef __cplusplus } #endif