summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-01-07 14:53:18 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-01-07 14:53:18 +0100
commit6af20842cb3a384338dbe4a3d049b20573207f4c (patch)
treef72773dded6cbe2e1a905cc34e991b395831b301
parentcc41cb07e78bebe51e553eacc50e69ac3eb08153 (diff)
[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.
-rw-r--r--openbsc/src/bssap.c8
1 files 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");