summaryrefslogtreecommitdiff
path: root/Include/unicodeobject.h
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-06-15 19:04:29 -0400
committerBrett Cannon <brett@python.org>2012-06-15 19:04:29 -0400
commit24aa693c7ef8f217fbd238eb7af7d828e13a07eb (patch)
tree7d01ab630c2e8eef1e168b1aa5d84131b60cfd50 /Include/unicodeobject.h
parent99d776fdf4aa5a66266ebcec2263fab501f03088 (diff)
parent016ef551a793f72f582d707ce5bb55bf4940cf27 (diff)
downloadcpython-git-24aa693c7ef8f217fbd238eb7af7d828e13a07eb.tar.gz
Merge
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r--Include/unicodeobject.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index e40cc98d25..135e4694b0 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -188,9 +188,9 @@ typedef unsigned char Py_UCS1;
(((((Py_UCS4)(high) & 0x03FF) << 10) | \
((Py_UCS4)(low) & 0x03FF)) + 0x10000)
/* high surrogate = top 10 bits added to D800 */
-#define Py_UNICODE_HIGH_SURROGATE(ch) (0xD800 | (((ch) - 0x10000) >> 10))
+#define Py_UNICODE_HIGH_SURROGATE(ch) (0xD800 - (0x10000 >> 10) + ((ch) >> 10))
/* low surrogate = bottom 10 bits added to DC00 */
-#define Py_UNICODE_LOW_SURROGATE(ch) (0xDC00 | (((ch) - 0x10000) & 0x3FF))
+#define Py_UNICODE_LOW_SURROGATE(ch) (0xDC00 + ((ch) & 0x3FF))
/* Check if substring matches at given offset. The offset must be
valid, and the substring must not be empty. */