[PATCH] libosmo-sccp[master]: constify ss7_instance arg of osmo_ss7_pointcode_print()

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Jul 27 13:41:14 UTC 2017


Review at  https://gerrit.osmocom.org/3361

constify ss7_instance arg of osmo_ss7_pointcode_print()

Change-Id: I8c6b7188d004033e75e9c41f4a65c418d13a79c5
---
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7.c
2 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/61/3361/1

diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index 27e42eb..cb30f79 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -23,8 +23,8 @@
 bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc);
 int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str);
 int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in);
-const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc);
-const char *osmo_ss7_pointcode_print2(struct osmo_ss7_instance *inst, uint32_t pc);
+const char *osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc);
+const char *osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc);
 
 /***********************************************************************
  * SS7 Routing Tables
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index ee2b212..de99009 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -245,7 +245,7 @@
 	return -EINVAL;
 }
 
-const char *_osmo_ss7_pointcode_print(char *buf, size_t len, struct osmo_ss7_instance *inst, uint32_t pc)
+const char *_osmo_ss7_pointcode_print(char *buf, size_t len, const struct osmo_ss7_instance *inst, uint32_t pc)
 {
 	const struct osmo_ss7_pc_fmt *pc_fmt = inst ? &inst->cfg.pc_fmt : &default_pc_fmt;
 	unsigned int num_comp_exp = num_pc_comp_exp(pc_fmt);
@@ -263,7 +263,7 @@
 
 /* print a pointcode according to the structure configured for this
  * ss7_instance */
-const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc)
+const char *osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc)
 {
 	static char buf[MAX_PC_STR_LEN];
 	return _osmo_ss7_pointcode_print(buf, sizeof(buf), inst, pc);
@@ -271,7 +271,7 @@
 
 /* same as osmo_ss7_pointcode_print() but using a separate buffer, useful for multiple point codes in the
  * same LOGP/printf. */
-const char *osmo_ss7_pointcode_print2(struct osmo_ss7_instance *inst, uint32_t pc)
+const char *osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc)
 {
 	static char buf[MAX_PC_STR_LEN];
 	return _osmo_ss7_pointcode_print(buf, sizeof(buf), inst, pc);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c6b7188d004033e75e9c41f4a65c418d13a79c5
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list