From d7e3dbcd5b0ac44106021ddb22b34d1695f38de3 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 26 Jun 2018 04:24:49 +0200 Subject: apply code review Change-Id: I54fe9a7d146b55dde38f19dfedfb5b356813006b --- src/osmo-bsc/gsm_timers.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/osmo-bsc/gsm_timers.c') diff --git a/src/osmo-bsc/gsm_timers.c b/src/osmo-bsc/gsm_timers.c index 2f737934c..72cf7ef01 100644 --- a/src/osmo-bsc/gsm_timers.c +++ b/src/osmo-bsc/gsm_timers.c @@ -95,9 +95,9 @@ static int T_round(int val, enum T_unit from_unit, enum T_unit to_unit) * * val = T_def_get(global_T_defs, 99, T_S, 3); // not defined, returns 3 */ -int T_def_get(struct T_def *T_defs, int T, enum T_unit as_unit, int val_if_not_present) +int T_def_get(const struct T_def *T_defs, int T, enum T_unit as_unit, int val_if_not_present) { - struct T_def *d = T_def_get_entry(T_defs, T); + const struct T_def *d = T_def_get_entry((struct T_def*)T_defs, T); if (!d) { OSMO_ASSERT(val_if_not_present >= 0); return val_if_not_present; @@ -142,9 +142,10 @@ struct T_def *T_def_get_entry(struct T_def *T_defs, int T) * The intention is then to obtain the timer like T_def_get(global_T_defs, T=235); see also * fsm_inst_state_chg_T() below. */ -struct state_timeout *get_state_timeout(uint32_t state, struct state_timeout *timeouts_array) +const struct state_timeout *get_state_timeout(uint32_t state, + const struct state_timeout *timeouts_array) { - struct state_timeout *t; + const struct state_timeout *t; OSMO_ASSERT(state < 32); t = &timeouts_array[state]; if (!t->keep_timer && !t->T) @@ -176,11 +177,11 @@ struct state_timeout *get_state_timeout(uint32_t state, struct state_timeout *ti * */ int _fsm_inst_state_chg_T(struct osmo_fsm_inst *fi, uint32_t state, - struct state_timeout *timeouts_array, - struct T_def *T_defs, int default_timeout, + const struct state_timeout *timeouts_array, + const struct T_def *T_defs, int default_timeout, const char *file, int line) { - struct state_timeout *t = get_state_timeout(state, timeouts_array); + const struct state_timeout *t = get_state_timeout(state, timeouts_array); int val; /* No timeout defined for this state? */ -- cgit v1.2.3