patches13/0022-fix-compiler-warnings.patch

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7068 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
Lionel Gauthier
2015-04-09 09:21:34 +00:00
parent 35baba676e
commit ddd76fadf8
18 changed files with 63 additions and 64 deletions
+7 -6
View File
@@ -176,12 +176,13 @@ get_free_mem_block (uint16_t sizeP)
int pool_selected;
int size;
if (sizeP > MEM_MNGT_MB12_BLOCK_SIZE) {
msg ("[MEM_MNGT][ERROR][FATAL] size requested %d out of bounds\n", sizeP);
display_mem_load ();
mac_xface->macphy_exit("[MEM_MNGT][ERROR][FATAL] get_free_mem_block size requested out of bounds");
return NULL;
}
// next block commented, because sizeP > MEM_MNGT_MB12_BLOCK_SIZE can never be true.
// if (sizeP > MEM_MNGT_MB12_BLOCK_SIZE) {
// msg ("[MEM_MNGT][ERROR][FATAL] size requested %d out of bounds\n", sizeP);
// display_mem_load ();
// mac_xface->macphy_exit("[MEM_MNGT][ERROR][FATAL] get_free_mem_block size requested out of bounds");
// return NULL;
// }
size = sizeP >> 6;
pool_selected = 0;
+2 -2
View File
@@ -177,7 +177,7 @@ float owd_const_application_v=owd_const_application()/2;
if (otg_info->rx_pkt_owd_history[src][dst][1] == 0) // first packet
otg_info->rx_pkt_jitter[src][dst]=0;
else // for the consecutive packets
otg_info->rx_pkt_jitter[src][dst]= abs(otg_info->rx_pkt_owd_history[src][dst][0] - otg_info->rx_pkt_owd_history[src][dst][1]);
otg_info->rx_pkt_jitter[src][dst] = fabsf(otg_info->rx_pkt_owd_history[src][dst][0] - otg_info->rx_pkt_owd_history[src][dst][1]);
LOG_D(OTG,"The packet jitter for the pair (src %d, dst %d)) at %d is %lf (current %lf, previous %lf) \n",
src, dst, ctime, otg_info->rx_pkt_jitter[src][dst],
@@ -188,7 +188,7 @@ float owd_const_application_v=owd_const_application()/2;
if (otg_info->rx_pkt_owd_history_e2e[src][dst][1] == 0) // first packet
otg_info->rx_pkt_jitter_e2e[src][dst]=0;
else // for the consecutive packets
otg_info->rx_pkt_jitter_e2e[src][dst]= abs(otg_info->rx_pkt_owd_history_e2e[src][dst][0] - otg_info->rx_pkt_owd_history_e2e[src][dst][1]);
otg_info->rx_pkt_jitter_e2e[src][dst]= fabsf(otg_info->rx_pkt_owd_history_e2e[src][dst][0] - otg_info->rx_pkt_owd_history_e2e[src][dst][1]);
LOG_D(OTG,"The packet jitter for the pair (src %d, dst %d)) at %d is %lf (current %lf, previous %lf) \n",
src, dst, ctime, otg_info->rx_pkt_jitter_e2e[src][dst],
+7 -3
View File
@@ -42,6 +42,7 @@
#include "UTIL/MATH/oml.h"
#include "otg_tx.h"
#include "otg_externs.h"
#include "assertions.h"
extern unsigned char NB_eNB_INST;
extern unsigned char NB_UE_INST;
@@ -564,19 +565,22 @@ void header_size_gen_multicast(int src, int dst, int application){
char *random_string(int size, ALPHABET_GEN mode, ALPHABET_TYPE data_type) {
char *data=NULL;
int i=0,start=0;
DevAssert( size < strlen(FIXED_STRING) );
switch (mode){
case REPEAT_STRING:
start = uniform_dist (0, abs(strlen(FIXED_STRING)- size - 1));
start = uniform_dist (0, strlen(FIXED_STRING) - size - 1);
return str_sub (FIXED_STRING, start, start + size -1);
break;
case SUBSTRACT_STRING:
//data=strndup(data_string + (strlen(data_string) - size), strlen(data_string));
//data=strndup(data_string + (strlen(data_string) - size), size);
if (data_type == HEADER_ALPHABET){
start = uniform_dist (0, abs(strlen(HEADER_STRING)- size - 1));
start = uniform_dist (0, strlen(HEADER_STRING) - size - 1);
return str_sub (HEADER_STRING, start, start + size -1);
}else if (data_type == PAYLOAD_ALPHABET) {
start = uniform_dist (0, abs(strlen(PAYLOAD_STRING)- size - 1));
start = uniform_dist (0, strlen(PAYLOAD_STRING) - size - 1);
return str_sub (PAYLOAD_STRING, start, start+size - 1 );
}else
LOG_E(OTG, "unsupported alphabet data type \n");