[Python-checkins] cpython: Use correct types for ASCII_CHAR_MASK integer constants.

mark.dickinson python-checkins at python.org
Sat Jul 7 14:09:00 CEST 2012


http://hg.python.org/cpython/rev/ab9e824116eb
changeset:   77966:ab9e824116eb
user:        Mark Dickinson <mdickinson at enthought.com>
date:        Sat Jul 07 14:08:48 2012 +0200
summary:
  Use correct types for ASCII_CHAR_MASK integer constants.

files:
  Objects/stringlib/codecs.h        |  4 ++--
  Objects/stringlib/find_max_char.h |  4 ++--
  Objects/unicodeobject.c           |  4 ++--
  3 files changed, 6 insertions(+), 6 deletions(-)


diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h
--- a/Objects/stringlib/codecs.h
+++ b/Objects/stringlib/codecs.h
@@ -8,9 +8,9 @@
 /* Mask to quickly check whether a C 'long' contains a
    non-ASCII, UTF8-encoded char. */
 #if (SIZEOF_LONG == 8)
-# define ASCII_CHAR_MASK 0x8080808080808080L
+# define ASCII_CHAR_MASK 0x8080808080808080UL
 #elif (SIZEOF_LONG == 4)
-# define ASCII_CHAR_MASK 0x80808080L
+# define ASCII_CHAR_MASK 0x80808080UL
 #else
 # error C 'long' size should be either 4 or 8!
 #endif
diff --git a/Objects/stringlib/find_max_char.h b/Objects/stringlib/find_max_char.h
--- a/Objects/stringlib/find_max_char.h
+++ b/Objects/stringlib/find_max_char.h
@@ -8,9 +8,9 @@
 /* Mask to quickly check whether a C 'long' contains a
    non-ASCII, UTF8-encoded char. */
 #if (SIZEOF_LONG == 8)
-# define UCS1_ASCII_CHAR_MASK 0x8080808080808080L
+# define UCS1_ASCII_CHAR_MASK 0x8080808080808080UL
 #elif (SIZEOF_LONG == 4)
-# define UCS1_ASCII_CHAR_MASK 0x80808080L
+# define UCS1_ASCII_CHAR_MASK 0x80808080UL
 #else
 # error C 'long' size should be either 4 or 8!
 #endif
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -4639,9 +4639,9 @@
 /* Mask to quickly check whether a C 'long' contains a
    non-ASCII, UTF8-encoded char. */
 #if (SIZEOF_LONG == 8)
-# define ASCII_CHAR_MASK 0x8080808080808080L
+# define ASCII_CHAR_MASK 0x8080808080808080UL
 #elif (SIZEOF_LONG == 4)
-# define ASCII_CHAR_MASK 0x80808080L
+# define ASCII_CHAR_MASK 0x80808080UL
 #else
 # error C 'long' size should be either 4 or 8!
 #endif

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list