Skip to content
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

Add noexcept to _utils C-equiv functions #641

Merged
merged 5 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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: 5 additions & 1 deletion docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ Fixes
~~~~~
* Cleanup ``crc32c`` soft dependency.
By :user:`John Kirkham <jakirkham>`, :issue:`637`


Improvements
~~~~~~~~~~~~
* Add `noexcept` to `_utils` C-equiv functions
By :user:`John Kirkham <jakirkham>`, :issue:`641`.

.. _release_0.14.0:

Expand Down
4 changes: 2 additions & 2 deletions numcodecs/_utils.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
from libc.stdint cimport uint8_t, uint32_t


cdef inline void store_le32(uint8_t c[4], uint32_t i) nogil:
cdef inline void store_le32(uint8_t c[4], uint32_t i) noexcept nogil:
c[0] = i & 0xFF
c[1] = (i >> 8) & 0xFF
c[2] = (i >> 16) & 0xFF
c[3] = (i >> 24) & 0xFF


cdef inline uint32_t load_le32(const uint8_t c[4]) nogil:
cdef inline uint32_t load_le32(const uint8_t c[4]) noexcept nogil:
return (
c[0] |
(c[1] << 8) |
Expand Down
Loading