From 2b22daa445ca919e42d327fe2ac5ca31277e9163 Mon Sep 17 00:00:00 2001 From: zhenghuangkun Date: Fri, 11 Sep 2020 05:38:30 +0000 Subject: [PATCH] Fix Warning --- openair3/NGAP/ngap_gNB.c | 5 +++-- openair3/NGAP/ngap_gNB_defs.h | 2 +- openair3/NGAP/ngap_gNB_handlers.c | 4 ++-- openair3/UTILS/conversions.h | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/openair3/NGAP/ngap_gNB.c b/openair3/NGAP/ngap_gNB.c index bc0fcba115..31e370d4a1 100644 --- a/openair3/NGAP/ngap_gNB.c +++ b/openair3/NGAP/ngap_gNB.c @@ -471,10 +471,11 @@ static int ngap_gNB_generate_ng_setup_request( ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.present = NGAP_GNB_ID_PR_gNB_ID; MACRO_GNB_ID_TO_BIT_STRING(instance_p->gNB_id, &ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.choice.gNB_ID); - NGAP_INFO("%d -> %02x%02x%02x\n", instance_p->gNB_id, + NGAP_INFO("%u -> %02x%02x%02x%02x\n", instance_p->gNB_id, ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.choice.gNB_ID.buf[0], ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.choice.gNB_ID.buf[1], - ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.choice.gNB_ID.buf[2]); + ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.choice.gNB_ID.buf[2], + ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.choice.gNB_ID.buf[3]); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); /* optional */ diff --git a/openair3/NGAP/ngap_gNB_defs.h b/openair3/NGAP/ngap_gNB_defs.h index 4316e61867..31e948c1b5 100644 --- a/openair3/NGAP/ngap_gNB_defs.h +++ b/openair3/NGAP/ngap_gNB_defs.h @@ -245,7 +245,7 @@ typedef struct ngap_gNB_instance_s { * In our case the gNB is a macro gNB so the id will be 20 bits long. * For Home gNB id, this field should be 36 bits long. */ - uint64_t gNB_id; + uint32_t gNB_id; /* The type of the cell */ enum cell_type_e cell_type; diff --git a/openair3/NGAP/ngap_gNB_handlers.c b/openair3/NGAP/ngap_gNB_handlers.c index ca535651f8..a3940a1e81 100644 --- a/openair3/NGAP/ngap_gNB_handlers.c +++ b/openair3/NGAP/ngap_gNB_handlers.c @@ -334,7 +334,7 @@ int ngap_gNB_handle_ng_setup_response(uint32_t assoc_id, for (i = 0; i < ie->value.choice.ServedGUAMIList.list.count; i++) { NGAP_ServedGUAMIItem_t *guami_item_p; struct served_guami_s *new_guami_p; - int j; + guami_item_p = ie->value.choice.ServedGUAMIList.list.array[i]; new_guami_p = calloc(1, sizeof(struct served_guami_s)); STAILQ_INIT(&new_guami_p->served_plmns); @@ -1008,7 +1008,7 @@ int ngap_gNB_handle_initial_context_request(uint32_t assoc_id, break; default: - NGAP_ERROR("could not found protocolIEs id %d\n", pdusessionTransfer_ies->id); + NGAP_ERROR("could not found protocolIEs id %ld\n", pdusessionTransfer_ies->id); return -1; } } diff --git a/openair3/UTILS/conversions.h b/openair3/UTILS/conversions.h index 83ae55a00c..cfb2c8cdfc 100644 --- a/openair3/UTILS/conversions.h +++ b/openair3/UTILS/conversions.h @@ -508,9 +508,9 @@ do { \ do { \ (bITsTRING)->buf = calloc(4, sizeof(uint8_t)); \ (bITsTRING)->buf[0] = ((mACRO) >> 20); \ - (bITsTRING)->buf[1] = (mACRO) >> 12; \ - (bITsTRING)->buf[3] = (mACRO) >> 4; \ - (bITsTRING)->buf[4] = ((mACRO) & 0x0f) << 4; \ + (bITsTRING)->buf[1] = (mACRO) >> 12; \ + (bITsTRING)->buf[2] = (mACRO) >> 4; \ + (bITsTRING)->buf[3] = ((mACRO) & 0x0f) << 4; \ (bITsTRING)->size = 4; \ (bITsTRING)->bits_unused = 4; \ } while(0)