Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
don't protect only some paths against NULLity
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 21 Jun 2016 13:00:35 +0000 (15:00 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 21 Jun 2016 16:14:49 +0000 (18:14 +0200)
Either some or all. it makes sonarqube mad.

examples/smpi/NAS/dt.c

index 341eaa2..55b29dd 100644 (file)
@@ -672,12 +672,12 @@ int main(int argc,char **argv ){
     dg=buildSH(class);
   }
 
     dg=buildSH(class);
   }
 
-  if(timer_on != 0 && dg && dg->numNodes+1>timers_tot){
+  if(timer_on != 0 && dg->numNodes+1>timers_tot){
     timer_on=0;
     if(my_rank==0)
     fprintf(stderr,"Not enough timers. Node timeing is off. \n");
   }
     timer_on=0;
     if(my_rank==0)
     fprintf(stderr,"Not enough timers. Node timeing is off. \n");
   }
-  if(dg && dg->numNodes>comm_size){
+  if(dg->numNodes>comm_size){
     if(my_rank==0){
     fprintf(stderr,"**  The number of MPI processes should not be less than \n");
     fprintf(stderr,"**  the number of nodes in the graph\n");
     if(my_rank==0){
     fprintf(stderr,"**  The number of MPI processes should not be less than \n");
     fprintf(stderr,"**  the number of nodes in the graph\n");
@@ -687,7 +687,7 @@ int main(int argc,char **argv ){
     MPI_Finalize();
     exit(0);
   }
     MPI_Finalize();
     exit(0);
   }
-  for(i=0;i<dg->numNodes;i++){
+  for(i=0; i<dg->numNodes; i++){
     dg->node[i]->address=i;
   }
   if( my_rank == 0 ){
     dg->node[i]->address=i;
   }
   if( my_rank == 0 ){