Skip to content

Commit 52e74ba

Browse files
committed
Add noexcept to _utils C-equiv functions
The functions in `_utils` are effectively straight C functions. In Cython 0.x, these would have been treated as `noexcept` by default. However in Cython 3.x all functions are treated as potentially raising exceptions (including these). While that is a sensible default in general, these functions still won't raise exceptions. So tidy things up by adding `noexcept` to turn off the additional Cython checks emitted in and around them.
1 parent 29995e3 commit 52e74ba

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docs/release.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ Release notes
1111
Unreleased
1212
----------
1313

14+
Fix
15+
~~~
16+
17+
* Add `noexcept` to `_utils` C-equiv functions
18+
By :user:`John Kirkham <jakirkham>`, :issue:`641`.
19+
1420

1521
.. _release_0.14.0:
1622

numcodecs/_utils.pxd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
from libc.stdint cimport uint8_t, uint32_t
99

1010

11-
cdef inline void store_le32(uint8_t c[4], uint32_t i) nogil:
11+
cdef inline void store_le32(uint8_t c[4], uint32_t i) nogil noexcept:
1212
c[0] = i & 0xFF
1313
c[1] = (i >> 8) & 0xFF
1414
c[2] = (i >> 16) & 0xFF
1515
c[3] = (i >> 24) & 0xFF
1616

1717

18-
cdef inline uint32_t load_le32(const uint8_t c[4]) nogil:
18+
cdef inline uint32_t load_le32(const uint8_t c[4]) nogil noexcept:
1919
return (
2020
c[0] |
2121
(c[1] << 8) |

0 commit comments

Comments
 (0)