move BTS-specific timezone override into sub-structure
Group all three structure members involved in bts-specific timezone
handling into a sub-structure.
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 9bdc39c..c868d7c 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -717,18 +717,18 @@
ptr8[5] = bcdify(gmt_time->tm_min);
ptr8[6] = bcdify(gmt_time->tm_sec);
- if (bts->tz_bts_specific) {
- /* Convert tzhr and tzmn to units */
- if (bts->tzhr < 0) {
- tzunits = ((bts->tzhr/-1)*4);
- tzunits = tzunits + (bts->tzmn/15);
+ if (bts->tz.override) {
+ /* Convert tz.hr and tz.mn to units */
+ if (bts->tz.hr < 0) {
+ tzunits = ((bts->tz.hr/-1)*4);
+ tzunits = tzunits + (bts->tz.mn/15);
ptr8[7] = bcdify(tzunits);
/* Set negative time */
ptr8[7] |= 0x08;
}
else {
- tzunits = bts->tzhr*4;
- tzunits = tzunits + (bts->tzmn/15);
+ tzunits = bts->tz.hr*4;
+ tzunits = tzunits + (bts->tz.mn/15);
ptr8[7] = bcdify(tzunits);
}
}