From: Daniel Arndt Date: Fri, 30 Nov 2018 15:47:17 +0000 (+0100) Subject: Avoid C-style cast in lac (excluding Trilinos) X-Git-Tag: v9.1.0-rc1~502^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfdc7f1d700d8ca9de1a36f4151335bbca5c0958;p=dealii.git Avoid C-style cast in lac (excluding Trilinos) --- diff --git a/include/deal.II/lac/affine_constraints.h b/include/deal.II/lac/affine_constraints.h index b7b4cb1020..68ee38e0f4 100644 --- a/include/deal.II/lac/affine_constraints.h +++ b/include/deal.II/lac/affine_constraints.h @@ -1938,7 +1938,8 @@ public: * derived from BlockMatrixBase). */ static const bool value = - (sizeof(check_for_block_matrix((MatrixType *)nullptr)) == sizeof(yes_type)); + (sizeof(check_for_block_matrix(static_cast(nullptr))) == + sizeof(yes_type)); }; // instantiation of the static member diff --git a/include/deal.II/lac/block_vector_base.h b/include/deal.II/lac/block_vector_base.h index b9ab9d8308..c037c05614 100644 --- a/include/deal.II/lac/block_vector_base.h +++ b/include/deal.II/lac/block_vector_base.h @@ -96,7 +96,8 @@ public: * derived from BlockVectorBase). */ static const bool value = - (sizeof(check_for_block_vector((VectorType *)nullptr)) == sizeof(yes_type)); + (sizeof(check_for_block_vector(static_cast(nullptr))) == + sizeof(yes_type)); }; diff --git a/include/deal.II/lac/full_matrix.templates.h b/include/deal.II/lac/full_matrix.templates.h index 04941943f0..0dd0131afd 100644 --- a/include/deal.II/lac/full_matrix.templates.h +++ b/include/deal.II/lac/full_matrix.templates.h @@ -588,7 +588,8 @@ FullMatrix::mmult(FullMatrix & dst, { number2 add_value = adding ? dst(i, j) : 0.; for (size_type k = 0; k < l; k++) - add_value += (number2)(*this)(i, k) * (number2)(src(k, j)); + add_value += static_cast((*this)(i, k)) * + static_cast((src(k, j))); dst(i, j) = add_value; } } @@ -671,7 +672,8 @@ FullMatrix::Tmmult(FullMatrix & dst, { number2 add_value = 0.; for (size_type k = 0; k < l; ++k) - add_value += (number2)(*this)(k, i) * (number2)(*this)(k, j); + add_value += static_cast((*this)(k, i)) * + static_cast((*this)(k, j)); if (adding) { dst(i, j) += add_value; @@ -692,7 +694,8 @@ FullMatrix::Tmmult(FullMatrix & dst, { number2 add_value = adding ? dst(i, j) : 0.; for (size_type k = 0; k < l; k++) - add_value += (number2)(*this)(k, i) * (number2)(src(k, j)); + add_value += static_cast((*this)(k, i)) * + static_cast((src(k, j))); dst(i, j) = add_value; } } @@ -774,7 +777,8 @@ FullMatrix::mTmult(FullMatrix & dst, { number2 add_value = 0.; for (size_type k = 0; k < l; ++k) - add_value += (number2)(*this)(i, k) * (number2)(*this)(j, k); + add_value += static_cast((*this)(i, k)) * + static_cast((*this)(j, k)); if (adding) { dst(i, j) += add_value; @@ -792,7 +796,8 @@ FullMatrix::mTmult(FullMatrix & dst, { number2 add_value = adding ? dst(i, j) : 0.; for (size_type k = 0; k < l; k++) - add_value += (number2)(*this)(i, k) * (number2)(src(j, k)); + add_value += static_cast((*this)(i, k)) * + static_cast(src(j, k)); dst(i, j) = add_value; } } @@ -877,7 +882,8 @@ FullMatrix::TmTmult(FullMatrix & dst, { number2 add_value = adding ? dst(i, j) : 0.; for (size_type k = 0; k < l; k++) - add_value += (number2)(*this)(k, i) * (number2)(src(j, k)); + add_value += static_cast((*this)(k, i)) * + static_cast(src(j, k)); dst(i, j) = add_value; } } diff --git a/include/deal.II/lac/la_parallel_block_vector.templates.h b/include/deal.II/lac/la_parallel_block_vector.templates.h index c1fb7d0f17..94c2c2d13a 100644 --- a/include/deal.II/lac/la_parallel_block_vector.templates.h +++ b/include/deal.II/lac/la_parallel_block_vector.templates.h @@ -618,15 +618,16 @@ namespace LinearAlgebra Number local_result = Number(); for (unsigned int i = 0; i < this->n_blocks(); ++i) - local_result += this->block(i).mean_value_local() * - (real_type)this->block(i).partitioner->local_size(); + local_result += + this->block(i).mean_value_local() * + static_cast(this->block(i).partitioner->local_size()); if (this->block(0).partitioner->n_mpi_processes() > 1) return Utilities::MPI::sum( local_result, this->block(0).partitioner->get_communicator()) / - (real_type)this->size(); + static_cast(this->size()); else - return local_result / (real_type)this->size(); + return local_result / static_cast(this->size()); } diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index f008b8ce53..75863e4f93 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -137,7 +137,9 @@ namespace LinearAlgebra Number *new_val; Utilities::System::posix_memalign( - (void **)&new_val, 64, sizeof(Number) * new_alloc_size); + reinterpret_cast(&new_val), + 64, + sizeof(Number) * new_alloc_size); data.values.reset(new_val); allocated_size = new_alloc_size; @@ -1678,10 +1680,10 @@ namespace LinearAlgebra { Number local_result = mean_value_local(); if (partitioner->n_mpi_processes() > 1) - return Utilities::MPI::sum(local_result * - (real_type)partitioner->local_size(), + return Utilities::MPI::sum(local_result * static_cast( + partitioner->local_size()), partitioner->get_mpi_communicator()) / - (real_type)partitioner->size(); + static_cast(partitioner->size()); else return local_result; } diff --git a/include/deal.II/lac/petsc_matrix_base.h b/include/deal.II/lac/petsc_matrix_base.h index 33df20f368..bc1010a901 100644 --- a/include/deal.II/lac/petsc_matrix_base.h +++ b/include/deal.II/lac/petsc_matrix_base.h @@ -1327,7 +1327,7 @@ namespace PETScWrappers n_columns++; } } - Assert(n_columns <= (int)n_cols, ExcInternalError()); + AssertIndexRange(n_columns, n_cols + 1); col_index_ptr = column_indices.data(); col_value_ptr = column_values.data(); @@ -1471,7 +1471,7 @@ namespace PETScWrappers n_columns++; } } - Assert(n_columns <= (int)n_cols, ExcInternalError()); + AssertIndexRange(n_columns, n_cols + 1); col_index_ptr = column_indices.data(); col_value_ptr = column_values.data(); diff --git a/include/deal.II/lac/petsc_vector_base.h b/include/deal.II/lac/petsc_vector_base.h index c2706b096a..09ad999ca9 100644 --- a/include/deal.II/lac/petsc_vector_base.h +++ b/include/deal.II/lac/petsc_vector_base.h @@ -1124,7 +1124,7 @@ namespace PETScWrappers VectorBase::get_mpi_communicator() const { static MPI_Comm comm; - PetscObjectGetComm((PetscObject)vector, &comm); + PetscObjectGetComm(reinterpret_cast(vector), &comm); return comm; } @@ -1199,8 +1199,7 @@ namespace PETScWrappers const unsigned int ghostidx = ghost_indices.index_within_set(index); - Assert(ghostidx + end - begin < (unsigned int)lsize, - ExcInternalError()); + AssertIndexRange(ghostidx + end - begin, lsize); *(values_begin + i) = *(ptr + ghostidx + end - begin); } } diff --git a/include/deal.II/lac/read_write_vector.templates.h b/include/deal.II/lac/read_write_vector.templates.h index 362ac1f1a5..7a2948bcc4 100644 --- a/include/deal.II/lac/read_write_vector.templates.h +++ b/include/deal.II/lac/read_write_vector.templates.h @@ -219,7 +219,8 @@ namespace LinearAlgebra else { Number *new_values; - Utilities::System::posix_memalign((void **)&new_values, + Utilities::System::posix_memalign(reinterpret_cast( + &new_values), 64, sizeof(Number) * new_alloc_size); values.reset(new_values); diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h index d299a8f7f4..14f0d85c28 100644 --- a/include/deal.II/lac/vector.templates.h +++ b/include/deal.II/lac/vector.templates.h @@ -1118,7 +1118,7 @@ Vector::allocate(const size_type copy_n_el) { // allocate memory with the proper alignment requirements of 64 bytes Number *new_values; - Utilities::System::posix_memalign((void **)&new_values, + Utilities::System::posix_memalign(reinterpret_cast(&new_values), 64, sizeof(Number) * max_vec_size); // copy: diff --git a/source/lac/dynamic_sparsity_pattern.cc b/source/lac/dynamic_sparsity_pattern.cc index dfa0a068b4..ac203a5c36 100644 --- a/source/lac/dynamic_sparsity_pattern.cc +++ b/source/lac/dynamic_sparsity_pattern.cc @@ -98,7 +98,7 @@ DynamicSparsityPattern::Line::add_entries(ForwardIterator begin, Assert(pos1 <= entries.size(), ExcInternalError()); entries.insert(it, my_it, end); it = entries.begin() + pos1; - Assert(entries.size() >= (size_type)(it - entries.begin()), + Assert(entries.size() >= static_cast(it - entries.begin()), ExcInternalError()); // now merge the two lists. diff --git a/source/lac/lapack_full_matrix.cc b/source/lac/lapack_full_matrix.cc index e075424f79..1c50fe5f63 100644 --- a/source/lac/lapack_full_matrix.cc +++ b/source/lac/lapack_full_matrix.cc @@ -1881,7 +1881,7 @@ LAPACKFullMatrix::compute_eigenvalues(const bool right, const bool left) lwork = static_cast(std::abs(work[0]) + 1); // resize workspace array - work.resize((size_type)lwork); + work.resize(lwork); // Finally compute the eigenvalues. internal::LAPACKFullMatrixImplementation::geev_helper(jobvl, diff --git a/source/lac/petsc_matrix_free.cc b/source/lac/petsc_matrix_free.cc index c73cf83828..6223ce3b2b 100644 --- a/source/lac/petsc_matrix_free.cc +++ b/source/lac/petsc_matrix_free.cc @@ -227,15 +227,21 @@ namespace PETScWrappers // create a PETSc MatShell matrix-type // object of dimension m x n and local size // local_rows x local_columns - PetscErrorCode ierr = MatCreateShell( - communicator, local_rows, local_columns, m, n, (void *)this, &matrix); + PetscErrorCode ierr = MatCreateShell(communicator, + local_rows, + local_columns, + m, + n, + static_cast(this), + &matrix); AssertThrow(ierr == 0, ExcPETScError(ierr)); // register the MatrixFree::matrix_free_mult function // as the matrix multiplication used by this matrix ierr = MatShellSetOperation( matrix, MATOP_MULT, - (void (*)(void)) & dealii::PETScWrappers::MatrixFree::matrix_free_mult); + reinterpret_cast( + &dealii::PETScWrappers::MatrixFree::matrix_free_mult)); AssertThrow(ierr == 0, ExcPETScError(ierr)); ierr = MatSetFromOptions(matrix); diff --git a/source/lac/petsc_parallel_vector.cc b/source/lac/petsc_parallel_vector.cc index 96a3e3d1d0..2f33532dba 100644 --- a/source/lac/petsc_parallel_vector.cc +++ b/source/lac/petsc_parallel_vector.cc @@ -266,8 +266,9 @@ namespace PETScWrappers ghostnodes.fill_index_vector(ghostindices); const PetscInt *ptr = - (ghostindices.size() > 0 ? (const PetscInt *)(&(ghostindices[0])) : - nullptr); + (ghostindices.size() > 0 ? + reinterpret_cast(&(ghostindices[0])) : + nullptr); PetscErrorCode ierr = VecCreateGhost(communicator, local_size, @@ -287,7 +288,7 @@ namespace PETScWrappers ierr = VecGetOwnershipRange(vector, &begin, &end); AssertThrow(ierr == 0, ExcPETScError(ierr)); - Assert(local_size == (size_type)(end - begin), ExcInternalError()); + AssertDimension(local_size, static_cast(end - begin)); Vec l; ierr = VecGhostGetLocalForm(vector, &l); @@ -300,8 +301,9 @@ namespace PETScWrappers ierr = VecGhostRestoreLocalForm(vector, &l); AssertThrow(ierr == 0, ExcPETScError(ierr)); - Assert(lsize == end - begin + (PetscInt)ghost_indices.n_elements(), - ExcInternalError()); + AssertDimension(lsize, + end - begin + + static_cast(ghost_indices.n_elements())); } # endif diff --git a/source/lac/petsc_solver.cc b/source/lac/petsc_solver.cc index ea262c98ff..8d25d83d77 100644 --- a/source/lac/petsc_solver.cc +++ b/source/lac/petsc_solver.cc @@ -419,9 +419,9 @@ namespace PETScWrappers // and do some equally nasty stuff that at // least doesn't yield warnings... int (*fun_ptr)(KSP, int); - ierr = PetscObjectQueryFunction((PetscObject)(ksp), + ierr = PetscObjectQueryFunction(reinterpret_cast(ksp), "KSPGMRESSetRestart_C", - (void (**)()) & fun_ptr); + reinterpret_cast(&fun_ptr)); AssertThrow(ierr == 0, ExcPETScError(ierr)); ierr = (*fun_ptr)(ksp, additional_data.restart_parameter); diff --git a/source/lac/petsc_sparse_matrix.cc b/source/lac/petsc_sparse_matrix.cc index 325936ee0c..43339dbfa7 100644 --- a/source/lac/petsc_sparse_matrix.cc +++ b/source/lac/petsc_sparse_matrix.cc @@ -126,7 +126,8 @@ namespace PETScWrappers SparseMatrix::get_mpi_communicator() const { static MPI_Comm comm; - const PetscErrorCode ierr = PetscObjectGetComm((PetscObject)matrix, &comm); + const PetscErrorCode ierr = + PetscObjectGetComm(reinterpret_cast(matrix), &comm); AssertThrow(ierr == 0, ExcPETScError(ierr)); return comm; } diff --git a/source/lac/petsc_vector_base.cc b/source/lac/petsc_vector_base.cc index 7688d61d83..29faded388 100644 --- a/source/lac/petsc_vector_base.cc +++ b/source/lac/petsc_vector_base.cc @@ -75,8 +75,7 @@ namespace PETScWrappers const size_type ghostidx = vector.ghost_indices.index_within_set(index); - Assert(ghostidx + end - begin < (size_type)lsize, - ExcInternalError()); + AssertIndexRange(ghostidx + end - begin, lsize); value = *(ptr + ghostidx + end - begin); } diff --git a/source/lac/scalapack.cc b/source/lac/scalapack.cc index 65f3acd95d..3b5ebf051a 100644 --- a/source/lac/scalapack.cc +++ b/source/lac/scalapack.cc @@ -725,18 +725,12 @@ ScaLAPACKMatrix::copy_to( return; // range checking for matrix A - Assert(offset_A.first < (unsigned int)(n_rows - submatrix_size.first + 1), - ExcIndexRange(offset_A.first, 0, n_rows - submatrix_size.first + 1)); - Assert( - offset_A.second < (unsigned int)(n_columns - submatrix_size.second + 1), - ExcIndexRange(offset_A.second, 0, n_columns - submatrix_size.second + 1)); + AssertIndexRange(offset_A.first, n_rows - submatrix_size.first + 1); + AssertIndexRange(offset_A.second, n_columns - submatrix_size.second + 1); // range checking for matrix B - Assert(offset_B.first < (unsigned int)(B.n_rows - submatrix_size.first + 1), - ExcIndexRange(offset_B.first, 0, B.n_rows - submatrix_size.first + 1)); - Assert( - offset_B.second < (unsigned int)(B.n_columns - submatrix_size.second + 1), - ExcIndexRange(offset_B.second, 0, B.n_columns - submatrix_size.second + 1)); + AssertIndexRange(offset_B.first, B.n_rows - submatrix_size.first + 1); + AssertIndexRange(offset_B.second, B.n_columns - submatrix_size.second + 1); // Currently, copying of matrices will only be supported if A and B share the // same MPI communicator @@ -1431,17 +1425,15 @@ ScaLAPACKMatrix::eigenpairs_symmetric_by_index( const bool compute_eigenvectors) { // check validity of index limits - Assert(index_limits.first < (unsigned int)n_rows, - ExcIndexRange(index_limits.first, 0, n_rows)); - Assert(index_limits.second < (unsigned int)n_rows, - ExcIndexRange(index_limits.second, 0, n_rows)); + AssertIndexRange(index_limits.first, n_rows); + AssertIndexRange(index_limits.second, n_rows); std::pair idx = std::make_pair(std::min(index_limits.first, index_limits.second), std::max(index_limits.first, index_limits.second)); // compute all eigenvalues/eigenvectors - if (idx.first == 0 && idx.second == (unsigned int)n_rows - 1) + if (idx.first == 0 && idx.second == static_cast(n_rows - 1)) return eigenpairs_symmetric(compute_eigenvectors); else return eigenpairs_symmetric(compute_eigenvectors, idx); @@ -1723,7 +1715,7 @@ ScaLAPACKMatrix::eigenpairs_symmetric( this->values.swap(eigenvectors->values); // adapt the size of ev to fit m upon return - while ((int)ev.size() > m) + while (ev.size() > static_cast(m)) ev.pop_back(); } /* @@ -1974,7 +1966,7 @@ ScaLAPACKMatrix::eigenpairs_symmetric_MRRR( this->values.swap(eigenvectors->values); // Adapt the size of ev to fit m upon return. - while ((int)ev.size() > m) + while (ev.size() > static_cast(m)) ev.pop_back(); } /* @@ -2549,28 +2541,28 @@ namespace internal LAPACKSupport::State val; state_enum_id = H5Tcreate(H5T_ENUM, sizeof(LAPACKSupport::State)); val = LAPACKSupport::State::cholesky; - herr_t status = H5Tenum_insert(state_enum_id, "cholesky", (int *)&val); + herr_t status = H5Tenum_insert(state_enum_id, "cholesky", &val); AssertThrow(status >= 0, ExcInternalError()); val = LAPACKSupport::State::eigenvalues; - status = H5Tenum_insert(state_enum_id, "eigenvalues", (int *)&val); + status = H5Tenum_insert(state_enum_id, "eigenvalues", &val); AssertThrow(status >= 0, ExcInternalError()); val = LAPACKSupport::State::inverse_matrix; - status = H5Tenum_insert(state_enum_id, "inverse_matrix", (int *)&val); + status = H5Tenum_insert(state_enum_id, "inverse_matrix", &val); AssertThrow(status >= 0, ExcInternalError()); val = LAPACKSupport::State::inverse_svd; - status = H5Tenum_insert(state_enum_id, "inverse_svd", (int *)&val); + status = H5Tenum_insert(state_enum_id, "inverse_svd", &val); AssertThrow(status >= 0, ExcInternalError()); val = LAPACKSupport::State::lu; - status = H5Tenum_insert(state_enum_id, "lu", (int *)&val); + status = H5Tenum_insert(state_enum_id, "lu", &val); AssertThrow(status >= 0, ExcInternalError()); val = LAPACKSupport::State::matrix; - status = H5Tenum_insert(state_enum_id, "matrix", (int *)&val); + status = H5Tenum_insert(state_enum_id, "matrix", &val); AssertThrow(status >= 0, ExcInternalError()); val = LAPACKSupport::State::svd; - status = H5Tenum_insert(state_enum_id, "svd", (int *)&val); + status = H5Tenum_insert(state_enum_id, "svd", &val); AssertThrow(status >= 0, ExcInternalError()); val = LAPACKSupport::State::unusable; - status = H5Tenum_insert(state_enum_id, "unusable", (int *)&val); + status = H5Tenum_insert(state_enum_id, "unusable", &val); AssertThrow(status >= 0, ExcInternalError()); } @@ -2580,25 +2572,22 @@ namespace internal // create HDF5 enum type for LAPACKSupport::Property property_enum_id = H5Tcreate(H5T_ENUM, sizeof(LAPACKSupport::Property)); LAPACKSupport::Property prop = LAPACKSupport::Property::diagonal; - herr_t status = - H5Tenum_insert(property_enum_id, "diagonal", (int *)&prop); + herr_t status = H5Tenum_insert(property_enum_id, "diagonal", &prop); AssertThrow(status >= 0, ExcInternalError()); prop = LAPACKSupport::Property::general; - status = H5Tenum_insert(property_enum_id, "general", (int *)&prop); + status = H5Tenum_insert(property_enum_id, "general", &prop); AssertThrow(status >= 0, ExcInternalError()); prop = LAPACKSupport::Property::hessenberg; - status = H5Tenum_insert(property_enum_id, "hessenberg", (int *)&prop); + status = H5Tenum_insert(property_enum_id, "hessenberg", &prop); AssertThrow(status >= 0, ExcInternalError()); - prop = LAPACKSupport::Property::lower_triangular; - status = - H5Tenum_insert(property_enum_id, "lower_triangular", (int *)&prop); + prop = LAPACKSupport::Property::lower_triangular; + status = H5Tenum_insert(property_enum_id, "lower_triangular", &prop); AssertThrow(status >= 0, ExcInternalError()); prop = LAPACKSupport::Property::symmetric; - status = H5Tenum_insert(property_enum_id, "symmetric", (int *)&prop); + status = H5Tenum_insert(property_enum_id, "symmetric", &prop); AssertThrow(status >= 0, ExcInternalError()); - prop = LAPACKSupport::Property::upper_triangular; - status = - H5Tenum_insert(property_enum_id, "upper_triangular", (int *)&prop); + prop = LAPACKSupport::Property::upper_triangular; + status = H5Tenum_insert(property_enum_id, "upper_triangular", &prop); AssertThrow(status >= 0, ExcInternalError()); } } // namespace @@ -2628,12 +2617,8 @@ ScaLAPACKMatrix::save( chunks_size_.first = n_rows; chunks_size_.second = 1; } - Assert((chunks_size_.first <= (unsigned int)n_rows) && - (chunks_size_.first > 0), - ExcIndexRange(chunks_size_.first, 1, n_rows + 1)); - Assert((chunks_size_.second <= (unsigned int)n_columns) && - (chunks_size_.second > 0), - ExcIndexRange(chunks_size_.second, 1, n_columns + 1)); + AssertIndexRange(chunks_size_.first + 1, n_rows); + AssertIndexRange(chunks_size_.second + 1, n_columns); # ifdef H5_HAVE_PARALLEL // implementation for configurations equipped with a parallel file system @@ -3122,11 +3107,11 @@ ScaLAPACKMatrix::load_serial(const std::string &filename) hsize_t dims[2]; H5Sget_simple_extent_dims(dataspace_id, dims, nullptr); AssertThrow( - (int)dims[0] == n_columns, + static_cast(dims[0]) == n_columns, ExcMessage( "The number of columns of the matrix does not match the content of the archive")); AssertThrow( - (int)dims[1] == n_rows, + static_cast(dims[1]) == n_rows, ExcMessage( "The number of rows of the matrix does not match the content of the archive")); @@ -3167,10 +3152,10 @@ ScaLAPACKMatrix::load_serial(const std::string &filename) // get every dimension hsize_t dims_state[1]; H5Sget_simple_extent_dims(dataspace_state, dims_state, nullptr); - AssertThrow((int)dims_state[0] == 1, ExcIO()); + AssertThrow(static_cast(dims_state[0]) == 1, ExcIO()); hsize_t dims_property[1]; H5Sget_simple_extent_dims(dataspace_property, dims_property, nullptr); - AssertThrow((int)dims_property[0] == 1, ExcIO()); + AssertThrow(static_cast(dims_property[0]) == 1, ExcIO()); // read data status = H5Dread(dataset_state_id, @@ -3318,11 +3303,11 @@ ScaLAPACKMatrix::load_parallel(const std::string &filename) status = H5Sget_simple_extent_dims(dataspace_id, dims, nullptr); AssertThrow(status >= 0, ExcIO()); AssertThrow( - (int)dims[0] == n_columns, + static_cast(dims[0]) == n_columns, ExcMessage( "The number of columns of the matrix does not match the content of the archive")); AssertThrow( - (int)dims[1] == n_rows, + static_cast(dims[1]) == n_rows, ExcMessage( "The number of rows of the matrix does not match the content of the archive")); @@ -3400,10 +3385,10 @@ ScaLAPACKMatrix::load_parallel(const std::string &filename) // get every dimension hsize_t dims_state[1]; H5Sget_simple_extent_dims(dataspace_state, dims_state, nullptr); - AssertThrow((int)dims_state[0] == 1, ExcIO()); + AssertThrow(static_cast(dims_state[0]) == 1, ExcIO()); hsize_t dims_property[1]; H5Sget_simple_extent_dims(dataspace_property, dims_property, nullptr); - AssertThrow((int)dims_property[0] == 1, ExcIO()); + AssertThrow(static_cast(dims_property[0]) == 1, ExcIO()); // read data status = H5Dread(