aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-16 10:18:42 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-16 10:18:42 +0200
commit967e4dd2c357b3b3ff716fa6c77e7b7350f81711 (patch)
tree40f4e3f323c8d4f5bfd3f7abd0abfa73b436e469
parent0a9639012204a79bf5ae4c103a6de083e7e488d6 (diff)
llc: Make timeval arguments const
Some struct timeval pointer arguments do not have the const qualifier, albeit the methods do not write to the structures. The next commit will change related pointers to const, so this commit provides the required constness. Sponsored-by: On-Waves ehf
-rw-r--r--src/gprs_bssgp_pcu.cpp4
-rw-r--r--src/gprs_bssgp_pcu.h4
-rw-r--r--src/llc.cpp3
-rw-r--r--src/llc.h6
4 files changed, 10 insertions, 7 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 802ca9a4..dcb1b5b8 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -804,8 +804,8 @@ struct bssgp_bvc_ctx *gprs_bssgp_pcu_current_bctx(void)
return the_pcu.bctx;
}
-void gprs_bssgp_update_queue_delay(struct timeval *tv_recv,
- struct timeval *tv_now)
+void gprs_bssgp_update_queue_delay(const struct timeval *tv_recv,
+ const struct timeval *tv_now)
{
struct timeval *delay_sum = &the_pcu.queue_delay_sum;
struct timeval tv_delay;
diff --git a/src/gprs_bssgp_pcu.h b/src/gprs_bssgp_pcu.h
index 32be7650..112a8888 100644
--- a/src/gprs_bssgp_pcu.h
+++ b/src/gprs_bssgp_pcu.h
@@ -83,7 +83,7 @@ void gprs_bssgp_destroy(void);
struct bssgp_bvc_ctx *gprs_bssgp_pcu_current_bctx(void);
-void gprs_bssgp_update_queue_delay(struct timeval *tv_recv,
- struct timeval *tv_now);
+void gprs_bssgp_update_queue_delay(const struct timeval *tv_recv,
+ const struct timeval *tv_now);
#endif // GPRS_BSSGP_PCU_H
diff --git a/src/llc.cpp b/src/llc.cpp
index 3388db1f..8930d2c8 100644
--- a/src/llc.cpp
+++ b/src/llc.cpp
@@ -175,7 +175,8 @@ void gprs_llc_queue::calc_pdu_lifetime(BTS *bts, const uint16_t pdu_delay_csec,
timeradd(&now, &csec, tv);
}
-bool gprs_llc_queue::is_frame_expired(struct timeval *tv_now, struct timeval *tv)
+bool gprs_llc_queue::is_frame_expired(const struct timeval *tv_now,
+ const struct timeval *tv)
{
/* Timeout is infinite */
if (tv->tv_sec == 0 && tv->tv_usec == 0)
diff --git a/src/llc.h b/src/llc.h
index bd717739..065589db 100644
--- a/src/llc.h
+++ b/src/llc.h
@@ -63,8 +63,10 @@ struct gprs_llc {
* I store the LLC frames that come from the SGSN.
*/
struct gprs_llc_queue {
- static void calc_pdu_lifetime(BTS *bts, const uint16_t pdu_delay_csec, struct timeval *tv);
- static bool is_frame_expired(struct timeval *now, struct timeval *tv);
+ static void calc_pdu_lifetime(BTS *bts, const uint16_t pdu_delay_csec,
+ struct timeval *tv);
+ static bool is_frame_expired(const struct timeval *now,
+ const struct timeval *tv);
static bool is_user_data_frame(uint8_t *data, size_t len);
void init();