diff --git a/src/core/buffer.cc b/src/core/buffer.cc index 873a751ee5..829c43db1d 100644 --- a/src/core/buffer.cc +++ b/src/core/buffer.cc @@ -930,7 +930,7 @@ class Mmap_BufferImpl : public BufferImpl, MemoryMapWorker { for (size_t i = 0; i < n; ++i) { data[i] = Py_None; } - Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + n); + Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + static_cast(n)); } impl_->contains_pyobjects_ = true; return *this; @@ -955,7 +955,7 @@ class Mmap_BufferImpl : public BufferImpl, MemoryMapWorker { if (n_new > n_old) { PyObject** data = static_cast(xptr()); for (size_t i = n_old; i < n_new; ++i) data[i] = Py_None; - Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + n_new - n_old); + Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + static_cast(n_new - n_old)); } } else { impl_->resize(newsize); @@ -1019,7 +1019,7 @@ class Mmap_BufferImpl : public BufferImpl, MemoryMapWorker { size_t i = 0; for (; i < n_copy; ++i) Py_INCREF(newdata[i]); for (; i < n_new; ++i) newdata[i] = Py_None; - Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + n_new - n_copy); + Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + static_cast(n_new - n_copy)); } impl_->release(); // noexcept } diff --git a/src/core/column/const_na.cc b/src/core/column/const_na.cc index 6ec7215ac2..d942ab76d9 100644 --- a/src/core/column/const_na.cc +++ b/src/core/column/const_na.cc @@ -85,7 +85,7 @@ static Column _fw_col(size_t nrows, SType stype) { }); if (std::is_same::value) { - Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + nrows); + Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + static_cast(nrows)); buf.set_pyobjects(/* clear_data= */ false); } return Column(new ColClass(nrows, stype, std::move(buf))); @@ -102,7 +102,7 @@ static Column _special_col(size_t nrows) { }); if (std::is_same::value) { - Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + nrows); + Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + static_cast(nrows)); buf.set_pyobjects(/* clear_data= */ false); } return Column(new ColClass(nrows, std::move(buf)));