Fix coverity UNUSED_VALUE findings in core support level files

Most of these were just saving returned values without using them and
in some cases the variable being saved to could be removed as well.

(issue ASTERISK-19672)
........

Merged revisions 368738 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 368739 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2012-06-11 15:23:30 +00:00
parent 566ea22e18
commit c6142cf2cc
15 changed files with 21 additions and 25 deletions

View File

@@ -14489,14 +14489,13 @@ static char *handle_pri_service_generic(struct ast_cli_entry *e, int cmd, struct
int trunkgroup;
int x, y, fd = a->fd;
int interfaceid = 0;
char *c;
char db_chan_name[20], db_answer[5];
struct dahdi_pvt *tmp;
struct dahdi_pri *pri;
if (a->argc < 5 || a->argc > 6)
return CLI_SHOWUSAGE;
if ((c = strchr(a->argv[4], ':'))) {
if (strchr(a->argv[4], ':')) {
if (sscanf(a->argv[4], "%30d:%30d", &trunkgroup, &channel) != 2)
return CLI_SHOWUSAGE;
if ((trunkgroup < 1) || (channel < 1))

View File

@@ -14178,7 +14178,7 @@ static int transmit_refer(struct sip_pvt *p, const char *dest)
ast_log(LOG_NOTICE, "From address missing 'sip(s):', assuming sip:\n");
}
/* Get just the username part */
if ((c = strchr(dest, '@'))) {
if (strchr(dest, '@')) {
c = NULL;
} else if ((c = strchr(of, '@'))) {
*c++ = '\0';

View File

@@ -153,9 +153,9 @@ int sip_acf_channel_read(struct ast_channel *chan, const char *funcname, char *p
}
if (ast_strlen_zero(args.field) || !strcasecmp(args.field, "all")) {
char quality_buf[AST_MAX_USER_FIELD], *quality;
char quality_buf[AST_MAX_USER_FIELD];
if (!(quality = ast_rtp_instance_get_quality(rtp, AST_RTP_INSTANCE_STAT_FIELD_QUALITY, quality_buf, sizeof(quality_buf)))) {
if (!ast_rtp_instance_get_quality(rtp, AST_RTP_INSTANCE_STAT_FIELD_QUALITY, quality_buf, sizeof(quality_buf))) {
return -1;
}

View File

@@ -1079,7 +1079,7 @@ AST_TEST_DEFINE(get_in_brackets_test)
}
/* Test 6, NULL input */
if ((uri = get_in_brackets(NULL))) {
if (get_in_brackets(NULL)) {
ast_test_status_update(test, "Test 6, NULL input failed.\n");
res = AST_TEST_FAIL;
}

View File

@@ -52,9 +52,7 @@ static int set_crypto_policy(struct ast_srtp_policy *policy, int suite_val, cons
static struct sdp_crypto *sdp_crypto_alloc(void)
{
struct sdp_crypto *crypto;
return crypto = ast_calloc(1, sizeof(*crypto));
return ast_calloc(1, sizeof(struct sdp_crypto));
}
void sdp_crypto_destroy(struct sdp_crypto *crypto)