Skip to content

Fix const discard warnings in fletcher32 #728

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

Merged
Merged
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ Release notes

.. _unreleased:

Unreleased
----------

Enhancements
~~~~~~~~~~~~

Improvements
~~~~~~~~~~~~

Fixes
~~~~~

* Fix ``const`` discard warnings in ``fletcher32``.
By :user:`John Kirkham <jakirkham>`, :issue:`728`

Maintenance
~~~~~~~~~~~


0.16.0
------

Expand Down
4 changes: 2 additions & 2 deletions numcodecs/fletcher32.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Fletcher32(Codec):
"""Return buffer plus a footer with the fletcher checksum (4-bytes)"""
buf = ensure_contiguous_ndarray(buf).ravel().view('uint8')
cdef const uint8_t[::1] b_mv = buf
cdef uint8_t* b_ptr = &b_mv[0]
cdef const uint8_t* b_ptr = &b_mv[0]
cdef Py_ssize_t b_len = len(b_mv)

cdef Py_ssize_t out_len = b_len + FOOTER_LENGTH
Expand All @@ -92,7 +92,7 @@ class Fletcher32(Codec):
"""Check fletcher checksum, and return buffer without it"""
b = ensure_contiguous_ndarray(buf).view('uint8')
cdef const uint8_t[::1] b_mv = b
cdef uint8_t* b_ptr = &b_mv[0]
cdef const uint8_t* b_ptr = &b_mv[0]
cdef Py_ssize_t b_len = len(b_mv)

val = _fletcher32(b_mv[:-FOOTER_LENGTH])
Expand Down
Loading