Fixed warnings on Windows (#407)

Now builds clean on MSVC: cl version 19.51.36260 for x64, from Visual
Studio 2026 Build Tools 18.10.3.

Major items:

- [[maybe_unused]] instead of gcc/clang specific pragmas
- Removed names variables that weren't used
- Cast + explicit uing64
This commit is contained in:
Erik Fröjdh
2026-10-06 14:49:24 +02:00
committed by GitHub
parent 7e1b8a765d
commit cdd8586f64
15 changed files with 47 additions and 91 deletions
+5 -12
View File
@@ -13,11 +13,6 @@
#include <string>
#include <utility>
// Disable warnings for unused parameters, as we ignore some
// in the __exit__ method
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
namespace py = pybind11;
using namespace ::aare;
@@ -171,14 +166,12 @@ void define_ClusterFile(py::module &m, const std::string &typestr) {
.def("__enter__", [](ClusterFile<ClusterType> &self) { return &self; })
.def("__exit__",
[](ClusterFile<ClusterType> &self,
const std::optional<pybind11::type> &exc_type,
const std::optional<pybind11::object> &exc_value,
const std::optional<pybind11::object> &traceback) {
self.close();
})
[[maybe_unused]] const std::optional<pybind11::type> &exc_type,
[[maybe_unused]] const std::optional<pybind11::object>
&exc_value,
[[maybe_unused]] const std::optional<pybind11::object>
&traceback) { self.close(); })
.def("__iter__", [](ClusterFile<ClusterType> &self) { return &self; })
.def("__next__",
[](File &self) { return ChunkIterator(self.chunks()).next(); });
}
#pragma GCC diagnostic pop