Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Explicit cast.
[simgrid.git] / src / smpi / mpi / smpi_datatype.cpp
index 85d16a6..0dcfaef 100644 (file)
@@ -120,7 +120,7 @@ Datatype::Datatype(int size, MPI_Aint lb, MPI_Aint ub, int flags) : size_(size),
 }
 
 // for predefined types, so refcount_ = 0.
-Datatype::Datatype(char* name, int ident, int size, MPI_Aint lb, MPI_Aint ub, int flags)
+Datatype::Datatype(const char* name, int ident, int size, MPI_Aint lb, MPI_Aint ub, int flags)
     : name_(name), id(std::to_string(ident)), size_(size), lb_(lb), ub_(ub), flags_(flags), refcount_(0)
 {
   id2type_lookup.insert({id, this});
@@ -260,7 +260,7 @@ int Datatype::extent(MPI_Aint* lb, MPI_Aint* extent) const
 
 void Datatype::get_name(char* name, int* length) const
 {
-  *length = name_.length();
+  *length = static_cast<int>(name_.length());
   if (not name_.empty()) {
     name_.copy(name, *length);
     name[*length] = '\0';