Skip to content

Commit e0d1587

Browse files
authored
Apply C++ lints (#816)
1 parent d84775a commit e0d1587

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/torchcodec/_core/AVIOFileLikeContext.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
namespace facebook::torchcodec {
1111

12-
AVIOFileLikeContext::AVIOFileLikeContext(py::object fileLike, bool isForWriting)
12+
AVIOFileLikeContext::AVIOFileLikeContext(
13+
const py::object& fileLike,
14+
bool isForWriting)
1315
: fileLike_{UniquePyObject(new py::object(fileLike))} {
1416
{
1517
// TODO: Is it necessary to acquire the GIL here? Is it maybe even
@@ -90,7 +92,7 @@ int AVIOFileLikeContext::write(void* opaque, const uint8_t* buf, int buf_size) {
9092
py::gil_scoped_acquire gil;
9193
py::bytes bytes_obj(reinterpret_cast<const char*>(buf), buf_size);
9294

93-
return py::cast<int64_t>((*fileLike)->attr("write")(bytes_obj));
95+
return py::cast<int>((*fileLike)->attr("write")(bytes_obj));
9496
}
9597

9698
} // namespace facebook::torchcodec

src/torchcodec/_core/AVIOFileLikeContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace facebook::torchcodec {
1919
// and seek calls back up to the methods on the Python object.
2020
class AVIOFileLikeContext : public AVIOContextHolder {
2121
public:
22-
explicit AVIOFileLikeContext(py::object fileLike, bool isForWriting);
22+
explicit AVIOFileLikeContext(const py::object& fileLike, bool isForWriting);
2323

2424
private:
2525
static int read(void* opaque, uint8_t* buf, int buf_size);

0 commit comments

Comments
 (0)