Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Concatenate nested namespaces (sonar).
[simgrid.git] / src / smpi / mpi / smpi_file.cpp
index 531832243d99cb4762d83404d5d5c6e6efe53d5a..c6a65c84479d6cca5511c9741a95e48e41df6de8 100644 (file)
@@ -23,8 +23,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_io, smpi, "Logging specific to SMPI (RMA op
 
 MPI_Errhandler SMPI_default_File_Errhandler =  _smpi_cfg_default_errhandler_is_error ? MPI_ERRORS_ARE_FATAL : MPI_ERRORS_RETURN;;
 
-namespace simgrid{
-namespace smpi{
+namespace simgrid::smpi {
 
 File::File(MPI_Comm comm, const char* filename, int amode, MPI_Info info) : comm_(comm), flags_(amode), info_(info)
 {
@@ -34,9 +33,8 @@ File::File(MPI_Comm comm, const char* filename, int amode, MPI_Info info) : comm
   xbt_assert(not simgrid::s4u::Host::current()->get_disks().empty(),
              "SMPI/IO : Trying to open file on a diskless host ! Add one to your platform file");
 
-  size_t found = fullname.find('/');
   // in case no fullpath is provided ... just pick the first mountpoint.
-  if (found == std::string::npos || fullname.rfind("./", 1) != std::string::npos) {
+  if (size_t found = fullname.find('/'); found == std::string::npos || fullname.rfind("./", 1) != std::string::npos) {
     auto disk = simgrid::s4u::Host::current()->get_disks().front();
     std::string mount;
     if (disk->get_host() != simgrid::s4u::Host::current())
@@ -346,5 +344,4 @@ File* File::f2c(int id)
 {
   return static_cast<File*>(F2C::f2c(id));
 }
-} // namespace smpi
-} // namespace simgrid
+} // namespace simgrid::smpi