Skip to content

Commit 46de0e1

Browse files
committed
(Clarify why NPY_TYPEKINDCHAR had to be created)
1 parent 96831e4 commit 46de0e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/npyffi/types.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,12 @@ pub enum NPY_TYPECHAR {
235235
NPY_UINTPLTR = b'P',
236236
}
237237

238+
// Note: NPY_TYPEKINDCHAR doesn't exist in the header and has been created here artificially
239+
// because the original C enum contained duplicate values - namely, those related to type kinds.
240+
// There's also a comment in the C code preceding this block of values and stating that they are
241+
// related to type kind chars and not type codes.
238242
#[repr(u8)]
239243
#[derive(Debug, Clone, Copy)]
240-
// NPY_TYPEKINDCHAR doesn't exist in the header, but these enum values are not
241-
// related to NPY_TYPECHAR although being stuffed into it (type kinds, not type codes)
242244
pub enum NPY_TYPEKINDCHAR {
243245
NPY_GENBOOLLTR = b'b',
244246
NPY_SIGNEDLTR = b'i',

0 commit comments

Comments
 (0)