[MERGED] osmo-mgw[master]: cosmetic: rename function .._conn_reset() to .._conn_init()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Mar 19 20:33:19 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: rename function .._conn_reset() to .._conn_init()
......................................................................


cosmetic: rename function .._conn_reset() to .._conn_init()

We do allocate connections dynamically and we initialize them
once by calling mgcp_rtp_conn_reset(). Calling this a reset
function implies that the reset happens multiple times while
the struct lives. This is not tha case, so lets change the
suffix to _init()

- rename mgcp_rtp_conn_reset() to mgcp_rtp_conn_init()

Change-Id: Ie48b575ff81c8f48afcc25f485967e011e90027b
---
M include/osmocom/mgcp/mgcp_internal.h
M src/libosmo-mgcp/mgcp_conn.c
2 files changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h
index e4009e8..0da2c56 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -27,6 +27,7 @@
 #include <osmocom/core/select.h>
 #include <osmocom/mgcp/mgcp.h>
 #include <osmocom/core/linuxlist.h>
+#include <osmocom/core/counter.h>
 
 #define CI_UNUSED 0
 
diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 62cbdba..cfd8170 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -83,8 +83,8 @@
 	talloc_free(codec->audio_name);
 }
 
-/* Reset states, free memory, set defaults and reset codec state */
-static void mgcp_rtp_conn_reset(struct mgcp_conn_rtp *conn)
+/* Initialize rtp connection struct with default values */
+static void mgcp_rtp_conn_init(struct mgcp_conn_rtp *conn)
 {
 	struct mgcp_rtp_end *end = &conn->end;
 
@@ -141,7 +141,7 @@
 
 	switch (type) {
 	case MGCP_CONN_TYPE_RTP:
-		mgcp_rtp_conn_reset(&conn->u.rtp);
+		mgcp_rtp_conn_init(&conn->u.rtp);
 		break;
 	default:
 		/* NOTE: This should never be called with an

-- 
To view, visit https://gerrit.osmocom.org/7392
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie48b575ff81c8f48afcc25f485967e011e90027b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list