From f7665b451c73be1d8d0dfc5af96151fdddf2cba6 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Sun, 23 Dec 2018 04:21:09 +0100 Subject: [PATCH] Enhanced compatibility with Intel 19. --- include/deal.II/base/utilities.h | 8 ++++---- source/dofs/dof_tools.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index e1598c2787..59cd5be3d5 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -1213,6 +1213,8 @@ namespace Utilities const std::vector::const_iterator &cend, const bool allow_compression) { + T object; + // the data is never compressed when we can't use zlib. (void)allow_compression; @@ -1234,14 +1236,11 @@ namespace Utilities #endif { Assert(std::distance(cbegin, cend) == sizeof(T), ExcInternalError()); - T object; std::memcpy(&object, &*cbegin, sizeof(T)); - return object; } else { std::string decompressed_buffer; - T object; // first decompress the buffer #ifdef DEAL_II_WITH_ZLIB @@ -1264,8 +1263,9 @@ namespace Utilities boost::archive::binary_iarchive archive(in); archive >> object; - return object; } + + return object; } diff --git a/source/dofs/dof_tools.cc b/source/dofs/dof_tools.cc index 93e76a220d..3ce175aeb2 100644 --- a/source/dofs/dof_tools.cc +++ b/source/dofs/dof_tools.cc @@ -1385,7 +1385,7 @@ namespace DoFTools &dof_handler.get_triangulation()) == nullptr ? [&dof_handler]() { unsigned int max_subdomain_id = 0; - for (auto cell : dof_handler.active_cell_iterators()) + for (const auto &cell : dof_handler.active_cell_iterators()) max_subdomain_id = std::max(max_subdomain_id, cell->subdomain_id()); return max_subdomain_id + 1; -- 2.39.5