remove "unused variable" and "set but not used" warnings

This commit is contained in:
Cedric Roux
2016-03-25 23:58:58 +01:00
parent 3f8c74caba
commit 04eed3bd6e
40 changed files with 96 additions and 88 deletions
+2 -7
View File
@@ -158,6 +158,7 @@ remove_node_entry (node_struct * node, node_list * node_vector)
if (list->next->node->id == node->id) {
toremove = tmp; // TODO delete the entry
(void)toremove; /* avoid gcc warning "set but not used" */
tmp = list->next->next;
if (tmp != NULL) {
@@ -259,13 +260,11 @@ node_list *
remove_node (node_list * list, int nid, int node_type)
{
int found;
node_list *current = NULL, *previous = NULL;
//int cond=0;
//int i=0;
if (list == NULL) {
found = 1; //false
return NULL;
} else {
//start search
@@ -280,12 +279,10 @@ remove_node (node_list * list, int nid, int node_type)
//holds: current = NULL or type != node_type or.., but not both
if (current == NULL) {
found = 1;
LOG_E (OMG, " Element to remove is not found\n ");
return NULL;
} //value not found
else {
found = 0; // true value found
if (current == list) {
list = current->next;
@@ -322,7 +319,6 @@ node_struct *
find_node (node_list * list, int nid, int node_type)
{
int found;
node_list *current;
if (list == NULL) {
@@ -340,7 +336,6 @@ find_node (node_list * list, int nid, int node_type)
//holds: current = NULL or type != node_type or.., but not both
if (current == NULL) {
found = 1;
LOG_D (OMG,
" Element to find in Node_Vector with ID: %d could not be found\n ",
nid);
@@ -380,7 +375,7 @@ node_list *
reset_node_list (node_list * list)
{
node_list *tmp;
node_list *last = list;
//node_list *last = list;
if (list == NULL) {
//printf("Node_list is NULL\n");
+1 -1
View File
@@ -301,7 +301,7 @@ set_new_mob_type (int id, int node_t, int mob_t, double cur_time)
int prev_mob;
node_list *tmp;
job_list *tmp2, *prev_job;
//job_list *tmp2, *prev_job;
pair_struct *pair;
double pause_p;
+3 -3
View File
@@ -173,7 +173,7 @@ place_steadystaterwp_node (node_struct * node)
void
sleep_steadystaterwp_node (pair_struct * pair, double cur_time)
{
static int initial = 1;
//static int initial = 1;
node_struct *node;
node = pair->b;
node->mobile = 0;
@@ -209,10 +209,10 @@ sleep_steadystaterwp_node (pair_struct * pair, double cur_time)
void
move_steadystaterwp_node (pair_struct * pair, double cur_time)
{
static int initial = 1;
//static int initial = 1;
double distance, journeytime_next, max_distance;
double temp_x, temp_y, u1, u2;
int loc_num;
//int loc_num;
double pr, block_xmin, block_ymin;
//LOG_D (OMG, "[STEADY_RWP] move node: %d\n", node->ID);
+2 -2
View File
@@ -55,7 +55,7 @@ int
start_trace_generator (omg_global_param omg_param_list)
{
double cur_time = 0.0;
int immobile = 0;
//int immobile = 0;
int node_number;
node_struct *node = NULL;
mobility_struct *mobility = NULL;
@@ -235,7 +235,7 @@ schedule_trace_node (pair_struct * pair, node_data * n_data, double cur_time)
void
sleep_trace_node (pair_struct * pair, node_data * n_data, double cur_time)
{
double journeytime, distance;
//double journeytime, distance;
node_struct *node = pair->b;
node->mobile = 0;
node->mob->speed = 0.0;
-2
View File
@@ -58,8 +58,6 @@ hash_table_t **table;
void
create_new_table (int node_type)
{
int i;
if(table==NULL)
table = (hash_table_t **) calloc (MAX_NUM_NODE_TYPES, sizeof (hash_table_t*));