Commit f4887245 authored by Christoph Groth's avatar Christoph Groth
Browse files

buffer protocol: support all integer formats

parent 5743ed94
...@@ -88,7 +88,7 @@ Dtype dtype_of_buffer(Py_buffer *view) ...@@ -88,7 +88,7 @@ Dtype dtype_of_buffer(Py_buffer *view)
// Currently, we only understand native endianness and alignment. // Currently, we only understand native endianness and alignment.
if (*fmt == '@') fmt++; if (*fmt == '@') fmt++;
if (strchr("cbB?hHiIlL", *fmt)) { if (strchr("cbB?hHiIlLqQnN", *fmt)) {
dtype = LONG; dtype = LONG;
fmt++; fmt++;
} else if (strchr("fdg", *fmt)) { } else if (strchr("fdg", *fmt)) {
...@@ -458,6 +458,10 @@ T (*get_buffer_converter(Py_buffer *view))(const void *) ...@@ -458,6 +458,10 @@ T (*get_buffer_converter(Py_buffer *view))(const void *)
return number_from_ptr<T, long long>; return number_from_ptr<T, long long>;
case 'Q': case 'Q':
return number_from_ptr<T, unsigned long long>; return number_from_ptr<T, unsigned long long>;
case 'n':
return number_from_ptr<T, ssize_t>;
case 'N':
return number_from_ptr<T, size_t>;
case 'f': case 'f':
return number_from_ptr<T, float>; return number_from_ptr<T, float>;
case 'd': case 'd':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment