From 0af6a32d98640742c14cb7ea3506c3070e25b9f0 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Thu, 7 Mar 2013 15:25:48 +0100 Subject: Fix of several compiler warnings --- openbsc/src/gprs/gb_proxy.c | 2 ++ openbsc/src/gprs/gprs_gmm.c | 9 ++++++++- openbsc/src/gprs/gprs_llc.c | 8 ++++++++ openbsc/src/gprs/gprs_sndcp.c | 2 +- openbsc/src/gprs/gprs_sndcp_vty.c | 2 -- openbsc/src/gprs/sgsn_main.c | 4 ++++ openbsc/src/libbsc/abis_nm.c | 4 +++- openbsc/src/libbsc/bsc_api.c | 3 ++- openbsc/tests/mgcp/mgcp_test.c | 2 +- 9 files changed, 29 insertions(+), 7 deletions(-) diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index b99c455e2..d753abed1 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -113,11 +113,13 @@ static struct gbprox_peer *peer_alloc(uint16_t bvci) return peer; } +#if 0 static void peer_free(struct gbprox_peer *peer) { llist_del(&peer->list); talloc_free(peer); } +#endif /* FIXME: this needs to go to libosmocore/msgb.c */ static struct msgb *msgb_copy(const struct msgb *msg, const char *name) diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index f7a5cde00..1f4d22c0f 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -347,7 +347,10 @@ static int gsm48_tx_gmm_att_ack(struct sgsn_mm_ctx *mm) struct msgb *msg = gsm48_msgb_alloc(); struct gsm48_hdr *gh; struct gsm48_attach_ack *aa; - uint8_t *ptsig, *mid; + uint8_t *mid; +#if 0 + uint8_t *ptsig; +#endif DEBUGP(DMM, "<- GPRS ATTACH ACCEPT (new P-TMSI=0x%08x)\n", mm->p_tmsi); @@ -454,6 +457,7 @@ static int gsm48_tx_gmm_id_req(struct sgsn_mm_ctx *mm, uint8_t id_type) return gsm48_gmm_sendmsg(msg, 1, mm); } +#if 0 /* Section 9.4.9: Authentication and Ciphering Request */ static int gsm48_tx_gmm_auth_ciph_req(struct sgsn_mm_ctx *mm, uint8_t *rand, uint8_t key_seq, uint8_t algo) @@ -513,6 +517,7 @@ static int gsm48_tx_gmm_auth_ciph_rej(struct sgsn_mm_ctx *mm) return gsm48_gmm_sendmsg(msg, 0, mm); } +#endif /* Section 9.4.10: Authentication and Ciphering Response */ static int gsm48_rx_gmm_auth_ciph_resp(struct sgsn_mm_ctx *ctx, @@ -1166,6 +1171,7 @@ static void pdpctx_timer_start(struct sgsn_pdp_ctx *pdp, unsigned int T, } +#if 0 static void msgb_put_pdp_addr_ipv4(struct msgb *msg, uint32_t ipaddr) { uint8_t v[6]; @@ -1186,6 +1192,7 @@ static void msgb_put_pdp_addr_ppp(struct msgb *msg) msgb_tlv_put(msg, GSM48_IE_GSM_PDP_ADDR, sizeof(v), v); } +#endif /* Section 9.5.2: Ativate PDP Context Accept */ int gsm48_tx_gsm_act_pdp_acc(struct sgsn_pdp_ctx *pdp) diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c index 8af5367e4..3075573e9 100644 --- a/openbsc/src/gprs/gprs_llc.c +++ b/openbsc/src/gprs/gprs_llc.c @@ -261,6 +261,7 @@ static int gprs_llc_fcs(uint8_t *data, unsigned int len) return fcs_calc; } +#if 0 static void t200_expired(void *data) { struct gprs_llc_lle *lle = data; @@ -283,6 +284,8 @@ static void t200_expired(void *data) /* FIXME: re-start T200 */ lle->retrans_ctr++; break; + default: + ; } } @@ -297,6 +300,7 @@ static void t201_expired(void *data) lle->retrans_ctr++; } } +#endif int gprs_llc_tx_u(struct msgb *msg, uint8_t sapi, int command, enum gprs_llc_u_cmd u_cmd, int pf_bit) @@ -571,6 +575,8 @@ static int gprs_llc_hdr_rx(struct gprs_llc_hdr_parsed *gph, if ((gph->seq_tx + 1) / 512) lle->oc_ui_recv += 512; break; + default: + ; } return 0; @@ -739,7 +745,9 @@ static int gprs_llc_hdr_parse(struct gprs_llc_hdr_parsed *ghp, /* receive an incoming LLC PDU (BSSGP-UL-UNITDATA-IND, 7.2.4.2) */ int gprs_llc_rcvmsg(struct msgb *msg, struct tlv_parsed *tv) { +#if 0 struct bssgp_ud_hdr *udh = (struct bssgp_ud_hdr *) msgb_bssgph(msg); +#endif struct gprs_llc_hdr *lh = (struct gprs_llc_hdr *) msgb_llch(msg); struct gprs_llc_hdr_parsed llhp; struct gprs_llc_lle *lle; diff --git a/openbsc/src/gprs/gprs_sndcp.c b/openbsc/src/gprs/gprs_sndcp.c index 853f8dbc9..e901ceb96 100644 --- a/openbsc/src/gprs/gprs_sndcp.c +++ b/openbsc/src/gprs/gprs_sndcp.c @@ -561,6 +561,7 @@ int sndcp_llunitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle, return sgsn_rx_sndcp_ud_ind(&sne->ra_id, lle->llme->tlli, sne->nsapi, msg, npdu_len, npdu); } +#if 0 /* Section 5.1.2.1 LL-RESET.ind */ static int sndcp_ll_reset_ind(struct gprs_sndcp_entity *se) { @@ -577,7 +578,6 @@ static int sndcp_ll_status_ind() return 0; } -#if 0 static struct sndcp_state_list {{ uint32_t states; unsigned int type; diff --git a/openbsc/src/gprs/gprs_sndcp_vty.c b/openbsc/src/gprs/gprs_sndcp_vty.c index 28fdc635b..deeef071a 100644 --- a/openbsc/src/gprs/gprs_sndcp_vty.c +++ b/openbsc/src/gprs/gprs_sndcp_vty.c @@ -43,8 +43,6 @@ static void vty_dump_sne(struct vty *vty, struct gprs_sndcp_entity *sne) { - unsigned int i; - vty_out(vty, " TLLI %08x SAPI=%u NSAPI=%u:%s", sne->lle->llme->tlli, sne->lle->sapi, sne->nsapi, VTY_NEWLINE); vty_out(vty, " Defrag: npdu=%u highest_seg=%u seg_have=0x%08x tot_len=%u%s", diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c index 9d42648a4..040e1d713 100644 --- a/openbsc/src/gprs/sgsn_main.c +++ b/openbsc/src/gprs/sgsn_main.c @@ -55,6 +55,10 @@ #include "../../bscconfig.h" +/* FIXME: put into seperate header file */ +int gprs_sndcp_vty_init(void); +int sgsn_gtp_init(struct sgsn_instance *sgi); + /* this is here for the vty... it will never be called */ void subscr_put() { abort(); } diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index ee1fc9c98..a2e9f0d5d 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -1745,12 +1745,14 @@ static int __simple_cmd(struct gsm_bts *bts, uint8_t msg_type) int abis_nm_opstart(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, uint8_t i1, uint8_t i2) { struct abis_om_hdr *oh; + struct abis_om_fom_hdr *foh; struct msgb *msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); + foh = (struct abis_om_fom_hdr *) oh->data; fill_om_fom_hdr(oh, 0, NM_MT_OPSTART, obj_class, i0, i1, i2); - abis_nm_debugp_foh(DNM, (struct abis_om_fom_hdr *) oh->data); + abis_nm_debugp_foh(DNM, foh); DEBUGPC(DNM, "Sending OPSTART\n"); return abis_nm_sendmsg(bts, msg); diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c index 86d249376..bde13b929 100644 --- a/openbsc/src/libbsc/bsc_api.c +++ b/openbsc/src/libbsc/bsc_api.c @@ -88,7 +88,8 @@ static uint8_t lchan_to_chosen_channel(struct gsm_lchan *lchan) channel = 0x9; break; case GSM_LCHAN_UNKNOWN: - LOGP(DMSC, LOGL_ERROR, "Unknown lchan type: %p\n", lchan); + default: + LOGP(DMSC, LOGL_ERROR, "Unknown lchan type: %u\n", lchan->type); break; } diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c index 5565e7316..6307300f1 100644 --- a/openbsc/tests/mgcp/mgcp_test.c +++ b/openbsc/tests/mgcp/mgcp_test.c @@ -148,7 +148,7 @@ static struct msgb *create_msg(const char *str) struct msgb *msg; msg = msgb_alloc_headroom(4096, 128, "MGCP msg"); - int len = sprintf((char *)msg->data, str); + int len = sprintf((char *)msg->data, "%s", str); msg->l2h = msgb_put(msg, len); return msg; } -- cgit v1.2.3