From 775ac6f6b1c47066db58608f9497f0e4916bbcc4 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 27 Jul 2017 13:50:31 +0200 Subject: constify ss7_instance arg of osmo_ss7_pointcode_print() Change-Id: I8c6b7188d004033e75e9c41f4a65c418d13a79c5 --- include/osmocom/sigtran/osmo_ss7.h | 4 ++-- src/osmo_ss7.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 967912a..a457709 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -23,8 +23,8 @@ int osmo_ss7_find_free_rctx(struct osmo_ss7_instance *inst); 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); /* All known point-code formats have a length of or below 24 bit. * A point-code value exceeding that is used to indicate an unset PC. */ diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index f82f952..7b0b0e4 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -245,7 +245,7 @@ err: 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; unsigned int num_comp_exp; @@ -269,7 +269,7 @@ const char *_osmo_ss7_pointcode_print(char *buf, size_t len, struct osmo_ss7_ins /* 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); @@ -277,7 +277,7 @@ const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc /* 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); -- cgit v1.2.3