From 43d1427b4d2a01980f00e3e189f63e000c84caa8 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 10 Nov 2023 19:25:56 -0500 Subject: [PATCH] MT#55283 switch basic GQueue to g_auto Change-Id: I3b17e0a0f6e451e3a0e62c209a887db6ac1f7f55 --- daemon/call.c | 10 +++++----- daemon/call_interfaces.c | 14 +++++++------- daemon/cdr.c | 2 +- daemon/codec.c | 2 +- daemon/media_socket.c | 2 +- daemon/statistics.c | 2 +- lib/codeclib.c | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 89a326043..fc3233aa3 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -3069,7 +3069,7 @@ static void __unsubscribe_medias_from_all(struct call_monologue *ml) { */ static struct call_monologue * ml_medias_subscribed_to_single_ml(struct call_monologue *ml) { /* detect monologues multiplicity */ - AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; + g_auto(GQueue) mls = G_QUEUE_INIT; struct call_monologue * return_ml = NULL; for (unsigned int i = 0; i < ml->medias->len; i++) { @@ -3384,7 +3384,7 @@ int monologue_subscribe_request(const GQueue *srms, struct call_monologue *dst_m __unsubscribe_medias_from_all(dst_ml); __call_monologue_init_from_flags(dst_ml, flags); - AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ + g_auto(GQueue) mls = G_QUEUE_INIT; /* to avoid duplications */ for (GList *sl = srms->head; sl; sl = sl->next) { struct media_subscription *ms = sl->data; @@ -3408,7 +3408,7 @@ int monologue_subscribe_answer(struct call_monologue *dst_ml, struct sdp_ng_flag bool print_extra_sess_attrs) { struct media_subscription *rev_ms = NULL; - AUTO_CLEANUP(GQueue attr_mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ + g_auto(GQueue) attr_mls = G_QUEUE_INIT; /* to avoid duplications */ for (GList * l = streams->head; l; l = l->next) { @@ -3476,7 +3476,7 @@ int monologue_subscribe_answer(struct call_monologue *dst_ml, struct sdp_ng_flag } /* TODO: move inside the cycle above, to reduce iterations amount */ - AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ + g_auto(GQueue) mls = G_QUEUE_INIT; /* to avoid duplications */ for (int i = 0; i < dst_ml->medias->len; i++) { struct call_media * dst_media = dst_ml->medias->pdata[i]; @@ -4771,7 +4771,7 @@ static void monologue_stop(struct call_monologue *ml, bool stop_media_subsribers } /* monologue's subscribers */ if (stop_media_subsribers) { - AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ + g_auto(GQueue) mls = G_QUEUE_INIT; /* to avoid duplications */ for (unsigned int i = 0; i < ml->medias->len; i++) { struct call_media *media = ml->medias->pdata[i]; diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 9d73bbb6f..04d4fbcf9 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -2321,8 +2321,8 @@ static void ng_stats_monologue(bencode_item_t *dict, const struct call_monologue { bencode_item_t *sub, *medias = NULL; struct call_media *m; - AUTO_CLEANUP(GQueue mls_subscriptions, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ - AUTO_CLEANUP(GQueue mls_subscribers, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ + g_auto(GQueue) mls_subscriptions = G_QUEUE_INIT; /* to avoid duplications */ + g_auto(GQueue) mls_subscribers = G_QUEUE_INIT; /* to avoid duplications */ if (!ml) return; @@ -2504,7 +2504,7 @@ stats: ml = call_get_monologue(call, match_tag); if (ml) { ng_stats_monologue(tags, ml, totals, ssrc); - AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ + g_auto(GQueue) mls = G_QUEUE_INIT; /* to avoid duplications */ for (int i = 0; i < ml->medias->len; i++) { struct call_media * media = ml->medias->pdata[i]; @@ -3041,7 +3041,7 @@ static const char *call_block_silence_media(bencode_item_t *input, bool on_off, return errstr; if (monologue) { - AUTO_CLEANUP(GQueue sinks, g_queue_clear) = G_QUEUE_INIT; + g_auto(GQueue) sinks = G_QUEUE_INIT; if (flags.to_tag.len) { struct call_monologue *sink = g_hash_table_lookup(call->tags, &flags.to_tag); if (!sink) { @@ -3207,7 +3207,7 @@ static const char *play_media_select_party(struct call **call, GQueue *monologue const char *call_play_media_ng(bencode_item_t *input, bencode_item_t *output) { #ifdef WITH_TRANSCODING AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); - AUTO_CLEANUP(GQueue monologues, g_queue_clear); + g_auto(GQueue) monologues; const char *err = NULL; AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); @@ -3262,7 +3262,7 @@ const char *call_play_media_ng(bencode_item_t *input, bencode_item_t *output) { const char *call_stop_media_ng(bencode_item_t *input, bencode_item_t *output) { #ifdef WITH_TRANSCODING AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); - AUTO_CLEANUP(GQueue monologues, g_queue_clear); + g_auto(GQueue) monologues; const char *err = NULL; long long last_frame_pos = 0; AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); @@ -3295,7 +3295,7 @@ const char *call_stop_media_ng(bencode_item_t *input, bencode_item_t *output) { const char *call_play_dtmf_ng(bencode_item_t *input, bencode_item_t *output) { #ifdef WITH_TRANSCODING AUTO_CLEANUP_NULL(struct call *call, call_unlock_release); - AUTO_CLEANUP(GQueue monologues, g_queue_clear); + g_auto(GQueue) monologues; const char *err = NULL; AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags); diff --git a/daemon/cdr.c b/daemon/cdr.c index 2cb8e6c9e..23fe2cc7c 100644 --- a/daemon/cdr.c +++ b/daemon/cdr.c @@ -82,7 +82,7 @@ void cdr_update_entry(struct call* c) { cdrlinecnt, ml->tag.s, cdrlinecnt, get_tag_type_text(ml->tagtype)); - AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ + g_auto(GQueue) mls = G_QUEUE_INIT; /* to avoid duplications */ for (int i = 0; i < ml->medias->len; i++) { struct call_media * media = ml->medias->pdata[i]; diff --git a/daemon/codec.c b/daemon/codec.c index 3cbb88ef6..82499c431 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -5102,7 +5102,7 @@ void codec_store_accept(struct codec_store *cs, GQueue *accept, struct codec_sto // mark codecs as `for transcoding` for (GList *l = accept->head; l; l = l->next) { str *codec = l->data; - AUTO_CLEANUP(GQueue pts_matched, g_queue_clear) = G_QUEUE_INIT; + g_auto(GQueue) pts_matched = G_QUEUE_INIT; GQueue *pts = &pts_matched; if (!str_cmp(codec, "all") || !str_cmp(codec, "full")) diff --git a/daemon/media_socket.c b/daemon/media_socket.c index af5b15d61..003217142 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -3066,7 +3066,7 @@ out: unconfirm_sinks(&phc->mp.stream->rtcp_sinks, "peer address unconfirmed"); } if (phc->unkernelize_subscriptions) { - AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */ + g_auto(GQueue) mls = G_QUEUE_INIT; /* to avoid duplications */ for (GList * sub = phc->mp.media->media_subscriptions.head; sub; sub = sub->next) { struct media_subscription * ms = sub->data; diff --git a/daemon/statistics.c b/daemon/statistics.c index f1192b436..1e8446927 100644 --- a/daemon/statistics.c +++ b/daemon/statistics.c @@ -953,7 +953,7 @@ void statistics_init(void) { const char *statistics_ng(bencode_item_t *input, bencode_item_t *output) { AUTO_CLEANUP_INIT(GQueue *metrics, statistics_free_metrics, statistics_gather_metrics(NULL)); - AUTO_CLEANUP_INIT(GQueue bstack, g_queue_clear, G_QUEUE_INIT); + g_auto(GQueue) bstack = G_QUEUE_INIT; bencode_item_t *dict = output; const char *sub_label = "statistics"; // top level diff --git a/lib/codeclib.c b/lib/codeclib.c index c8386eb33..2299e7d31 100644 --- a/lib/codeclib.c +++ b/lib/codeclib.c @@ -2818,7 +2818,7 @@ static void amr_bitrate_tracker(decoder_t *dec, unsigned int ft) { } static int amr_decoder_input(decoder_t *dec, const str *data, GQueue *out) { const char *err = NULL; - AUTO_CLEANUP(GQueue toc, g_queue_clear) = G_QUEUE_INIT; + g_auto(GQueue) toc = G_QUEUE_INIT; if (!data || !data->s) goto err;