Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't hide the cruft, even to please sonar. Document it instead.
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 14 Feb 2017 15:18:19 +0000 (16:18 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 14 Feb 2017 15:21:20 +0000 (16:21 +0100)
This would really make the code more ugly. Instead, add a comment
explaining why, and I'll make the issue as wontfix in sonar.

This reverts commit 33231edf2cf2a3615965d676f3d5c7f37a951569.

src/smpi/smpi_mpi_dt.cpp

index 8c63b07..9bd0d52 100644 (file)
@@ -1403,8 +1403,7 @@ void smpi_op_apply(MPI_Op op, void *invec, void *inoutvec, int *len, MPI_Datatyp
       op->func(invec, inoutvec, len, datatype);
     else{
       int tmp = smpi_type_c2f(*datatype);
       op->func(invec, inoutvec, len, datatype);
     else{
       int tmp = smpi_type_c2f(*datatype);
-      void* tmpptr=static_cast<void*>(&tmp);
-      op->func(invec, inoutvec, len, static_cast<MPI_Datatype*>(tmpptr) );
+      op->func(invec, inoutvec, len, reinterpret_cast<MPI_Datatype*>(&tmp) );
     }
   }
 }
     }
   }
 }