From 8ac2d67a76d58f26cce47860e1a1ecc1c82730a7 Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Thu, 27 Nov 2025 03:55:58 +0530 Subject: [PATCH] Make bytes_to_python const non-static --- src/core/bpf_map.cpp | 3 ++- src/core/bpf_map.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/bpf_map.cpp b/src/core/bpf_map.cpp index 2c00ed4..81f4526 100644 --- a/src/core/bpf_map.cpp +++ b/src/core/bpf_map.cpp @@ -1,6 +1,7 @@ #include "core/bpf_map.h" #include "core/bpf_exception.h" #include "core/bpf_object.h" +#include "utils/struct_parser.h" #include #include #include @@ -233,7 +234,7 @@ void BpfMap::python_to_bytes_inplace(const py::object &obj, } } -py::object BpfMap::bytes_to_python(std::span data) { +py::object BpfMap::bytes_to_python(std::span data) const { // NOTE: Struct parsing for value type if (struct_parser_ && !value_struct_name_.empty()) { py::bytes py_data(reinterpret_cast(data.data()), data.size()); diff --git a/src/core/bpf_map.h b/src/core/bpf_map.h index 94bc551..3aa45e3 100644 --- a/src/core/bpf_map.h +++ b/src/core/bpf_map.h @@ -79,7 +79,7 @@ public: private: static void python_to_bytes_inplace(const py::object &obj, std::span buffer); - static py::object bytes_to_python(std::span data); + py::object bytes_to_python(std::span data) const; }; #endif // PYLIBBPF_BPF_MAP_H