From 1ab4008216f0b1f23f84a0ebbb7be084d256ac82 Mon Sep 17 00:00:00 2001 From: Lionel Gauthier <lionel.gauthier@eurecom.fr> Date: Thu, 9 Apr 2015 09:20:52 +0000 Subject: [PATCH] patches13/0020-Fix-misuse-of-DevAssert-.-Using-bad-warkaround.-FIXM.patch git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7066 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- openair2/UTIL/OMG/omg_vars.h | 4 ++-- openair2/UTIL/OMG/sumo.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/openair2/UTIL/OMG/omg_vars.h b/openair2/UTIL/OMG/omg_vars.h index d236c312c..ce95fd798 100644 --- a/openair2/UTIL/OMG/omg_vars.h +++ b/openair2/UTIL/OMG/omg_vars.h @@ -39,8 +39,8 @@ #include "omg.h" /*!A global variable used to store all the nodes information. It is an array in which every cell stocks the nodes information for a given mobility type. Its length is equal to the maximum number of mobility models that can exist in a single simulation scenario */ -node_list* node_vector[MAX_NUM_NODE_TYPES]; -node_list* node_vector_end[MAX_NUM_NODE_TYPES]; +node_list* node_vector[MAX_NUM_NODE_TYPES + 10 /*FIXME bad workaround for indexing node_vector with SUMO*/]; +node_list* node_vector_end[MAX_NUM_NODE_TYPES + 10 /*FIXME bad workaround for indexing node_vector_end with SUMO*/]; /*! A global variable which represents the length of the Node_Vector */ int node_vector_len[MAX_NUM_NODE_TYPES]; diff --git a/openair2/UTIL/OMG/sumo.c b/openair2/UTIL/OMG/sumo.c index aeb0f6ed7..0d0a91c65 100644 --- a/openair2/UTIL/OMG/sumo.c +++ b/openair2/UTIL/OMG/sumo.c @@ -171,8 +171,9 @@ start_sumo_generator (omg_global_param omg_param_list) node->generator = SUMO; // SUMO node->mob = mobility; - DevAssert( SUMO >= MAX_NUM_NODE_TYPES ); // FIXME node_vector_end is declared with MAX_NUM_NODE_TYPES elements, but here we are indexing with SUMO from enum mobility_types - DevAssert( SUMO >= MAX_NUM_NODE_TYPES ); // FIXME node_vector is declared with MAX_NUM_NODE_TYPES elements, but here we are indexing with SUMO from enum mobility_types + // FIXME! wrong use of node_vector and node_vector_end + // FIXME node_vector_end is declared with MAX_NUM_NODE_TYPES elements, but here we are indexing with SUMO from enum mobility_types + // FIXME node_vector is declared with MAX_NUM_NODE_TYPES elements, but here we are indexing with SUMO from enum mobility_types node_vector_end[SUMO] = (node_list *) add_entry (node, node_vector_end[SUMO]); @@ -297,7 +298,9 @@ desactivate_and_unmap (char *sumo_id) if (OAI_ID != -1) { //TODO generalize to UE and eNB (must change the method) - DevAssert( SUMO >= MAX_NUM_NODE_TYPES ); // FIXME node_vector is declared with MAX_NUM_NODE_TYPES elements, but here we are indexing with SUMO from enum mobility_types + + // FIXME! wrong use of node_vector + // FIXME node_vector is declared with MAX_NUM_NODE_TYPES elements, but here we are indexing with SUMO from enum mobility_types node_struct *node = find_node (node_vector[SUMO], OAI_ID, UE); if (node == NULL) node = find_node (node_vector[SUMO], OAI_ID, eNB); @@ -440,7 +443,8 @@ get_sumo_positions_updated (double cur_time) "--------GET SUMO Mobility for a group of ACTIVE OAI nodes--------\n"); #endif - DevAssert( SUMO >= MAX_NUM_NODE_TYPES ); // FIXME node_vector is declared with MAX_NUM_NODE_TYPES elements, but here we are indexing with SUMO from enum mobility_types + // FIXME! wrong use of node_vector + // FIXME node_vector is declared with MAX_NUM_NODE_TYPES elements, but here we are indexing with SUMO from enum mobility_types if (node_vector[SUMO] != NULL) { node_list *tmp = node_vector[SUMO]; -- GitLab