flags = "0"
is_unsigned = "0"
- if dtype.is_int:
+ if dtype is PyrexTypes.c_char_type:
+ is_unsigned = "IS_UNSIGNED(%s)" % declcode
+ typegroup = "'H'"
+ elif dtype.is_int:
is_unsigned = "IS_UNSIGNED(%s)" % declcode
typegroup = "%s ? 'U' : 'I'" % is_unsigned
elif complex_possible or dtype.is_complex:
elif dtype.is_pyobject:
typegroup = "'O'"
else:
- assert False
+ assert False, dtype
typeinfo = ('static __Pyx_TypeInfo %s = '
'{ "%s", %s, sizeof(%s), { %s }, %s, %s, %s, %s };')
size_t size; /* sizeof(type) */
size_t arraysize[8]; /* length of array in each dimension */
int ndim;
- char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject */
+ char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
char is_unsigned;
int flags;
} __Pyx_TypeInfo;
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
switch (ch) {
- case 'b': return "'char'";
+ case 'c': return "'char'";
+ case 'b': return "'signed char'";
case 'B': return "'unsigned char'";
case 'h': return "'short'";
case 'H': return "'unsigned short'";
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
switch (ch) {
- case 'c': case 'b': case 'h': case 'i':
+ case 'c':
+ return 'H';
+ case 'b': case 'h': case 'i':
case 'l': case 'q': case 's': case 'p':
return 'I';
case 'B': case 'H': case 'I': case 'L': case 'Q':
size_t size = type->size;
switch (type->typegroup) {
+ case 'H':
+ *buf = 'c';
+ break;
case 'I':
case 'U':
if (size == 1)