From 6af20842cb3a384338dbe4a3d049b20573207f4c Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 7 Jan 2010 14:53:18 +0100 Subject: [bssap] Return u_int16_t from the get_*_code methods The LAI generation wants to have 16bit unsigned, just keep them like this already. This means the int32_t will be truncated inside the get_*_code methods which is better than doing it somewhere else. --- openbsc/src/bssap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openbsc/src/bssap.c b/openbsc/src/bssap.c index ae24a896e..1727be43b 100644 --- a/openbsc/src/bssap.c +++ b/openbsc/src/bssap.c @@ -63,14 +63,14 @@ static const struct tlv_definition bss_att_tlvdef = { }, }; -static int get_network_code_for_msc(struct gsm_network *net) +static u_int16_t get_network_code_for_msc(struct gsm_network *net) { if (net->core_network_code > 0) return net->core_network_code; return net->network_code; } -static int get_country_code_for_msc(struct gsm_network *net) +static u_int16_t get_country_code_for_msc(struct gsm_network *net) { if (net->core_country_code > 0) return net->core_country_code; @@ -595,8 +595,8 @@ struct msgb *bssmap_create_layer3(struct msgb *msg_l3) struct msgb* msg; struct gsm48_loc_area_id *lai; struct gsm_bts *bts = msg_l3->lchan->ts->trx->bts; - int network_code = get_network_code_for_msc(bts->network); - int country_code = get_country_code_for_msc(bts->network); + u_int16_t network_code = get_network_code_for_msc(bts->network); + u_int16_t country_code = get_country_code_for_msc(bts->network); msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, "bssmap cmpl l3"); -- cgit v1.2.3