From: Marc Fehling Date: Sun, 23 Dec 2018 03:21:09 +0000 (+0100) Subject: Enhanced compatibility with Intel 19. X-Git-Tag: v9.1.0-rc1~484^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7665b451c73be1d8d0dfc5af96151fdddf2cba6;p=dealii.git Enhanced compatibility with Intel 19. --- 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;