Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(16)

Unified Diff: Objects/unicodeobject.c

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Objects/typeobject.c ('k') | Parser/asdl_c.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Objects/unicodeobject.c Tue Jul 26 09:37:46 2011 +0300
+++ b/Objects/unicodeobject.c Mon Jul 25 09:47:18 2011 -0400
@@ -1506,7 +1506,7 @@
(strcmp(lower, "latin1") == 0) ||
(strcmp(lower, "iso-8859-1") == 0))
return PyUnicode_DecodeLatin1(s, size, errors);
-#ifdef HAVE_MBCS
+#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
else if (strcmp(lower, "mbcs") == 0)
return PyUnicode_DecodeMBCS(s, size, errors);
#endif
@@ -1644,7 +1644,7 @@
PyObject *
PyUnicode_EncodeFSDefault(PyObject *unicode)
{
-#ifdef HAVE_MBCS
+#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode),
PyUnicode_GET_SIZE(unicode),
NULL);
@@ -1746,7 +1746,7 @@
return PyUnicode_EncodeLatin1(PyUnicode_AS_UNICODE(unicode),
PyUnicode_GET_SIZE(unicode),
errors);
-#ifdef HAVE_MBCS
+#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
else if (strcmp(lower, "mbcs") == 0)
return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode),
PyUnicode_GET_SIZE(unicode),
@@ -1848,7 +1848,7 @@
PyObject*
PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
{
-#ifdef HAVE_MBCS
+#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
return PyUnicode_DecodeMBCS(s, size, NULL);
#elif defined(__APPLE__)
return PyUnicode_DecodeUTF8(s, size, "surrogateescape");
@@ -4942,7 +4942,7 @@
NULL);
}
-#ifdef HAVE_MBCS
+#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
/* --- MBCS codecs for Windows -------------------------------------------- */
@@ -5229,7 +5229,7 @@
#undef NEED_RETRY
-#endif /* HAVE_MBCS */
+#endif /* MS_WINDOWS */
/* --- Character Mapping Codec -------------------------------------------- */
@@ -9761,6 +9761,8 @@
case 'o':
case 'x':
case 'X':
+ if (c == 'i')
+ c = 'd';
isnumok = 0;
if (PyNumber_Check(v)) {
PyObject *iobj=NULL;
@@ -9775,7 +9777,7 @@
if (iobj!=NULL) {
if (PyLong_Check(iobj)) {
isnumok = 1;
- temp = formatlong(iobj, flags, prec, (c == 'i'? 'd': c));
+ temp = formatlong(iobj, flags, prec, c);
Py_DECREF(iobj);
if (!temp)
goto onError;
« no previous file with comments | « Objects/typeobject.c ('k') | Parser/asdl_c.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+