Skip to content

_hydra.pyx: Fix Cannot assign type 'double' to 'long'/'size_t' #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/_hydra.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ cdef class MMapBitField:
filename = filename.encode('utf8')
self._filename = filename
self._bitsize = bitsize
self._bytesize = (bitsize / 8) + 2
self._bytesize = (bitsize // 8) + 2
self._read_only = read_only
self._fdatasync_on_close = fdatasync_on_close

Expand Down Expand Up @@ -94,7 +94,7 @@ cdef class MMapBitField:
flush_to_disk(self._fd)

def __setitem__(self, size_t key, int value):
cdef size_t byte_offset = key / 8
cdef size_t byte_offset = key // 8
cdef char bitmask
cdef char bitval

Expand All @@ -113,7 +113,7 @@ cdef class MMapBitField:
self._buffer[byte_offset] = bitval

def __getitem__(self, size_t key):
cdef size_t byte_offset = key / 8
cdef size_t byte_offset = key // 8

if self._fd < 0 or not self._buffer:
raise ValueError('I/O operation on closed file')
Expand Down