From 17db1a25ac203ebb28c88e0c1c7057e21df16cde Mon Sep 17 00:00:00 2001 From: acdemiralp Date: Fri, 20 Oct 2023 21:50:56 +0200 Subject: [PATCH] Linter fixes. --- include/mpi/core/type/data_type.hpp | 8 ++++---- include/mpi/core/version.hpp | 2 +- include/mpi/io/data_representation.hpp | 6 +++--- include/mpi/tool/structs/control_variable.hpp | 2 +- include/mpi/tool/structs/performance_variable.hpp | 2 +- tests/c_interface_test.cpp | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/mpi/core/type/data_type.hpp b/include/mpi/core/type/data_type.hpp index 5598c12..32a413b 100644 --- a/include/mpi/core/type/data_type.hpp +++ b/include/mpi/core/type/data_type.hpp @@ -175,7 +175,7 @@ class data_type std::array extent () const { std::array result {}; - MPI_CHECK_ERROR_CODE(MPI_Type_get_extent, (native_, &result[0], &result[1])) + MPI_CHECK_ERROR_CODE(MPI_Type_get_extent, (native_, result.data(), &result[1])) MPI_CHECK_UNDEFINED (MPI_Type_get_extent, result[0]) MPI_CHECK_UNDEFINED (MPI_Type_get_extent, result[1]) return result; @@ -184,7 +184,7 @@ class data_type std::array extent_x () const { std::array result {}; - MPI_CHECK_ERROR_CODE(MPI_Type_get_extent_x, (native_, &result[0], &result[1])) + MPI_CHECK_ERROR_CODE(MPI_Type_get_extent_x, (native_, result.data(), &result[1])) MPI_CHECK_UNDEFINED (MPI_Type_get_extent_x, result[0]) MPI_CHECK_UNDEFINED (MPI_Type_get_extent_x, result[1]) return result; @@ -193,7 +193,7 @@ class data_type std::array true_extent () const { std::array result {}; - MPI_CHECK_ERROR_CODE(MPI_Type_get_true_extent, (native_, &result[0], &result[1])) + MPI_CHECK_ERROR_CODE(MPI_Type_get_true_extent, (native_, result.data(), &result[1])) MPI_CHECK_UNDEFINED (MPI_Type_get_true_extent, result[0]) MPI_CHECK_UNDEFINED (MPI_Type_get_true_extent, result[1]) return result; @@ -202,7 +202,7 @@ class data_type std::array true_extent_x () const { std::array result {}; - MPI_CHECK_ERROR_CODE(MPI_Type_get_true_extent_x, (native_, &result[0], &result[1])) + MPI_CHECK_ERROR_CODE(MPI_Type_get_true_extent_x, (native_, result.data(), &result[1])) MPI_CHECK_UNDEFINED (MPI_Type_get_true_extent_x, result[0]) MPI_CHECK_UNDEFINED (MPI_Type_get_true_extent_x, result[1]) return result; diff --git a/include/mpi/core/version.hpp b/include/mpi/core/version.hpp index 9cd858a..b987b8b 100644 --- a/include/mpi/core/version.hpp +++ b/include/mpi/core/version.hpp @@ -16,7 +16,7 @@ constexpr std::int32_t sub_version = MPI_SUBVERSION; inline std::array get_version () { std::array result {}; - MPI_CHECK_ERROR_CODE(MPI_Get_version, (&result[0], &result[1])) + MPI_CHECK_ERROR_CODE(MPI_Get_version, (result.data(), &result[1])) return result; } inline std::string get_library_version() diff --git a/include/mpi/io/data_representation.hpp b/include/mpi/io/data_representation.hpp index d63958b..fe19199 100644 --- a/include/mpi/io/data_representation.hpp +++ b/include/mpi/io/data_representation.hpp @@ -36,15 +36,15 @@ class data_representation { MPI_CHECK_ERROR_CODE(MPI_Register_datarep, ( name_.c_str(), - [ ] (void* buffer, MPI_Datatype data_type, std::int32_t count , void* file_buffer, offset position, void* extra_state) + [ ] (void* buffer, const MPI_Datatype data_type, const std::int32_t count , void* file_buffer, const offset position, void* extra_state) { return static_cast(extra_state)->read_function_ (buffer, mpi::data_type(data_type), count, file_buffer, position); }, - [ ] (void* buffer, MPI_Datatype data_type, std::int32_t count , void* file_buffer, offset position, void* extra_state) + [ ] (void* buffer, const MPI_Datatype data_type, const std::int32_t count , void* file_buffer, const offset position, void* extra_state) { return static_cast(extra_state)->write_function_(buffer, mpi::data_type(data_type), count, file_buffer, position); }, - [ ] ( MPI_Datatype data_type, aint* extent , void* extra_state) + [ ] ( const MPI_Datatype data_type, aint* extent , void* extra_state) { return static_cast(extra_state)->extent_function_( mpi::data_type(data_type), extent); }, diff --git a/include/mpi/tool/structs/control_variable.hpp b/include/mpi/tool/structs/control_variable.hpp index fb13398..cbace1a 100644 --- a/include/mpi/tool/structs/control_variable.hpp +++ b/include/mpi/tool/structs/control_variable.hpp @@ -18,8 +18,8 @@ struct control_variable explicit control_variable (const std::int32_t index) : index(index) { auto name_size(0), description_size(0); + auto enum_type (MPI_T_ENUM_NULL ); MPI_Datatype raw_data_type(MPI_DATATYPE_NULL); - MPI_T_enum enum_type (MPI_T_ENUM_NULL ); MPI_CHECK_ERROR_CODE(MPI_T_cvar_get_info, ( index , diff --git a/include/mpi/tool/structs/performance_variable.hpp b/include/mpi/tool/structs/performance_variable.hpp index 1a209be..1671d9e 100644 --- a/include/mpi/tool/structs/performance_variable.hpp +++ b/include/mpi/tool/structs/performance_variable.hpp @@ -18,8 +18,8 @@ struct performance_variable explicit performance_variable (const std::int32_t index) : index(index) { auto name_size(0), description_size(0); + auto enum_type (MPI_T_ENUM_NULL ); MPI_Datatype raw_data_type(MPI_DATATYPE_NULL); - MPI_T_enum enum_type (MPI_T_ENUM_NULL ); MPI_CHECK_ERROR_CODE(MPI_T_pvar_get_info, ( index , diff --git a/tests/c_interface_test.cpp b/tests/c_interface_test.cpp index c8e0ee3..2c057a7 100644 --- a/tests/c_interface_test.cpp +++ b/tests/c_interface_test.cpp @@ -50,9 +50,9 @@ TEST_CASE("C Interface") MPI_Type_commit (&position_data_type); MPI_Datatype particle_data_type; - std::array block_lengths {1, 1}; - std::array displacements {0, sizeof (std::uint64_t)}; - std::array data_types {MPI_UINT64_T, position_data_type}; + std::array block_lengths {1, 1}; + std::array displacements {0, sizeof (std::uint64_t)}; + std::array data_types {MPI_UINT64_T, position_data_type}; MPI_Type_struct (2, block_lengths.data(), displacements.data(), data_types.data(), &particle_data_type); MPI_Type_commit (&particle_data_type);