From: Daniel Arndt Date: Wed, 15 Jan 2020 16:14:00 +0000 (-0700) Subject: Fix some coverity complains X-Git-Tag: v9.2.0-rc1~667^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9337%2Fhead;p=dealii.git Fix some coverity complains --- diff --git a/contrib/python-bindings/source/manifold_wrapper.cc b/contrib/python-bindings/source/manifold_wrapper.cc index d364dc014a..f5ccf84f49 100644 --- a/contrib/python-bindings/source/manifold_wrapper.cc +++ b/contrib/python-bindings/source/manifold_wrapper.cc @@ -120,6 +120,7 @@ namespace python ManifoldWrapper::ManifoldWrapper(const int dim, const int spacedim) : dim(dim) , spacedim(spacedim) + , manifold_ptr(nullptr) { AssertThrow(((dim == 2) && (spacedim == 2)) || ((dim == 2) && (spacedim == 3)) || diff --git a/include/deal.II/base/mpi.h b/include/deal.II/base/mpi.h index 22548c4140..37557429b3 100644 --- a/include/deal.II/base/mpi.h +++ b/include/deal.II/base/mpi.h @@ -1588,9 +1588,10 @@ namespace Utilities } // Wait to have sent all objects. - MPI_Waitall(send_to.size(), - buffer_send_requests.data(), - MPI_STATUSES_IGNORE); + const int ierr = MPI_Waitall(send_to.size(), + buffer_send_requests.data(), + MPI_STATUSES_IGNORE); + AssertThrowMPI(ierr); return received_objects; # endif // deal.II with MPI diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 99b9a09ec7..357b53f530 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -162,7 +162,7 @@ namespace GridGenerator /** * Constructor. */ - MeshGenerator(AdditionalData data) + MeshGenerator(const AdditionalData &data) : refinements(data.refinements) , n_subdivision_x_0(data.n_subdivision_x_0) , n_subdivision_x_1(data.n_subdivision_x_1) diff --git a/source/lac/sparsity_pattern.cc b/source/lac/sparsity_pattern.cc index 177c6f3b08..a47a6e04a0 100644 --- a/source/lac/sparsity_pattern.cc +++ b/source/lac/sparsity_pattern.cc @@ -39,7 +39,10 @@ __declspec(selectany) // Weak extern binding due to multiple link error SparsityPatternBase::SparsityPatternBase() : max_dim(0) + , rows(0) + , cols(0) , max_vec_len(0) + , max_row_length(0) , rowstart(nullptr) , colnums(nullptr) , compressed(false) diff --git a/source/lac/trilinos_sparse_matrix.cc b/source/lac/trilinos_sparse_matrix.cc index 5e8b2f67a6..da9ada4a61 100644 --- a/source/lac/trilinos_sparse_matrix.cc +++ b/source/lac/trilinos_sparse_matrix.cc @@ -2407,7 +2407,11 @@ namespace TrilinosWrappers for (int i = 0; i < matrix->NumMyRows(); ++i) { - matrix->ExtractMyRowView(i, num_entries, values, indices); + const int ierr = + matrix->ExtractMyRowView(i, num_entries, values, indices); + (void)ierr; + Assert(ierr == 0, ExcTrilinosError(ierr)); + for (TrilinosWrappers::types::int_type j = 0; j < num_entries; ++j) out << "(" << TrilinosWrappers::global_row_index(*matrix, i) << ","