Skip to content

Commit a59e045

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 a59e045

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

numcodecs/_utils.pxd

+2-2
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)