From 7968ae45888e63d8f2dd5c4dbd7efc119a1c72f3 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Tue, 16 Jul 2024 13:48:17 +0200 Subject: [PATCH] use std::array in IVec (for 0-size handling) --- libsrc/core/hashtable.hpp | 5 +++-- libsrc/core/ng_mpi.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libsrc/core/hashtable.hpp b/libsrc/core/hashtable.hpp index 1be25b86..408cec4c 100644 --- a/libsrc/core/hashtable.hpp +++ b/libsrc/core/hashtable.hpp @@ -46,7 +46,8 @@ namespace ngcore class IVec { /// data - T i[(N>0)?N:1]; + // T i[(N>0)?N:1]; + std::array i; public: /// @@ -81,7 +82,7 @@ namespace ngcore template void DoArchive(ARCHIVE& ar) { - ar.Do(i, N); + ar.Do(i.begin(), N); } template diff --git a/libsrc/core/ng_mpi.cpp b/libsrc/core/ng_mpi.cpp index 66355a96..bc0470ef 100644 --- a/libsrc/core/ng_mpi.cpp +++ b/libsrc/core/ng_mpi.cpp @@ -164,7 +164,7 @@ void ng_init_mpi() { imported_mpi4py = true; } PyObject* py_src = src.ptr(); - auto type = Py_TYPE(py_src); + [[maybe_unused]] auto type = Py_TYPE(py_src); if (PyObject_TypeCheck(py_src, &PyMPIComm_Type)) { dst = mpi2ng(*PyMPIComm_Get(py_src)); return !PyErr_Occurred();