diff --git a/src/bts.cpp b/src/bts.cpp index 6100248e..9886cf62 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -416,7 +416,7 @@ int BTS::rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn) int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta) { - struct gprs_rlcmac_ul_tbf *tbf; + struct gprs_rlcmac_ul_tbf *tbf = NULL; uint8_t trx_no, ts_no = 0; int8_t tfi; /* must be signed */ uint8_t sb = 0; diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index d711ad89..dcc33712 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -71,8 +71,6 @@ static void test_alloc_a(gprs_rlcmac_tbf_direction dir, const int count) * least this part is working okay. */ for (int i = 0; i < count; ++i) { - struct gprs_rlcmac_tbf *tbf; - tfi = the_bts.tfi_find_free(dir, &used_trx, 0); OSMO_ASSERT(tfi >= 0); tbfs[i] = tbf_alloc(bts, NULL, dir, tfi, used_trx, 0, 0); @@ -90,7 +88,7 @@ static void test_alloc_a(gprs_rlcmac_tbf_direction dir, const int count) } OSMO_ASSERT(!tbf_alloc(bts, NULL, dir, tfi, used_trx, 0, 0)); - for (int i = 0; i < ARRAY_SIZE(tbfs); ++i) + for (size_t i = 0; i < ARRAY_SIZE(tbfs); ++i) if (tbfs[i]) tbf_free(tbfs[i]); @@ -110,7 +108,7 @@ static void test_alloc_a() static void dump_assignment(struct gprs_rlcmac_tbf *tbf, const char *dir) { - for (int i = 0; i < ARRAY_SIZE(tbf->pdch); ++i) + for (size_t i = 0; i < ARRAY_SIZE(tbf->pdch); ++i) if (tbf->pdch[i]) printf("PDCH[%d] is used for %s\n", i, dir); printf("PDCH[%d] is control_ts for %s\n", tbf->control_ts, dir); @@ -131,7 +129,7 @@ static void test_alloc_b(int ms_class) struct gprs_rlcmac_bts *bts; struct gprs_rlcmac_trx *trx; int tfi; - uint8_t ts_no, trx_no; + uint8_t trx_no; gprs_rlcmac_tbf *ul_tbf, *dl_tbf; @@ -172,7 +170,7 @@ static void test_alloc_b(int ms_class) struct gprs_rlcmac_bts *bts; struct gprs_rlcmac_trx *trx; int tfi; - uint8_t ts_no, trx_no; + uint8_t trx_no; gprs_rlcmac_ul_tbf *ul_tbf; gprs_rlcmac_dl_tbf *dl_tbf; @@ -221,7 +219,7 @@ static void test_alloc_b(int ms_class) struct gprs_rlcmac_bts *bts; struct gprs_rlcmac_trx *trx; int tfi; - uint8_t ts_no, trx_no; + uint8_t trx_no; gprs_rlcmac_tbf *ul_tbf, *dl_tbf; @@ -282,7 +280,7 @@ static void test_alloc_b(bool ts0, bool ts1, bool ts2, bool ts3, bool ts4, bool struct gprs_rlcmac_bts *bts; struct gprs_rlcmac_trx *trx; int tfi; - uint8_t ts_no, trx_no; + uint8_t trx_no; gprs_rlcmac_tbf *ul_tbf, *dl_tbf; @@ -326,7 +324,7 @@ static void test_alloc_b(bool ts0, bool ts1, bool ts2, bool ts3, bool ts4, bool struct gprs_rlcmac_bts *bts; struct gprs_rlcmac_trx *trx; int tfi; - uint8_t ts_no, trx_no; + uint8_t trx_no; gprs_rlcmac_ul_tbf *ul_tbf; gprs_rlcmac_dl_tbf *dl_tbf; diff --git a/tests/emu/pcu_emu.cpp b/tests/emu/pcu_emu.cpp index ed0abbe6..3dfa64dc 100644 --- a/tests/emu/pcu_emu.cpp +++ b/tests/emu/pcu_emu.cpp @@ -106,8 +106,6 @@ void create_and_connect_bssgp(struct gprs_rlcmac_bts *bts, int main(int argc, char **argv) { - struct gprs_rlcmac_bts *bts; - tall_pcu_ctx = talloc_named_const(NULL, 1, "moiji-mobile Emu-PCU context"); if (!tall_pcu_ctx) abort(); diff --git a/tests/emu/test_pdp_activation.cpp b/tests/emu/test_pdp_activation.cpp index 673874f5..8c885e58 100644 --- a/tests/emu/test_pdp_activation.cpp +++ b/tests/emu/test_pdp_activation.cpp @@ -92,10 +92,8 @@ static enum state current_state = Test_Start; static void extract_tmsi_and_generate_tlli(struct msgb *msg, struct tlv_parsed *tp) { uint32_t tmsi; - struct bssgp_ud_hdr *budh; struct gprs_llc_hdr_parsed hp; struct tlv_parsed ack_tp; - int rc; gprs_llc_hdr_parse(&hp, TLVP_VAL(tp, BSSGP_IE_LLC_PDU), TLVP_LEN(tp, BSSGP_IE_LLC_PDU)); @@ -105,7 +103,7 @@ static void extract_tmsi_and_generate_tlli(struct msgb *msg, struct tlv_parsed * OSMO_ASSERT(gh->msg_type == GSM48_MT_GMM_ATTACH_ACK); struct gsm48_attach_ack *ack = (struct gsm48_attach_ack *) gh->data; - rc = tlv_parse(&ack_tp, &gsm48_gmm_att_tlvdef, ack->data, + tlv_parse(&ack_tp, &gsm48_gmm_att_tlvdef, ack->data, (msg->data + msg->len) - ack->data, 0, 0); diff --git a/tests/emu/test_replay_gprs_attach.cpp b/tests/emu/test_replay_gprs_attach.cpp index 8d29a72f..c5098bcb 100644 --- a/tests/emu/test_replay_gprs_attach.cpp +++ b/tests/emu/test_replay_gprs_attach.cpp @@ -44,7 +44,7 @@ static const uint8_t gprs_attach_llc[] = { 0x42, 0x00, 0x40, 0xaa, 0xf3, 0x18 }; -static int next_wanted_nu; +static uint32_t next_wanted_nu; void test_replay_gprs_attach(struct gprs_bssgp_pcu *pcu) { diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 8a464b1f..be991474 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -316,8 +316,6 @@ static void test_rlc_dl_ul_basic() } { - int count; - uint8_t rbb[8]; uint16_t lost = 0, recv = 0; char show_rbb[65]; BTS dummy_bts;