Various little cleanups, many of them from a clang static analysis

This commit is contained in:
Steve Underwood
2014-05-02 23:32:33 +08:00
parent 317f4b1442
commit 28a9a40e37
75 changed files with 646 additions and 499 deletions

View File

@@ -463,7 +463,6 @@ static int parse_hex_num(const char **s, int max_value)
/* The spec. says a hex value is always 2 digits, and the alpha digits are
upper case. */
i = 0;
if (isdigit((int) **s))
i = **s - '0';
else if (**s >= 'A' && **s <= 'F')
@@ -912,7 +911,6 @@ static const char *at_cmd_dummy(at_state_t *s, const char *t)
static const char *at_cmd_A(at_state_t *s, const char *t)
{
/* V.250 6.3.5 - Answer (abortable) */
t += 1;
if (!answer_call(s))
return NULL;
return (const char *) -1;
@@ -921,7 +919,6 @@ static const char *at_cmd_A(at_state_t *s, const char *t)
static const char *at_cmd_D(at_state_t *s, const char *t)
{
int ok;
char *u;
char num[100 + 1];
char ch;
@@ -932,7 +929,6 @@ static const char *at_cmd_D(at_state_t *s, const char *t)
s->silent_dial = false;
s->command_dial = false;
t += 1;
ok = false;
/* There are a numbers of options in a dial command string.
Many are completely irrelevant in this application. */
u = num;
@@ -1024,7 +1020,7 @@ static const char *at_cmd_D(at_state_t *s, const char *t)
}
}
*u = '\0';
if ((ok = at_modem_control(s, AT_MODEM_CONTROL_CALL, num)) < 0)
if (at_modem_control(s, AT_MODEM_CONTROL_CALL, num) < 0)
return NULL;
/* Dialing should now be in progress. No AT response should be
issued at this point. */