Skip to content

Commit 30c2eb2

Browse files
committed
Use unsigned short instead
1 parent 53147e7 commit 30c2eb2

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Include/cpython/unicodeobject.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,25 +132,23 @@ typedef struct {
132132
* all characters are in the range U+0000-U+10FFFF
133133
* at least one character is in the range U+10000-U+10FFFF
134134
*/
135-
unsigned char kind:3;
135+
unsigned short kind:3;
136136
/* Compact is with respect to the allocation scheme. Compact unicode
137137
objects only require one memory block while non-compact objects use
138138
one block for the PyUnicodeObject struct and another for its data
139139
buffer. */
140-
unsigned char compact:1;
140+
unsigned short compact:1;
141141
/* The string only contains characters in the range U+0000-U+007F (ASCII)
142142
and the kind is PyUnicode_1BYTE_KIND. If ascii is set and compact is
143143
set, use the PyASCIIObject structure. */
144-
unsigned char ascii:1;
144+
unsigned short ascii:1;
145145
/* The object is statically allocated. */
146-
unsigned char statically_allocated:1;
146+
unsigned short statically_allocated:1;
147147
/* Padding to ensure that PyUnicode_DATA() is always aligned to
148-
4 bytes (see issue #19537 on m68k) and we use unsigned char to avoid
148+
4 bytes (see issue #19537 on m68k) and we use unsigned short to avoid
149149
the extra four bytes on 32-bit Windows. This is restricted features
150150
for specific compilers including GCC, MSVC, Clang and IBM's XL compiler. */
151-
unsigned char :2;
152-
unsigned char :8;
153-
unsigned char :8;
151+
unsigned short :10;
154152
} state;
155153
} PyASCIIObject;
156154

0 commit comments

Comments
 (0)