Skip to content

Commit ccf4149

Browse files
committed
fix performance-unnecessary-value-param and bugprone-narrowing-conversion issues
1 parent 917b8c9 commit ccf4149

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

multi_physics/QED/python_bindings/pxr_qed.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ PYBIND11_MODULE(pxr_qed, m) {
10641064
py::arg("do_regular") = py::bool_(true),
10651065
py::arg("verbose") = py::bool_(true))
10661066
.def("save_as",
1067-
[&](const bw_dndt_lookup_table &self, const std::string file_name){
1067+
[&](const bw_dndt_lookup_table &self, const std::string& file_name){
10681068
if(!self.is_init()){
10691069
throw_error("Table must be initialized!");
10701070
}
@@ -1074,12 +1074,12 @@ PYBIND11_MODULE(pxr_qed, m) {
10741074
if( !of ){
10751075
throw_error("Opening file failed!");
10761076
}
1077-
of.write(raw.data(), raw.size());
1077+
of.write(raw.data(), static_cast<int>(raw.size()));
10781078
of.close();
10791079
},
10801080
py::arg("file_name"))
10811081
.def("load_from",
1082-
[&](bw_dndt_lookup_table &self, const std::string file_name){
1082+
[&](bw_dndt_lookup_table &self, const std::string& file_name){
10831083
auto input = std::ifstream(file_name,
10841084
std::ios::ate | std::ios::binary);
10851085
if( !input ){
@@ -1147,7 +1147,7 @@ PYBIND11_MODULE(pxr_qed, m) {
11471147
if( !of ){
11481148
throw_error("Opening file failed!");
11491149
}
1150-
of.write(raw.data(), raw.size());
1150+
of.write(raw.data(), static_cast<int>(raw.size()));
11511151
of.close();
11521152
},
11531153
py::arg("file_name"))
@@ -1302,7 +1302,7 @@ PYBIND11_MODULE(pxr_qed, m) {
13021302
if( !of ){
13031303
throw_error("Opening file failed!");
13041304
}
1305-
of.write(raw.data(), raw.size());
1305+
of.write(raw.data(), static_cast<int>(raw.size()));
13061306
of.close();
13071307
},
13081308
py::arg("file_name"))
@@ -1375,7 +1375,7 @@ PYBIND11_MODULE(pxr_qed, m) {
13751375
if( !of ){
13761376
throw_error("Opening file failed!");
13771377
}
1378-
of.write(raw.data(), raw.size());
1378+
of.write(raw.data(), static_cast<int>(raw.size()));
13791379
of.close();
13801380
},
13811381
py::arg("file_name"))

0 commit comments

Comments
 (0)