MT#55283 rename variables to eliminate shadowing

Change-Id: Iaf5f98dd4820669e1ee0133dceed8a6a6d791b23
pull/1675/head
Richard Fuchs 2 years ago
parent 2f53de0361
commit 5e5e08e377

@ -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);

@ -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)

@ -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) {

@ -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);

@ -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))

@ -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));

@ -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) {

Loading…
Cancel
Save