diff --git a/daemon/call.c b/daemon/call.c index 316476f06..e0ee21055 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -294,7 +294,7 @@ void xmlrpc_kill_calls(void *p) { retry: pid = waitpid(pid, &status, 0); if ((pid > 0 && WIFEXITED(status) && WEXITSTATUS(status) == 0) || i >= 3) { - for (int i = 0; i < els_per_ent; i++) + for (int j = 0; j < els_per_ent; j++) free(g_queue_pop_head(&xh->strings)); i = 0; } @@ -360,7 +360,7 @@ retry: } xmlrpc_client_destroy(c); - for (int i = 0; i < els_per_ent; i++) + for (int j = 0; j < els_per_ent; j++) free(g_queue_pop_head(&xh->strings)); xmlrpc_env_clean(&e); diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 9ca866316..fb7841be1 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -692,11 +692,11 @@ INLINE void ng_sdp_attr_manipulations(struct sdp_manipulations_common ** sm_ptr, for (bencode_item_t *it_v = command_value->child; it_v; it_v = it_v->sibling) { /* detect command value */ - str command_value; - if (!bencode_get_str(it_v, &command_value)) + str child_value; + if (!bencode_get_str(it_v, &child_value)) continue; - str * s_copy = str_dup_escape(&command_value); + str * s_copy = str_dup_escape(&child_value); g_queue_push_tail(q_ptr, s_copy); } break; @@ -725,11 +725,11 @@ INLINE void ng_sdp_attr_manipulations(struct sdp_manipulations_common ** sm_ptr, for (bencode_item_t *it_v = command_value->child; it_v; it_v = it_v->sibling) { /* detect command value */ - str command_value; - if (!bencode_get_str(it_v, &command_value)) + str child_value; + if (!bencode_get_str(it_v, &child_value)) continue; - str *s_copy = str_dup_escape(&command_value); + str *s_copy = str_dup_escape(&child_value); g_hash_table_replace(*ht, s_copy, s_copy); } break; @@ -1413,8 +1413,8 @@ static void call_ng_main_flags(struct sdp_ng_flags *out, str *key, bencode_item_ if (value->type != BENCODE_LIST) break; int diridx = 0; - for (bencode_item_t *it = value->child; it && diridx < 2; it = it->sibling) - bencode_get_str(it, &out->direction[diridx++]); + for (bencode_item_t *cit = value->child; cit && diridx < 2; cit = cit->sibling) + bencode_get_str(cit, &out->direction[diridx++]); break; case CSH_LOOKUP("sdp-attr"): case CSH_LOOKUP("SDP-attr"): @@ -2406,8 +2406,8 @@ static void ng_stats_ssrc(bencode_item_t *dict, struct ssrc_hash *ht) { if (sb->reported.tv_sec < next_step) continue; next_step += interval; - bencode_item_t *ent = bencode_list_add_dictionary(entlist); - ng_stats_ssrc_mos_entry(ent, sb); + bencode_item_t *cent = bencode_list_add_dictionary(entlist); + ng_stats_ssrc_mos_entry(cent, sb); } } @@ -2454,8 +2454,8 @@ stats: ml = call_get_monologue(call, match_tag); if (ml) { ng_stats_monologue(tags, ml, totals, ssrc); - for (GList *l = ml->subscriptions.head; l; l = l->next) { - struct call_subscription *cs = l->data; + for (GList *k = ml->subscriptions.head; k; k = k->next) { + struct call_subscription *cs = k->data; ng_stats_monologue(tags, cs->monologue, totals, ssrc); } } @@ -2724,11 +2724,11 @@ static const char *media_block_match_mult(struct call **call, GQueue *mls, // handle from-tag list for (GList *l = flags->from_tags.head; l; l = l->next) { str *s = l->data; - struct call_monologue *ml = call_get_monologue(*call, s); - if (!ml) + struct call_monologue *mlf = call_get_monologue(*call, s); + if (!mlf) ilog(LOG_WARN, "Given from-tag " STR_FORMAT_M " not found", STR_FMT_M(s)); else - add_ml_to_sub_list(mls, ml); + add_ml_to_sub_list(mls, mlf); } if (!mls->length) diff --git a/daemon/codec.c b/daemon/codec.c index 3884f335b..f2699c4ac 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -2495,11 +2495,11 @@ static int handler_func_passthrough_ssrc(struct codec_handler *h, struct media_p if (h->dtmf_payload_type != -1) { struct codec_ssrc_handler *ch = get_ssrc(mp->ssrc_in->parent->h.ssrc, h->ssrc_hash); if (ch) { - uint64_t ts = ntohl(mp->rtp->timestamp); + uint64_t ts64 = ntohl(mp->rtp->timestamp); str ev_pl = { .s = buf + sizeof(*mp->rtp) }; - int is_dtmf = dtmf_event_payload(&ev_pl, &ts, + int is_dtmf = dtmf_event_payload(&ev_pl, &ts64, (uint64_t) h->source_pt.clock_rate * h->source_pt.ptime / 1000, &ch->dtmf_event, &ch->dtmf_events); if (is_dtmf) { @@ -2507,7 +2507,7 @@ static int handler_func_passthrough_ssrc(struct codec_handler *h, struct media_p struct rtp_header *r = (void *) buf; *r = *mp->rtp; r->m_pt = h->dtmf_payload_type; - r->timestamp = htonl(ts); + r->timestamp = htonl(ts64); if (is_dtmf == 1) r->m_pt |= 0x80; else if (is_dtmf == 3) // end event @@ -4977,8 +4977,8 @@ void codec_store_offer(struct codec_store *cs, GQueue *offer, struct codec_store STR_FMT(codec)); continue; } - for (GList *l = orig_list->head; l; l = l->next) { - int pt_num = GPOINTER_TO_INT(l->data); + for (GList *k = orig_list->head; k; k = k->next) { + int pt_num = GPOINTER_TO_INT(k->data); struct rtp_payload_type *orig_pt = g_hash_table_lookup(orig->codecs, GINT_TO_POINTER(pt_num)); if (!orig_pt) { @@ -5188,8 +5188,8 @@ void codec_store_transcode(struct codec_store *cs, GQueue *offer, struct codec_s continue; } // XXX duplicate code - for (GList *l = orig_list->head; l; l = l->next) { - int pt_num = GPOINTER_TO_INT(l->data); + for (GList *k = orig_list->head; k; k = k->next) { + int pt_num = GPOINTER_TO_INT(k->data); struct rtp_payload_type *orig_pt = g_hash_table_lookup(orig->codecs, GINT_TO_POINTER(pt_num)); if (!orig_pt) { diff --git a/daemon/dtmf.c b/daemon/dtmf.c index e660623c8..9c88d5162 100644 --- a/daemon/dtmf.c +++ b/daemon/dtmf.c @@ -58,8 +58,8 @@ static void dtmf_bencode_and_notify(struct call_media *media, unsigned int event GList *tag_values = g_hash_table_get_values(call->tags); for (GList *tag_it = tag_values; tag_it; tag_it = tag_it->next) { - struct call_monologue *ml = tag_it->data; - bencode_list_add_str(tags, &ml->tag); + struct call_monologue *tml = tag_it->data; + bencode_list_add_str(tags, &tml->tag); } g_list_free(tag_values); @@ -97,11 +97,11 @@ static GString *dtmf_json_print(struct call_media *media, unsigned int event, un GList *tag_values = g_hash_table_get_values(call->tags); int i = 0; for (GList *tag_it = tag_values; tag_it; tag_it = tag_it->next) { - struct call_monologue *ml = tag_it->data; + struct call_monologue *tml = tag_it->data; if (i != 0) g_string_append(buf, ","); g_string_append_printf(buf, "\"" STR_FORMAT "\"", - STR_FMT(&ml->tag)); + STR_FMT(&tml->tag)); i++; } g_list_free(tag_values); diff --git a/daemon/poller.c b/daemon/poller.c index e07b393ea..8a397dfe6 100644 --- a/daemon/poller.c +++ b/daemon/poller.c @@ -429,11 +429,11 @@ int poller_poll(struct poller *p, int timeout) { ZERO(e); e.events = epoll_events(NULL, it); e.data.fd = it->item.fd; - int ret = epoll_ctl(p->fd, EPOLL_CTL_MOD, it->item.fd, &e); + int eret = epoll_ctl(p->fd, EPOLL_CTL_MOD, it->item.fd, &e); mutex_unlock(&p->lock); - if (ret == 0 && it->item.writeable) + if (eret == 0 && it->item.writeable) it->item.writeable(it->item.fd, it->item.obj, it->item.uintp); } else if ((ev->events & POLLIN)) diff --git a/daemon/sdp.c b/daemon/sdp.c index 21f2a4cb3..ea80ee101 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2146,8 +2146,8 @@ static void insert_codec_parameters(GString *s, struct call_media *cm) { STR_FMT(&pt->format_parameters)); } - for (GList *l = pt->rtcp_fb.head; l; l = l->next) { - str *fb = l->data; + for (GList *k = pt->rtcp_fb.head; k; k = k->next) { + str *fb = k->data; g_string_append_printf(s, "a=rtcp-fb:%u " STR_FORMAT "\r\n", pt->payload_type, STR_FMT(fb)); diff --git a/daemon/t38.c b/daemon/t38.c index ee003e362..c8d76b85b 100644 --- a/daemon/t38.c +++ b/daemon/t38.c @@ -708,8 +708,8 @@ int t38_gateway_input_udptl(struct t38_gateway *tg, const str *buf) { } // XOR in packet - for (size_t j = 0; j < recp->s->len; j++) - rec_s->str[j] ^= recp->s->s[j]; + for (size_t k = 0; k < recp->s->len; k++) + rec_s->str[k] ^= recp->s->s[k]; } if (complete) {