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

Side by Side Diff: Python/modsupport.c

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
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 unified diff | Download patch
« no previous file with comments | « Python/marshal.c ('k') | Python/Python-ast.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* Module support implementation */ 2 /* Module support implementation */
3 3
4 #include "Python.h" 4 #include "Python.h"
5 5
6 #define FLAG_SIZE_T 1 6 #define FLAG_SIZE_T 1
7 typedef double va_double; 7 typedef double va_double;
8 8
9 static PyObject *va_build_value(const char *, va_list, int); 9 static PyObject *va_build_value(const char *, va_list, int);
10 10
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 case 'c': 286 case 'c':
287 { 287 {
288 char p[1]; 288 char p[1];
289 p[0] = (char)va_arg(*p_va, int); 289 p[0] = (char)va_arg(*p_va, int);
290 return PyBytes_FromStringAndSize(p, 1); 290 return PyBytes_FromStringAndSize(p, 1);
291 } 291 }
292 case 'C': 292 case 'C':
293 { 293 {
294 int i = va_arg(*p_va, int); 294 int i = va_arg(*p_va, int);
295 if (i < 0 || i > PyUnicode_GetMax()) {
296 PyErr_SetString(PyExc_OverflowError,
297 "%c arg not in range(0x110000)");
298 return NULL;
299 }
295 return PyUnicode_FromOrdinal(i); 300 return PyUnicode_FromOrdinal(i);
296 } 301 }
297 302
298 case 's': 303 case 's':
299 case 'z': 304 case 'z':
300 case 'U': /* XXX deprecated alias */ 305 case 'U': /* XXX deprecated alias */
301 { 306 {
302 PyObject *v; 307 PyObject *v;
303 char *str = va_arg(*p_va, char *); 308 char *str = va_arg(*p_va, char *);
304 Py_ssize_t n; 309 Py_ssize_t n;
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 PyModule_AddStringConstant(PyObject *m, const char *name, const char *value) 566 PyModule_AddStringConstant(PyObject *m, const char *name, const char *value)
562 { 567 {
563 PyObject *o = PyUnicode_FromString(value); 568 PyObject *o = PyUnicode_FromString(value);
564 if (!o) 569 if (!o)
565 return -1; 570 return -1;
566 if (PyModule_AddObject(m, name, o) == 0) 571 if (PyModule_AddObject(m, name, o) == 0)
567 return 0; 572 return 0;
568 Py_DECREF(o); 573 Py_DECREF(o);
569 return -1; 574 return -1;
570 } 575 }
OLDNEW
« no previous file with comments | « Python/marshal.c ('k') | Python/Python-ast.c » ('j') | no next file with comments »

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