From 356785afc393ae0a673619d7766aa82575976a77 Mon Sep 17 00:00:00 2001
From: Cedric Roux <cedric.roux@eurecom.fr>
Date: Thu, 14 Nov 2013 14:29:05 +0000
Subject: [PATCH] - Fixed some more compiler warnings

pre-ci tests passed

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4401 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair1/PHY/LTE_ESTIMATION/defs.h       |  5 +++++
 openair1/PHY/LTE_TRANSPORT/pbch.c        |  9 ++++++++-
 openair1/PHY/LTE_TRANSPORT/pmch.c        |  3 ++-
 openair1/PHY/MODULATION/slot_fep_mbsfn.c |  4 ++--
 openair2/LAYER2/MAC/ra_procedures.c      |  3 ---
 openair2/LAYER2/MAC/rar_tools.c          |  3 +++
 openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c |  8 ++++++--
 openair2/LAYER2/openair2_proc.c          |  2 +-
 openair2/UTIL/LOG/log.c                  |  4 ++--
 openair2/UTIL/OMG/id_manager.c           |  8 ++++----
 openair2/UTIL/OMG/socket_traci_OMG.c     |  2 +-
 openair2/UTIL/OMG/sumo.c                 |  2 +-
 openair2/UTIL/OMG/trace.c                |  5 ++---
 openair2/UTIL/OPT/opt.h                  |  2 +-
 openair2/UTIL/OTG/otg_form.c             | 10 +++++-----
 openair2/UTIL/OTG/otg_kpi.c              |  2 +-
 openair2/UTIL/OTG/otg_kpi.h              |  2 +-
 17 files changed, 45 insertions(+), 29 deletions(-)

diff --git a/openair1/PHY/LTE_ESTIMATION/defs.h b/openair1/PHY/LTE_ESTIMATION/defs.h
index bba8c614f..40267672f 100644
--- a/openair1/PHY/LTE_ESTIMATION/defs.h
+++ b/openair1/PHY/LTE_ESTIMATION/defs.h
@@ -86,6 +86,11 @@ int lte_dl_msbfn_channel_estimation(PHY_VARS_UE *phy_vars_ue,
 				    unsigned char l,
 				    unsigned char symbol);
 
+int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue,
+                                    u8 eNB_id,
+                                    u8 eNB_offset,
+                                    int subframe,
+                                    unsigned char l);
 
 /*
 #ifdef EMOS
diff --git a/openair1/PHY/LTE_TRANSPORT/pbch.c b/openair1/PHY/LTE_TRANSPORT/pbch.c
index 6932ee45b..182b40761 100755
--- a/openair1/PHY/LTE_TRANSPORT/pbch.c
+++ b/openair1/PHY/LTE_TRANSPORT/pbch.c
@@ -81,7 +81,10 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
   u8 RCC;
 
   u32 nsymb = (frame_parms->Ncp==NORMAL) ? 14:12;
-  u32 pilots,pilots_2;
+  u32 pilots;
+#ifdef INTERFERENCE_MITIGATION
+  u32 pilots_2;
+#endif
   u32 second_pilot = (frame_parms->Ncp==NORMAL) ? 4 : 3;
   u32 jj=0;
   u32 re_allocated=0;
@@ -230,10 +233,14 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
   for (l=(nsymb>>1);l<(nsymb>>1)+4;l++) {
     
     pilots=0;
+#ifdef INTERFERENCE_MITIGATION
     pilots_2 = 0;
+#endif
     if ((l==0) || (l==(nsymb>>1))){
       pilots=1;
+#ifdef INTERFERENCE_MITIGATION
       pilots_2=1;
+#endif
     }
 
     if ((l==1) || (l==(nsymb>>1)+1)){
diff --git a/openair1/PHY/LTE_TRANSPORT/pmch.c b/openair1/PHY/LTE_TRANSPORT/pmch.c
index 97f276256..428d25650 100644
--- a/openair1/PHY/LTE_TRANSPORT/pmch.c
+++ b/openair1/PHY/LTE_TRANSPORT/pmch.c
@@ -625,7 +625,8 @@ void mch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
   __m128i xmm1,xmm2,*ch_mag,*ch_magb;
   __m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
   
-  int j=0,i,len,len2;
+  int i,len,len2;
+//   int j=0;
   unsigned char len_mod4;
   short *llr;
   s16 *llr2;
diff --git a/openair1/PHY/MODULATION/slot_fep_mbsfn.c b/openair1/PHY/MODULATION/slot_fep_mbsfn.c
index 87357a31e..83dcdef3b 100644
--- a/openair1/PHY/MODULATION/slot_fep_mbsfn.c
+++ b/openair1/PHY/MODULATION/slot_fep_mbsfn.c
@@ -21,7 +21,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue,
   unsigned int nb_prefix_samples0 = frame_parms->ofdm_symbol_size>>2;//(no_prefix ? 0 : frame_parms->nb_prefix_samples0);
   unsigned int subframe_offset;
  
-  int i;
+//   int i;
   unsigned int frame_length_samples = frame_parms->samples_per_tti * 10;
   void (*dft)(int16_t *,int16_t *, int);
 
@@ -161,7 +161,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue,
 					i+1,
 				    subframe,
 				    l);		
-   /* lte_dl_channel_estimation(phy_vars_ue,eNB_id,0,
+        lte_dl_channel_estimation(phy_vars_ue,eNB_id,0,
 				Ns,
 				aa,
 				l,
diff --git a/openair2/LAYER2/MAC/ra_procedures.c b/openair2/LAYER2/MAC/ra_procedures.c
index 433664a66..369ac7246 100644
--- a/openair2/LAYER2/MAC/ra_procedures.c
+++ b/openair2/LAYER2/MAC/ra_procedures.c
@@ -230,7 +230,6 @@ PRACH_RESOURCES_t *ue_get_rach(u8 Mod_id,u32 frame, u8 eNB_index,u8 subframe){
   mac_rlc_status_resp_t rlc_status;
   u8 dcch_header_len=0;
   u16 sdu_lengths[8];
-  u8 sdu_lcids[8];
   u8 ulsch_buff[MAX_ULSCH_PAYLOAD_BYTES];
 
   if (UE_mode == PRACH) {
@@ -310,8 +309,6 @@ PRACH_RESOURCES_t *ue_get_rach(u8 Mod_id,u32 frame, u8 eNB_index,u8 subframe){
 	  sdu_lengths[0] = mac_rlc_data_req(Mod_id+NB_eNB_INST,frame,RLC_MBMS_NO,
 					    DCCH,
 					    (char *)&ulsch_buff[0]);
-	
-	  sdu_lcids[0] = DCCH;
 	  
 	  LOG_D(MAC,"[UE %d] TX Got %d bytes for DCCH\n",Mod_id,sdu_lengths[0]);
 	  update_bsr(Mod_id, frame, DCCH,UE_mac_inst[Mod_id].scheduling_info.LCGID[DCCH]);
diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c
index 31ef337e9..0682fc407 100644
--- a/openair2/LAYER2/MAC/rar_tools.c
+++ b/openair2/LAYER2/MAC/rar_tools.c
@@ -43,6 +43,9 @@
 #include "UTIL/LOG/log.h"
 #include "OCG.h"
 #include "OCG_extern.h"
+#if defined(USER_MODE) && defined(OAI_EMU)
+# include "UTIL/OPT/opt.h"
+#endif
 
 #define DEBUG_RAR
 
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
index a7c36709d..6c5f01b5c 100755
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
@@ -101,9 +101,12 @@ int pdcp_fifo_flush_sdus (u32_t frame,u8 eNB_flag)
   int             bytes_wrote = 0;
   int             pdcp_nb_sdu_sent = 0;
   u8              cont = 1;
-  int ret;
   int mcs_inst;
 
+#if defined(NAS_NETLINK) && defined(LINUX)
+  int ret = 0;
+#endif
+
   while (sdu && cont) {
 
 #if defined(OAI_EMU)
@@ -701,6 +704,8 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index
   u8 pdcp_mode, is_ue=0;
   Packet_otg_elt * otg_pkt_info;
 
+  src_id = eNB_index;
+
   // we need to add conditions to avoid transmitting data when the UE is not RRC connected.
 #if defined(USER_MODE) && defined(OAI_EMU)
   if (oai_emulation.info.otg_enabled ==1 ){
@@ -744,7 +749,6 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index
 #else
   if ((otg_enabled==1) && (eNB_flag == 1)) { // generate DL traffic
     unsigned int ctime=0;
-    src_id = eNB_index;
     ctime = frame * 100;
     
     /*if  ((mac_get_rrc_status(eNB_index, eNB_flag, 0 ) > 2) &&
diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c
index 6aeeef602..5551cca55 100644
--- a/openair2/LAYER2/openair2_proc.c
+++ b/openair2/LAYER2/openair2_proc.c
@@ -68,7 +68,7 @@ static mapping rrc_status_names[] = {
 
 int dump_eNB_l2_stats(char *buffer, int length){
   
-  u8 eNB_id,UE_id,lcid,i,j,number_of_cards;
+  u8 eNB_id,UE_id,number_of_cards;
   int len= length;
   
 #ifdef EXMIMO
diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c
index c8486ac9a..838338be1 100755
--- a/openair2/UTIL/LOG/log.c
+++ b/openair2/UTIL/LOG/log.c
@@ -356,8 +356,8 @@ void logRecord(const char *file, const char *func, int line,  int comp,
     va_end(args);
 
     //2 first parameters must be passed as 'const' to the thread function
-    log_params.file = file;
-    log_params.func = func;
+    log_params.file = strdup(file);
+    log_params.func = strdup(func);
     log_params.line = line;
     log_params.comp = comp;
     log_params.level = level;
diff --git a/openair2/UTIL/OMG/id_manager.c b/openair2/UTIL/OMG/id_manager.c
index 575cd3d46..74d441844 100644
--- a/openair2/UTIL/OMG/id_manager.c
+++ b/openair2/UTIL/OMG/id_manager.c
@@ -179,11 +179,11 @@ int get_oai_entry(char *sumo_id, Map_list Map_Vector) {
 
 Map_list remove_oai_entry(char *sumo_id, Map_list Map_Vector) {
     Map_list tmp = Map_Vector;
-    Map_list entry;
+//     Map_list entry;
     //printf("removing entry %s \n",sumo_id);	
     if (strcmp(tmp->map->sumo_id, sumo_id) == 0) {
        //printf("1: found it %s \n",tmp->map->sumo_id);
-       int id = tmp->map->oai_id;
+//        int id = tmp->map->oai_id;
     //   free(tmp);
        if(tmp->next == NULL)
          return NULL;
@@ -202,8 +202,8 @@ Map_list remove_oai_entry(char *sumo_id, Map_list Map_Vector) {
       while (tmp->next != NULL){
              if (strcmp(tmp->next->map->sumo_id, sumo_id) == 0) {
                 //printf("2: found it %s \n",tmp->next->map->sumo_id);
-                int id = tmp->next->map->oai_id;
-                entry =  tmp->next;   // save the entry to remove 
+//                 int id = tmp->next->map->oai_id;
+//                 entry =  tmp->next;   // save the entry to remove 
                 tmp->next = tmp->next->next; // jump over the entry to be removed
               //  free(entry); // freeing the entry
                //if(strcmp(tmp->next->map->sumo_id, "0") == 0)
diff --git a/openair2/UTIL/OMG/socket_traci_OMG.c b/openair2/UTIL/OMG/socket_traci_OMG.c
index 61b631bbc..b94d5fd75 100644
--- a/openair2/UTIL/OMG/socket_traci_OMG.c
+++ b/openair2/UTIL/OMG/socket_traci_OMG.c
@@ -148,7 +148,7 @@ storage * receiveExact(){
         tracker = writePacket(bufLength, 4);
         
         // store pointer to free the space later
-        storage *freeTracker = tracker;   
+//         storage *freeTracker = tracker;   
         int s= readInt();
 	int NN = s - 4;
         printf("debug \n");
diff --git a/openair2/UTIL/OMG/sumo.c b/openair2/UTIL/OMG/sumo.c
index 3f6c988fd..91e9c5bdf 100644
--- a/openair2/UTIL/OMG/sumo.c
+++ b/openair2/UTIL/OMG/sumo.c
@@ -78,7 +78,7 @@ sprintf(sumo_line, "%s -c %s ",omg_param_list.sumo_command, omg_param_list.sumo_
   arrived = NULL;
 
 // switch on error to return to OAI
-  int error = handshake(omg_param_list.sumo_host,omg_param_list.sumo_port);
+  handshake(omg_param_list.sumo_host,omg_param_list.sumo_port);
   
   init(omg_param_list.sumo_end - omg_param_list.sumo_start);
   
diff --git a/openair2/UTIL/OMG/trace.c b/openair2/UTIL/OMG/trace.c
index 6f5b63fa9..fe9a87327 100644
--- a/openair2/UTIL/OMG/trace.c
+++ b/openair2/UTIL/OMG/trace.c
@@ -50,7 +50,6 @@ extern hash_table_t* table;
 
 int start_trace_generator(omg_global_param omg_param_list) {
 
-  NodePtr node = NULL;
   // MobilityPtr mobility = NULL;
   
   //read the mobility file here
@@ -85,7 +84,7 @@ int deploy_nodes() {
     
     NodePtr node = NULL;
 
-    int count = 0;
+//     int count = 0;
     node_info * head_node = head_node_info;
     while (head_node!=NULL){
     
@@ -235,7 +234,7 @@ Pair move_trace_node(NodePtr node, double cur_time) {
     return keep_awake_trace_node(node,cur_time,9999,1);                
   }
   else{ // location discription available
-    Job_list tmp1 = Job_Vector;
+//     Job_list tmp1 = Job_Vector;
     LOG_D(OMG, "Location fetch : (%.2f, %.2f)\n", next_loc->x, next_loc->y);
     
     double X_next;
diff --git a/openair2/UTIL/OPT/opt.h b/openair2/UTIL/OPT/opt.h
index db5c25148..ba762274e 100644
--- a/openair2/UTIL/OPT/opt.h
+++ b/openair2/UTIL/OPT/opt.h
@@ -56,7 +56,7 @@ This header file must be included */
 #ifndef project_include
 #define project_include
 #include "UTIL/LOG/log_if.h"
-#include "UTIL/LOG/log_extern.h"
+// #include "UTIL/LOG/log_extern.h"
 #include "PHY/defs.h"
 #include "PHY/extern.h"
 #include "PHY/impl_defs_lte.h"
diff --git a/openair2/UTIL/OTG/otg_form.c b/openair2/UTIL/OTG/otg_form.c
index d41d06bd1..52e400283 100644
--- a/openair2/UTIL/OTG/otg_form.c
+++ b/openair2/UTIL/OTG/otg_form.c
@@ -1,7 +1,7 @@
 
 #include "otg_form.h"
 #include "otg_vars.h"
-
+#include "otg_kpi.h"
 
 extern unsigned char NB_eNB_INST;
 extern unsigned char NB_UE_INST;
@@ -150,7 +150,7 @@ if (otg_forms_info->idx_ul[src][dst]==MAX_SAMPLES-1){
 		 
 
  
-		nb_loss_pkts();
+		otg_kpi_nb_loss_pkts();
 		sprintf(loss_rate, "%s%d","NB Loss pkts UL=", otg_info->total_loss_ul);
 		fl_set_object_label(form_ul->loss_ratio, loss_rate);
 		sprintf(simu_time, "%s%d","Simulation Time(ms)=", ctime);
@@ -170,7 +170,7 @@ if (otg_forms_info->idx_ul[src][dst]==MAX_SAMPLES-1){
     fl_set_xyplot_key(form_ul->throughput, 0, curve_label);
 		fl_set_xyplot_key_position(form_ul->throughput, x_key_position,y_key_position , FL_ALIGN_BOTTOM_LEFT);
 		  
-		nb_loss_pkts();
+                otg_kpi_nb_loss_pkts();
 		sprintf(loss_rate, "%s%d","NB Loss pkts UL=",otg_info->total_loss_ul);
 		fl_set_object_label(form_ul->loss_ratio, loss_rate);
 		sprintf(simu_time, "%s%d","Simulation Time(ms)=", ctime);
@@ -245,7 +245,7 @@ if (otg_forms_info->idx_dl[src][dst]==MAX_SAMPLES-1){
 		sprintf(curve_label, "%d%s%d", src,"-->", dst);
     fl_set_xyplot_key(form_dl->throughput, 0, curve_label);
 		fl_set_xyplot_key_position(form_dl->throughput, x_key_position,y_key_position,   FL_ALIGN_BOTTOM_LEFT);   
-		nb_loss_pkts();
+                otg_kpi_nb_loss_pkts();
 		sprintf(loss_rate, "%s%d","NB Loss pkts DL=",otg_info->total_loss_dl);
 		fl_set_object_label(form_dl->loss_ratio, loss_rate);
 
@@ -265,7 +265,7 @@ if (otg_forms_info->idx_dl[src][dst]==MAX_SAMPLES-1){
     fl_set_xyplot_key(form_dl->throughput, 0, curve_label);
 		fl_set_xyplot_key_position(form_dl->throughput,x_key_position,y_key_position,   FL_ALIGN_BOTTOM_LEFT);  
   
-		nb_loss_pkts();
+                otg_kpi_nb_loss_pkts();
 		sprintf(loss_rate, "%s%d","NB Loss pkts DL=",otg_info->total_loss_dl);
 		fl_set_object_label(form_dl->loss_ratio, loss_rate);
 		sprintf(simu_time, "%s%d","Simulation Time(ms)=", ctime);
diff --git a/openair2/UTIL/OTG/otg_kpi.c b/openair2/UTIL/OTG/otg_kpi.c
index bdf391cb0..a144b1ffa 100644
--- a/openair2/UTIL/OTG/otg_kpi.c
+++ b/openair2/UTIL/OTG/otg_kpi.c
@@ -122,7 +122,7 @@ void rx_loss_rate_bytes(int src, int dst, int application){
 
 }
 
-void nb_loss_pkts(){
+void otg_kpi_nb_loss_pkts(void){
 unsigned int i,j,k;
 
 otg_info->total_loss_dl=0;
diff --git a/openair2/UTIL/OTG/otg_kpi.h b/openair2/UTIL/OTG/otg_kpi.h
index 15de3bac8..d3eada46b 100644
--- a/openair2/UTIL/OTG/otg_kpi.h
+++ b/openair2/UTIL/OTG/otg_kpi.h
@@ -105,6 +105,6 @@ void add_log_metric(int src, int dst, int ctime, double metric, unsigned int lab
 
 void  add_log_label(unsigned int label, unsigned int * start_log_metric);
 
-void nb_loss_pkts();
+void otg_kpi_nb_loss_pkts(void);
 
 #endif
-- 
GitLab