diff options
author | Walter Doekes <walter+asterisk@wjd.nu> | 2012-02-08 20:49:48 +0000 |
---|---|---|
committer | Walter Doekes <walter+asterisk@wjd.nu> | 2012-02-08 20:49:48 +0000 |
commit | db24fc2523da16bd812abb2a35b6320d24083e3f (patch) | |
tree | 4f4d564d4c32538014aefd01789f3f2bffc5520e /addons | |
parent | 0adeb88318467f75f84a70990b1f982b9ca470f3 (diff) |
Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: Clod Patry
Review: https://reviewboard.asterisk.org/r/1651
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'addons')
-rw-r--r-- | addons/chan_mobile.c | 14 | ||||
-rw-r--r-- | addons/chan_ooh323.c | 21 | ||||
-rw-r--r-- | addons/ooh323c/src/memheap.c | 3 |
3 files changed, 20 insertions, 18 deletions
diff --git a/addons/chan_mobile.c b/addons/chan_mobile.c index efdda4e64..90b059e0f 100644 --- a/addons/chan_mobile.c +++ b/addons/chan_mobile.c @@ -2975,7 +2975,6 @@ static int sdp_search(char *addr, int profile) static sdp_session_t *sdp_register(void) { - uint32_t service_uuid_int[] = {0, 0, 0, GENERIC_AUDIO_SVCLASS_ID}; uint8_t rfcomm_channel = 1; const char *service_name = "Asterisk PABX"; @@ -3021,8 +3020,12 @@ static sdp_session_t *sdp_register(void) if (!(session = sdp_connect(BDADDR_ANY, BDADDR_LOCAL, SDP_RETRY_IF_BUSY))) ast_log(LOG_WARNING, "Failed to connect sdp and create session.\n"); - else - sdp_record_register(session, record, 0); + else { + if (sdp_record_register(session, record, 0) < 0) { + ast_log(LOG_WARNING, "Failed to sdp_record_register error: %d\n", errno); + return NULL; + } + } sdp_data_free(channel); sdp_list_free(rfcomm_list, 0); @@ -4083,18 +4086,17 @@ static void *do_discovery(void *data) static void *do_sco_listen(void *data) { struct adapter_pvt *adapter = (struct adapter_pvt *) data; - int res; while (!check_unloading()) { /* check for new sco connections */ - if ((res = ast_io_wait(adapter->accept_io, 0)) == -1) { + if (ast_io_wait(adapter->accept_io, 0) == -1) { /* handle errors */ ast_log(LOG_ERROR, "ast_io_wait() failed for adapter %s\n", adapter->id); break; } /* handle audio data */ - if ((res = ast_io_wait(adapter->io, 1)) == -1) { + if (ast_io_wait(adapter->io, 1) == -1) { ast_log(LOG_ERROR, "ast_io_wait() failed for audio on adapter %s\n", adapter->id); break; } diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c index 38fdcfbba..e6f45f32a 100644 --- a/addons/chan_ooh323.c +++ b/addons/chan_ooh323.c @@ -3518,7 +3518,6 @@ static int function_ooh323_write(struct ast_channel *chan, const char *cmd, char static int load_module(void) { - int res; struct ooAliases * pNewAlias = NULL; struct ooh323_peer *peer = NULL; struct ast_format tmpfmt; @@ -3566,7 +3565,7 @@ static int load_module(void) } - if (!(res = reload_config(0))) { + if (!reload_config(0)) { /* Make sure we can register our OOH323 channel type */ if (ast_channel_register(&ooh323_tech)) { ast_log(LOG_ERROR, "Unable to register channel class %s\n", type); @@ -3622,10 +3621,10 @@ static int load_module(void) ast_mutex_lock(&peerl.lock); peer = peerl.peers; while (peer) { - if(peer->h323id) ooH323EpAddAliasH323ID(peer->h323id); - if(peer->email) ooH323EpAddAliasEmailID(peer->email); - if(peer->e164) ooH323EpAddAliasDialedDigits(peer->e164); - if(peer->url) ooH323EpAddAliasURLID(peer->url); + if(peer->h323id) ooH323EpAddAliasH323ID(peer->h323id); + if(peer->email) ooH323EpAddAliasEmailID(peer->email); + if(peer->e164) ooH323EpAddAliasDialedDigits(peer->e164); + if(peer->url) ooH323EpAddAliasURLID(peer->url); peer = peer->next; } ast_mutex_unlock(&peerl.lock); @@ -3667,7 +3666,7 @@ static int load_module(void) /* Create H.323 listener */ if (ooCreateH323Listener() != OO_OK) { - ast_log(LOG_ERROR, "OOH323 Listener Creation failure. " + ast_log(LOG_ERROR, "OOH323 Listener Creation failure. " "OOH323 DISABLED\n"); ooH323EpDestroy(); @@ -3675,7 +3674,7 @@ static int load_module(void) } if (ooh323c_start_stack_thread() < 0) { - ast_log(LOG_ERROR, "Failed to start OOH323 stack thread. " + ast_log(LOG_ERROR, "Failed to start OOH323 stack thread. " "OOH323 DISABLED\n"); ooH323EpDestroy(); return 1; @@ -4186,7 +4185,6 @@ static int ooh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance /* XXX Deal with Video */ struct ooh323_pvt *p; struct ast_sockaddr tmp; - int mode; if (gH323Debug) ast_verb(0, "--- ooh323_set_peer - %s\n", ast_channel_name(chan)); @@ -4195,7 +4193,10 @@ static int ooh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance return 0; } - mode = ooh323_convertAsteriskCapToH323Cap(&chan->writeformat); + if (ooh323_convertAsteriskCapToH323Cap(&chan->writeformat) < 0) { + ast_log(LOG_WARNING, "Unknown format.\n"); + return -1; + } p = (struct ooh323_pvt *) chan->tech_pvt; if (!p) { ast_log(LOG_ERROR, "No Private Structure, this is bad\n"); diff --git a/addons/ooh323c/src/memheap.c b/addons/ooh323c/src/memheap.c index f92fa5384..c7aed04e5 100644 --- a/addons/ooh323c/src/memheap.c +++ b/addons/ooh323c/src/memheap.c @@ -726,7 +726,7 @@ void* memHeapRealloc (void** ppvMemHeap, void* mem_p, int nbytes_) OSMemLink** ppMemLink; OSMemBlk* pMemBlk; OSMemElemDescr* pElem; - OSMemLink* pMemLink, *pPrevMemLink = 0; + OSMemLink* pMemLink; void *newMem_p; unsigned nbytes, nunits; @@ -758,7 +758,6 @@ void* memHeapRealloc (void** ppvMemHeap, void* mem_p, int nbytes_) *(int*)(((char*)pMemLink) + sizeof (OSMemLink)) = nbytes_; return pMemLink->pMemBlk; } - pPrevMemLink = pMemLink; } /* Round number of bytes to nearest 8-byte boundary */ |