Commit 5c4a9d65 authored by Marc-André Lemburg's avatar Marc-André Lemburg

Whitespace corrections.

parent e115ec83
...@@ -850,7 +850,7 @@ char utf7_special[128] = { ...@@ -850,7 +850,7 @@ char utf7_special[128] = {
#define SPECIAL(c, encodeO, encodeWS) \ #define SPECIAL(c, encodeO, encodeWS) \
((c) > 127 || (c) <= 0 || utf7_special[(c)] == 1 || \ ((c) > 127 || (c) <= 0 || utf7_special[(c)] == 1 || \
(encodeWS && (utf7_special[(c)] == 2)) || \ (encodeWS && (utf7_special[(c)] == 2)) || \
(encodeO && (utf7_special[(c)] == 3))) (encodeO && (utf7_special[(c)] == 3)))
#define B64(n) \ #define B64(n) \
...@@ -861,29 +861,29 @@ char utf7_special[128] = { ...@@ -861,29 +861,29 @@ char utf7_special[128] = {
((c) == '+' ? 62 : (c) == '/' ? 63 : (c) >= 'a' ? \ ((c) == '+' ? 62 : (c) == '/' ? 63 : (c) >= 'a' ? \
(c) - 71 : (c) >= 'A' ? (c) - 65 : (c) + 4 ) (c) - 71 : (c) >= 'A' ? (c) - 65 : (c) + 4 )
#define ENCODE(out, ch, bits) \ #define ENCODE(out, ch, bits) \
while (bits >= 6) { \ while (bits >= 6) { \
*out++ = B64(ch >> (bits-6)); \ *out++ = B64(ch >> (bits-6)); \
bits -= 6; \ bits -= 6; \
} }
#define DECODE(out, ch, bits, surrogate) \ #define DECODE(out, ch, bits, surrogate) \
while (bits >= 16) { \ while (bits >= 16) { \
Py_UNICODE outCh = (Py_UNICODE) ((ch >> (bits-16)) & 0xffff); \ Py_UNICODE outCh = (Py_UNICODE) ((ch >> (bits-16)) & 0xffff); \
bits -= 16; \ bits -= 16; \
if (surrogate) { \ if (surrogate) { \
/* We have already generated an error for the high surrogate \ /* We have already generated an error for the high surrogate \
so let's not bother seeing if the low surrogate is correct or not */ \ so let's not bother seeing if the low surrogate is correct or not */ \
surrogate = 0; \ surrogate = 0; \
} else if (0xDC00 <= outCh && outCh <= 0xDFFF) { \ } else if (0xDC00 <= outCh && outCh <= 0xDFFF) { \
/* This is a surrogate pair. Unfortunately we can't represent \ /* This is a surrogate pair. Unfortunately we can't represent \
it in a 16-bit character */ \ it in a 16-bit character */ \
surrogate = 1; \ surrogate = 1; \
errmsg = "code pairs are not supported"; \ errmsg = "code pairs are not supported"; \
goto utf7Error; \ goto utf7Error; \
} else { \ } else { \
*out++ = outCh; \ *out++ = outCh; \
} \ } \
} }
PyObject *PyUnicode_DecodeUTF7(const char *s, PyObject *PyUnicode_DecodeUTF7(const char *s,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment