MT#55283 move declarations to eliminate shadowing

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

@ -1317,9 +1317,11 @@ static void call_ng_parse_block_mode(str *s, enum block_dtmf_mode *output) {
#endif
static void call_ng_flags_freqs(struct sdp_ng_flags *out, bencode_item_t *value) {
unsigned int val;
switch (value->type) {
case BENCODE_INTEGER:;
unsigned int val = value->value;
val = value->value;
g_array_append_val(out->frequencies, val);
break;
case BENCODE_LIST:
@ -1330,7 +1332,7 @@ static void call_ng_flags_freqs(struct sdp_ng_flags *out, bencode_item_t *value)
str s, token;
bencode_get_str(value, &s);
while (str_token_sep(&token, &s, ',') == 0) {
unsigned int val = str_to_i(&token, 0);
val = str_to_i(&token, 0);
g_array_append_val(out->frequencies, val);
}
break;

@ -225,7 +225,6 @@ static void cli_handler_do(const cli_handler_t *handlers, str *instr,
}
static void destroy_own_foreign_calls(bool foreign_call, unsigned int uint_keyspace_db) {
struct call *c = NULL;
struct call_monologue *ml = NULL;
GQueue call_list = G_QUEUE_INIT;
GList *i;
@ -250,6 +249,7 @@ next:;
ITERATE_CALL_LIST_NEXT_END(c);
// destroy calls
struct call *c = NULL;
while ((c = g_queue_pop_head(&call_list))) {
if (!c->ml_deleted) {
for (i = c->monologues.head; i; i = i->next) {

@ -1958,8 +1958,7 @@ void codec_output_rtp(struct media_packet *mp, struct codec_scheduler *csch,
p->ttq_entry.when = csch->first_send;
uint32_t ts_diff = (uint32_t) ts - (uint32_t) csch->first_send_ts; // allow for wrap-around
ts_diff += ts_delay;
long long ts_diff_us =
(unsigned long long) ts_diff * 1000000 / handler->dest_pt.clock_rate;
ts_diff_us = (unsigned long long) ts_diff * 1000000 / handler->dest_pt.clock_rate;
timeval_add_usec(&p->ttq_entry.when, ts_diff_us);
// how far in the future is this?

@ -294,7 +294,7 @@ int buffer_packet(struct media_packet *mp, const str *s) {
else {
// store data from first packet and use for successive packets and queue the first packet
unsigned long ts = ntohl(mp->rtp->timestamp);
int payload_type = (mp->rtp->m_pt & 0x7f);
payload_type = (mp->rtp->m_pt & 0x7f);
int clockrate = get_clock_rate(mp, payload_type);
if(!clockrate){
if(jb->rtptime_delta && payload_type != COMFORT_NOISE) { //ignore CN

@ -54,7 +54,7 @@ static int mqtt_connect(void) {
mosquitto_threaded_set(mosq, true);
if (rtpe_config.mqtt_user) {
int ret = mosquitto_username_pw_set(mosq, rtpe_config.mqtt_user, rtpe_config.mqtt_pass);
ret = mosquitto_username_pw_set(mosq, rtpe_config.mqtt_user, rtpe_config.mqtt_pass);
if (ret != MOSQ_ERR_SUCCESS) {
ilog(LOG_ERR, "Failed to set mosquitto user/pass auth: %s", mosquitto_strerror(errno));
return -1;
@ -62,7 +62,7 @@ static int mqtt_connect(void) {
}
if (rtpe_config.mqtt_cafile || rtpe_config.mqtt_capath) {
int ret = mosquitto_tls_set(mosq, rtpe_config.mqtt_cafile, rtpe_config.mqtt_capath,
ret = mosquitto_tls_set(mosq, rtpe_config.mqtt_cafile, rtpe_config.mqtt_capath,
rtpe_config.mqtt_certfile, rtpe_config.mqtt_keyfile, NULL);
if (ret != MOSQ_ERR_SUCCESS) {
ilog(LOG_ERR, "Failed to set mosquitto TLS options: %s", mosquitto_strerror(errno));
@ -72,7 +72,7 @@ static int mqtt_connect(void) {
if (rtpe_config.mqtt_tls_alpn) {
#if LIBMOSQUITTO_VERSION_NUMBER >= 1006000
int ret = mosquitto_string_option(mosq, MOSQ_OPT_TLS_ALPN, rtpe_config.mqtt_tls_alpn);
ret = mosquitto_string_option(mosq, MOSQ_OPT_TLS_ALPN, rtpe_config.mqtt_tls_alpn);
if (ret != MOSQ_ERR_SUCCESS) {
ilog(LOG_ERR, "Failed to set mosquitto TLS ALPN options: %s", mosquitto_strerror(errno));
return -1;

@ -2175,7 +2175,7 @@ static void restore_thread(void *call_p, void *ctx_p) {
int redis_restore(struct redis *r, bool foreign, int db) {
redisReply *calls = NULL, *call;
int i, ret = -1;
int ret = -1;
GThreadPool *gtp;
struct thread_ctx ctx;
@ -2218,12 +2218,12 @@ int redis_restore(struct redis *r, bool foreign, int db) {
mutex_init(&ctx.r_m);
g_queue_init(&ctx.r_q);
ctx.foreign = foreign;
for (i = 0; i < rtpe_config.redis_num_threads; i++)
for (int i = 0; i < rtpe_config.redis_num_threads; i++)
g_queue_push_tail(&ctx.r_q,
redis_dup(r, db));
gtp = g_thread_pool_new(restore_thread, &ctx, rtpe_config.redis_num_threads, TRUE, NULL);
for (i = 0; i < calls->elements; i++) {
for (int i = 0; i < calls->elements; i++) {
call = calls->element[i];
if (call->type != REDIS_REPLY_STRING)
continue;

@ -592,7 +592,7 @@ GQueue *statistics_gather_metrics(struct interface_sampled_rate_stats *interface
HEADER("{", NULL);
GString *tmp = g_string_new("");
tmp = g_string_new("");
METRICsva("proxy", "\"%s\"", sockaddr_print_buf(&cur->proxy));
g_string_append_printf(tmp, " %20s ", sockaddr_print_buf(&cur->proxy));
for (int i = 0; i < NGC_COUNT; i++) {

@ -4027,7 +4027,7 @@ static const char *evs_encoder_init(encoder_t *enc, const str *extra_opts) {
else {
mode &= 0xff;
mode = evs_clamp_mode_by_bw(mode, enc->codec_options.evs.max_bw);
int bitrate = evs_mode_bitrates[0][mode];
bitrate = evs_mode_bitrates[0][mode];
ilog(LOG_INFO, "EVS: using bitrate %i instead of %i as restricted by BW %i",
bitrate, enc->bitrate, enc->codec_options.evs.max_bw);
enc->bitrate = bitrate;

Loading…
Cancel
Save