Drop assignments of values to variables which never took effect. Drop
assignments which strictly speaking were not required, but were added in
the past to silence warnings in different compiler versions.
../src/serial_bt.c:168:2: warning: Value stored to 'type' is never read
type = SER_BT_CONN_UNKNOWN;
../src/serial_bt.c:507:2: warning: Value stored to 'now_us' is never read
now_us = 0; /* Silence a (false) compiler warning. */
Shuffle variable declarations into the rough order in which they are
used in the function's body.
uint16_t *read_hdl, uint16_t *write_hdl,
uint16_t *cccd_hdl, uint16_t *cccd_val)
{
+ char **fields, *field;
enum ser_bt_conn_t type;
const char *addr;
- char **fields, *field;
if (conn_type)
*conn_type = SER_BT_CONN_UNKNOWN;
if (cccd_val)
*cccd_val = 0;
- type = SER_BT_CONN_UNKNOWN;
- addr = NULL;
-
if (!serial || !spec || !spec[0])
return SR_ERR_ARG;
* where to stop reception.
*/
deadline_us = 0;
- now_us = 0; /* Silence a (false) compiler warning. */
if (timeout_ms) {
now_us = g_get_monotonic_time();
deadline_us = now_us + timeout_ms * 1000;