summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-10-30 00:42:39 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-10-30 00:42:39 (GMT)
commit76df43de30f40b5cc1de9d36a5a083dd8bd8cb27 (patch)
treebe245b62c632a103851fa69d447e8d89e3ac782f /Include
parenta5e7cd06bb314f338eff3e2ef948ef35bed4487b (diff)
downloadcpython-76df43de30f40b5cc1de9d36a5a083dd8bd8cb27.zip
cpython-76df43de30f40b5cc1de9d36a5a083dd8bd8cb27.tar.gz
cpython-76df43de30f40b5cc1de9d36a5a083dd8bd8cb27.tar.bz2
Issue #16330: Use surrogate-related macros
Patch written by Serhiy Storchaka.
Diffstat (limited to 'Include')
-rw-r--r--Include/unicodeobject.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index fa21c1c..363776b 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -180,9 +180,9 @@ typedef unsigned char Py_UCS1;
} while (0)
/* macros to work with surrogates */
-#define Py_UNICODE_IS_SURROGATE(ch) (0xD800 <= ch && ch <= 0xDFFF)
-#define Py_UNICODE_IS_HIGH_SURROGATE(ch) (0xD800 <= ch && ch <= 0xDBFF)
-#define Py_UNICODE_IS_LOW_SURROGATE(ch) (0xDC00 <= ch && ch <= 0xDFFF)
+#define Py_UNICODE_IS_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDFFF)
+#define Py_UNICODE_IS_HIGH_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDBFF)
+#define Py_UNICODE_IS_LOW_SURROGATE(ch) (0xDC00 <= (ch) && (ch) <= 0xDFFF)
/* Join two surrogate characters and return a single Py_UCS4 value. */
#define Py_UNICODE_JOIN_SURROGATES(high, low) \
(((((Py_UCS4)(high) & 0x03FF) << 10) | \