Skip to content

Commit 01ac8b6

Browse files
committed
Use correct types for ASCII_CHAR_MASK integer constants.
1 parent 7319f69 commit 01ac8b6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Objects/stringlib/codecs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
/* Mask to quickly check whether a C 'long' contains a
99
non-ASCII, UTF8-encoded char. */
1010
#if (SIZEOF_LONG == 8)
11-
# define ASCII_CHAR_MASK 0x8080808080808080L
11+
# define ASCII_CHAR_MASK 0x8080808080808080UL
1212
#elif (SIZEOF_LONG == 4)
13-
# define ASCII_CHAR_MASK 0x80808080L
13+
# define ASCII_CHAR_MASK 0x80808080UL
1414
#else
1515
# error C 'long' size should be either 4 or 8!
1616
#endif

Objects/stringlib/find_max_char.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
/* Mask to quickly check whether a C 'long' contains a
99
non-ASCII, UTF8-encoded char. */
1010
#if (SIZEOF_LONG == 8)
11-
# define UCS1_ASCII_CHAR_MASK 0x8080808080808080L
11+
# define UCS1_ASCII_CHAR_MASK 0x8080808080808080UL
1212
#elif (SIZEOF_LONG == 4)
13-
# define UCS1_ASCII_CHAR_MASK 0x80808080L
13+
# define UCS1_ASCII_CHAR_MASK 0x80808080UL
1414
#else
1515
# error C 'long' size should be either 4 or 8!
1616
#endif

Objects/unicodeobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4639,9 +4639,9 @@ PyUnicode_DecodeUTF8(const char *s,
46394639
/* Mask to quickly check whether a C 'long' contains a
46404640
non-ASCII, UTF8-encoded char. */
46414641
#if (SIZEOF_LONG == 8)
4642-
# define ASCII_CHAR_MASK 0x8080808080808080L
4642+
# define ASCII_CHAR_MASK 0x8080808080808080UL
46434643
#elif (SIZEOF_LONG == 4)
4644-
# define ASCII_CHAR_MASK 0x80808080L
4644+
# define ASCII_CHAR_MASK 0x80808080UL
46454645
#else
46464646
# error C 'long' size should be either 4 or 8!
46474647
#endif

0 commit comments

Comments
 (0)