From ccf4149307802ca6db84c06a1a45727d915f5dfb Mon Sep 17 00:00:00 2001 From: lucafedeli88 Date: Wed, 30 Oct 2024 01:03:57 +0100 Subject: [PATCH] fix performance-unnecessary-value-param and bugprone-narrowing-conversion issues --- multi_physics/QED/python_bindings/pxr_qed.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/multi_physics/QED/python_bindings/pxr_qed.cpp b/multi_physics/QED/python_bindings/pxr_qed.cpp index b1c140138..0080a9d51 100644 --- a/multi_physics/QED/python_bindings/pxr_qed.cpp +++ b/multi_physics/QED/python_bindings/pxr_qed.cpp @@ -1064,7 +1064,7 @@ PYBIND11_MODULE(pxr_qed, m) { py::arg("do_regular") = py::bool_(true), py::arg("verbose") = py::bool_(true)) .def("save_as", - [&](const bw_dndt_lookup_table &self, const std::string file_name){ + [&](const bw_dndt_lookup_table &self, const std::string& file_name){ if(!self.is_init()){ throw_error("Table must be initialized!"); } @@ -1074,12 +1074,12 @@ PYBIND11_MODULE(pxr_qed, m) { if( !of ){ throw_error("Opening file failed!"); } - of.write(raw.data(), raw.size()); + of.write(raw.data(), static_cast(raw.size())); of.close(); }, py::arg("file_name")) .def("load_from", - [&](bw_dndt_lookup_table &self, const std::string file_name){ + [&](bw_dndt_lookup_table &self, const std::string& file_name){ auto input = std::ifstream(file_name, std::ios::ate | std::ios::binary); if( !input ){ @@ -1147,7 +1147,7 @@ PYBIND11_MODULE(pxr_qed, m) { if( !of ){ throw_error("Opening file failed!"); } - of.write(raw.data(), raw.size()); + of.write(raw.data(), static_cast(raw.size())); of.close(); }, py::arg("file_name")) @@ -1302,7 +1302,7 @@ PYBIND11_MODULE(pxr_qed, m) { if( !of ){ throw_error("Opening file failed!"); } - of.write(raw.data(), raw.size()); + of.write(raw.data(), static_cast(raw.size())); of.close(); }, py::arg("file_name")) @@ -1375,7 +1375,7 @@ PYBIND11_MODULE(pxr_qed, m) { if( !of ){ throw_error("Opening file failed!"); } - of.write(raw.data(), raw.size()); + of.write(raw.data(), static_cast(raw.size())); of.close(); }, py::arg("file_name"))