diff options
author | Russell Bryant <russell@russellbryant.com> | 2011-05-03 20:45:32 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2011-05-03 20:45:32 +0000 |
commit | 37aa52fd78996b5c516ff4c851b60252eda84b05 (patch) | |
tree | e1651180838e594a0203f863f3cdd084860e1bf5 /channels | |
parent | 810b9c887949fc4bd9f01dcdc0d3a4f476cb00de (diff) |
Merged revisions 316265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines
Fix a bunch of compiler warnings generated by gcc 4.6.0.
Most of these are -Wunused-but-set-variable, but there were a few others
mixed in here, as well.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_agent.c | 8 | ||||
-rw-r--r-- | channels/chan_phone.c | 10 | ||||
-rw-r--r-- | channels/chan_skinny.c | 19 | ||||
-rw-r--r-- | channels/chan_unistim.c | 4 |
4 files changed, 9 insertions, 32 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c index 47df7cba6..0dc930f9d 100644 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -887,7 +887,6 @@ int agent_set_base_channel(struct ast_channel *chan, struct ast_channel *base) static int agent_hangup(struct ast_channel *ast) { struct agent_pvt *p = ast->tech_pvt; - int howlong = 0; ast_mutex_lock(&p->lock); p->owner = NULL; @@ -908,11 +907,8 @@ static int agent_hangup(struct ast_channel *ast) ast_debug(1, "Hangup called for state %s\n", ast_state2str(ast->_state)); if (p->start && (ast->_state != AST_STATE_UP)) { - howlong = time(NULL) - p->start; p->start = 0; - } else if (ast->_state == AST_STATE_RESERVED) - howlong = 0; - else + } else p->start = 0; if (p->chan) { p->chan->_bridge = NULL; @@ -1856,7 +1852,6 @@ static int login_exec(struct ast_channel *chan, const char *data) int max_login_tries = maxlogintries; struct agent_pvt *p; struct ast_module_user *u; - int login_state = 0; char user[AST_MAX_AGENT] = ""; char pass[AST_MAX_AGENT]; char agent[AST_MAX_AGENT] = ""; @@ -1950,7 +1945,6 @@ static int login_exec(struct ast_channel *chan, const char *data) ast_mutex_lock(&p->lock); if (!strcmp(p->agent, user) && !strcmp(p->password, pass) && !p->pending) { - login_state = 1; /* Successful Login */ /* Ensure we can't be gotten until we're done */ p->lastdisc = ast_tvnow(); diff --git a/channels/chan_phone.c b/channels/chan_phone.c index 6b7420198..4b7ec9721 100644 --- a/channels/chan_phone.c +++ b/channels/chan_phone.c @@ -295,12 +295,10 @@ static int phone_call(struct ast_channel *ast, char *dest, int timeout) ast_localtime(&UtcTime, &tm, NULL); memset(&cid, 0, sizeof(PHONE_CID)); - if(&tm != NULL) { - snprintf(cid.month, sizeof(cid.month), "%02d",(tm.tm_mon + 1)); - snprintf(cid.day, sizeof(cid.day), "%02d", tm.tm_mday); - snprintf(cid.hour, sizeof(cid.hour), "%02d", tm.tm_hour); - snprintf(cid.min, sizeof(cid.min), "%02d", tm.tm_min); - } + snprintf(cid.month, sizeof(cid.month), "%02d",(tm.tm_mon + 1)); + snprintf(cid.day, sizeof(cid.day), "%02d", tm.tm_mday); + snprintf(cid.hour, sizeof(cid.hour), "%02d", tm.tm_hour); + snprintf(cid.min, sizeof(cid.min), "%02d", tm.tm_min); /* the standard format of ast->callerid is: "name" <number>, but not always complete */ if (!ast->connected.id.name.valid || ast_strlen_zero(ast->connected.id.name.str)) { diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index a105b6c21..fb2a50434 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -3610,8 +3610,6 @@ static int manager_skinny_show_lines(struct mansession *s, const struct message static char *handle_skinny_show_lines(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { - int verbose = 0; - switch (cmd) { case CLI_INIT: e->command = "skinny show lines [verbose]"; @@ -3626,9 +3624,7 @@ static char *handle_skinny_show_lines(struct ast_cli_entry *e, int cmd, struct a } if (a->argc == e->args) { - if (!strcasecmp(a->argv[e->args-1], "verbose")) { - verbose = 1; - } else { + if (strcasecmp(a->argv[e->args-1], "verbose")) { return CLI_SHOWUSAGE; } } else if (a->argc != e->args - 1) { @@ -4039,7 +4035,6 @@ static void *skinny_ss(void *data) static int skinny_call(struct ast_channel *ast, char *dest, int timeout) { int res = 0; - int tone = 0; struct skinny_subchannel *sub = ast->tech_pvt; struct skinny_line *l = sub->parent; struct skinny_device *d = l->device; @@ -4069,10 +4064,8 @@ static int skinny_call(struct ast_channel *ast, char *dest, int timeout) switch (l->hookstate) { case SKINNY_OFFHOOK: - tone = SKINNY_CALLWAITTONE; break; case SKINNY_ONHOOK: - tone = SKINNY_ALERT; l->activesub = sub; break; default: @@ -4101,7 +4094,6 @@ static int skinny_hangup(struct ast_channel *ast) struct skinny_subchannel *sub = ast->tech_pvt; struct skinny_line *l; struct skinny_device *d; - struct skinnysession *s; if (!sub) { ast_debug(1, "Asked to hangup channel not connected\n"); @@ -4110,7 +4102,6 @@ static int skinny_hangup(struct ast_channel *ast) l = sub->parent; d = l->device; - s = d->session; if (skinnydebug) ast_verb(3,"Hanging up %s/%d\n",d->name,sub->callid); @@ -5333,7 +5324,6 @@ static int handle_offhook_message(struct skinny_req *req, struct skinnysession * struct ast_channel *c; struct skinny_line *tmp; int instance; - int reference; /* if any line on a device is offhook, than the device must be offhook, unless we have shared lines CCM seems that it would never get here, @@ -5349,7 +5339,6 @@ static int handle_offhook_message(struct skinny_req *req, struct skinnysession * } instance = letohl(req->data.offhook.instance); - reference = letohl(req->data.offhook.reference); if (instance) { sub = find_subchannel_by_instance_reference(d, d->lastlineinstance, d->lastcallreference); @@ -7177,8 +7166,6 @@ static struct ast_channel *skinny_request(const char *type, struct ast_format_ca int on = 1; struct ast_config *cfg; char *cat; - struct skinny_device *d; - struct skinny_line *l; int oldport = ntohs(bindaddr.sin_port); struct ast_flags config_flags = { 0 }; @@ -7227,7 +7214,7 @@ static struct ast_channel *skinny_request(const char *type, struct ast_format_ca config_parse_variables(TYPE_DEF_LINE, default_line, ast_variable_browse(cfg, "lines")); cat = ast_category_browse(cfg, "lines"); while (cat && strcasecmp(cat, "general") && strcasecmp(cat, "devices")) { - l = config_line(cat, ast_variable_browse(cfg, cat)); + config_line(cat, ast_variable_browse(cfg, cat)); cat = ast_category_browse(cfg, cat); } @@ -7237,7 +7224,7 @@ static struct ast_channel *skinny_request(const char *type, struct ast_format_ca config_parse_variables(TYPE_DEF_DEVICE, default_device, ast_variable_browse(cfg, "devices")); cat = ast_category_browse(cfg, "devices"); while (cat && strcasecmp(cat, "general") && strcasecmp(cat, "lines")) { - d = config_device(cat, ast_variable_browse(cfg, cat)); + config_device(cat, ast_variable_browse(cfg, cat)); cat = ast_category_browse(cfg, cat); } diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c index faa66f818..8b0f23313 100644 --- a/channels/chan_unistim.c +++ b/channels/chan_unistim.c @@ -1924,7 +1924,7 @@ static int attempt_transfer(struct unistim_subchannel *p1, struct unistim_subcha int res = 0; struct ast_channel *chana = NULL, *chanb = NULL, *bridgea = NULL, *bridgeb = NULL, *peera = - NULL, *peerb = NULL, *peerc = NULL, *peerd = NULL; + NULL, *peerb = NULL, *peerc = NULL; if (!p1->owner || !p2->owner) { ast_log(LOG_WARNING, "Transfer attempted without dual ownership?\n"); @@ -1939,12 +1939,10 @@ static int attempt_transfer(struct unistim_subchannel *p1, struct unistim_subcha peera = chana; peerb = chanb; peerc = bridgea; - peerd = bridgeb; } else if (bridgeb) { peera = chanb; peerb = chana; peerc = bridgeb; - peerd = bridgea; } if (peera && peerb && peerc && (peerb != peerc)) { |