aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-11-17 06:09:56 +0100
committerHarald Welte <laforge@gnumonks.org>2009-11-17 06:09:56 +0100
commitd8cfc90e22e0645bda0c5f581c68181c3be9079b (patch)
treeb2475a34c5f514266884805fb73cdbeab551f19c /openbsc
parentb54d950ac17ec1836a845abda92cf3061cd8ee59 (diff)
[abis_nm] avoid integer-to-pointer casting and associated gcc warnings
Diffstat (limited to 'openbsc')
-rwxr-xr-xopenbsc/src/abis_nm.c4
-rw-r--r--openbsc/src/bsc_init.c7
-rw-r--r--openbsc/src/ipaccess-config.c7
3 files changed, 12 insertions, 6 deletions
diff --git a/openbsc/src/abis_nm.c b/openbsc/src/abis_nm.c
index 1bd38de17..4d4cec0a3 100755
--- a/openbsc/src/abis_nm.c
+++ b/openbsc/src/abis_nm.c
@@ -1036,7 +1036,7 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
else
DEBUGPC(DNM, "\n");
- dispatch_signal(SS_NM, S_NM_NACK, (void*) ((long)mt));
+ dispatch_signal(SS_NM, S_NM_NACK, (void*) &mt);
return 0;
}
#if 0
@@ -2601,7 +2601,7 @@ static int abis_nm_rx_ipacc(struct msgb *msg)
case NM_MT_IPACC_RSL_CONNECT_NACK:
case NM_MT_IPACC_SET_NVATTR_NACK:
case NM_MT_IPACC_GET_NVATTR_NACK:
- dispatch_signal(SS_NM, S_NM_IPACC_NACK, (void*) ((long)foh->msg_type));
+ dispatch_signal(SS_NM, S_NM_IPACC_NACK, &foh->msg_type);
break;
default:
break;
diff --git a/openbsc/src/bsc_init.c b/openbsc/src/bsc_init.c
index 815fe2b6e..bb1e382f0 100644
--- a/openbsc/src/bsc_init.c
+++ b/openbsc/src/bsc_init.c
@@ -443,7 +443,7 @@ static int sw_activ_rep(struct msgb *mb)
}
/* Callback function for NACK on the OML NM */
-static int oml_msg_nack(int mt)
+static int oml_msg_nack(u_int8_t mt)
{
if (mt == NM_MT_SET_BTS_ATTR_NACK) {
fprintf(stderr, "Failed to set BTS attributes. That is fatal. "
@@ -458,11 +458,14 @@ static int oml_msg_nack(int mt)
static int nm_sig_cb(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data)
{
+ u_int8_t *msg_type;
+
switch (signal) {
case S_NM_SW_ACTIV_REP:
return sw_activ_rep(signal_data);
case S_NM_NACK:
- return oml_msg_nack((int)signal_data);
+ msg_type = signal_data;
+ return oml_msg_nack(*msg_type);
default:
break;
}
diff --git a/openbsc/src/ipaccess-config.c b/openbsc/src/ipaccess-config.c
index 49c0ea31f..1b2aa5e34 100644
--- a/openbsc/src/ipaccess-config.c
+++ b/openbsc/src/ipaccess-config.c
@@ -61,7 +61,7 @@ static u_int8_t unit_id_attr[] = { 0x91, 0x00, 9, '2', '3', '4', '2', '/' , '0',
* result. The nanoBTS will send us a NACK when we did something the
* BTS didn't like.
*/
-static int ipacc_msg_nack(int mt)
+static int ipacc_msg_nack(u_int8_t mt)
{
fprintf(stderr, "Failure to set attribute. This seems fatal\n");
exit(-1);
@@ -149,9 +149,12 @@ static int test_rep(void *_msg)
static int nm_sig_cb(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data)
{
+ u_int8_t *msg_type;
+
switch (signal) {
case S_NM_IPACC_NACK:
- return ipacc_msg_nack((int)signal_data);
+ msg_type = signal_data;
+ return ipacc_msg_nack(*msg_type);
case S_NM_TEST_REP:
return test_rep(signal_data);
default: