From 6335398341b262a73ec58b5caf81141f72993d8b Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Mon, 10 Dec 2018 13:32:03 +0100 Subject: [PATCH] fix compile error, some lint --- libsrc/core/archive.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libsrc/core/archive.hpp b/libsrc/core/archive.hpp index a72d4dde..0b87e843 100644 --- a/libsrc/core/archive.hpp +++ b/libsrc/core/archive.hpp @@ -415,7 +415,7 @@ namespace ngcore template Archive& operator &(const T*& t) { - return (*this) & const_cast(t); + return (*this) & const_cast(t); // NOLINT } // Write a read only variable @@ -435,11 +435,11 @@ namespace ngcore template struct Caster { - static void* tryUpcast (const std::type_info& ti, T* p) + static void* tryUpcast (const std::type_info& /*unused*/, T* /*unused*/) { throw std::runtime_error("Upcast not successful, some classes are not registered properly for archiving!"); } - static void* tryDowncast (const std::type_info& ti, void* p) + static void* tryDowncast (const std::type_info& /*unused*/, void* /*unused*/) { throw std::runtime_error("Downcast not successful, some classes are not registered properly for archiving!"); } @@ -495,7 +495,7 @@ namespace ngcore { size_t ptr = 0; enum { BUFFERSIZE = 1024 }; - char buffer[BUFFERSIZE]; + char buffer[BUFFERSIZE] alignas(64); std::shared_ptr fout; public: BinaryOutArchive(std::shared_ptr afout) : Archive(true), fout(afout) @@ -558,11 +558,11 @@ namespace ngcore if (unlikely(ptr > BUFFERSIZE-sizeof(T))) { fout->write(&buffer[0], ptr); - *static_cast(&buffer[0]) = x; + *reinterpret_cast(&buffer[0]) = x; // NOLINT ptr = sizeof(T); return *this; } - *static_cast(&buffer[ptr]) = x; + *reinterpret_cast(&buffer[ptr]) = x; // NOLINT ptr += sizeof(T); return *this; }