Browse Source

MT#55283 use g_auto for GString

Change-Id: Ie7eb4a8f4115cdf13770cb112d8116b29ae94d73
pull/1769/head
Richard Fuchs 2 years ago
parent
commit
c28ba5cd4e
4 changed files with 3 additions and 9 deletions
  1. +1
    -1
      daemon/cdr.c
  2. +1
    -1
      daemon/janus.c
  3. +1
    -1
      daemon/websocket.c
  4. +0
    -6
      lib/auxlib.h

+ 1
- 1
daemon/cdr.c View File

@ -40,7 +40,7 @@ void cdr_update_entry(struct call* c) {
struct call_monologue *ml;
struct timeval tim_result_duration;
int cdrlinecnt = 0;
AUTO_CLEANUP_INIT(GString *cdr, __g_string_free, g_string_new(""));
g_autoptr(GString) cdr = g_string_new("");
struct call_media *md;
GList *o;
const struct rtp_payload_type *rtp_pt;


+ 1
- 1
daemon/janus.c View File

@ -508,7 +508,7 @@ static const char *janus_videoroom_join(struct websocket_message *wm, struct jan
return "User already exists in the room as a publisher";
uint64_t feed_id = 0; // set for single feed IDs, otherwise remains 0
AUTO_CLEANUP_INIT(GString *feed_ids, __g_string_free, g_string_new("feeds ")); // for log output
g_autoptr(GString) feed_ids = g_string_new("feeds "); // for log output
AUTO_CLEANUP(GQueue ret_streams, janus_clear_ret_streams) = G_QUEUE_INIT; // return list for multiple subs
if (is_pub) {


+ 1
- 1
daemon/websocket.c View File

@ -381,7 +381,7 @@ static const char *websocket_http_metrics(struct websocket_message *wm) {
ilogs(http, LOG_DEBUG, "Respoding to GET /metrics");
AUTO_CLEANUP_INIT(GQueue *metrics, statistics_free_metrics, statistics_gather_metrics(NULL));
AUTO_CLEANUP_INIT(GString *outp, __g_string_free, g_string_new(""));
g_autoptr(GString) outp = g_string_new("");
AUTO_CLEANUP_INIT(GHashTable *metric_types, __g_hash_table_destroy,
g_hash_table_new(g_str_hash, g_str_equal));


+ 0
- 6
lib/auxlib.h View File

@ -341,12 +341,6 @@ INLINE void g_tree_clear(GTree *t) {
g_tree_remove(t, k);
}
}
INLINE void g_string_free_true(GString *s) {
g_string_free(s, TRUE);
}
INLINE void __g_string_free(GString **s) {
g_string_free(*s, TRUE);
}
INLINE void __g_hash_table_destroy(GHashTable **s) {
g_hash_table_destroy(*s);
}


Loading…
Cancel
Save