]> granicus.if.org Git - python/commitdiff
bpo-32150: Expand tabs to spaces in C files. (#4583)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 28 Nov 2017 15:56:10 +0000 (17:56 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Nov 2017 15:56:10 +0000 (17:56 +0200)
27 files changed:
Doc/includes/shoddy.c
Include/bitset.h
Include/bytesobject.h
Include/cellobject.h
Include/classobject.h
Include/code.h
Include/errcode.h
Include/funcobject.h
Include/grammar.h
Include/longintrepr.h
Include/node.h
Include/parsetok.h
Include/patchlevel.h
Include/pgenheaders.h
Include/pyfpe.h
Include/sliceobject.h
Mac/PythonLauncher/FileSettings.h
Mac/PythonLauncher/MyAppDelegate.h
Modules/_weakref.c
Modules/rotatingtree.h
Parser/parser.h
Python/dup2.c
Python/getplatform.c
Python/getversion.c
Python/pyfpe.c
Python/pystrhex.c
Python/strdup.c

index 0c6d412b3c4cda4e4fc07ac3a2abbe57b51587cd..0ef4765327776fcee24fb8d4a48e25b385283dde 100644 (file)
@@ -17,7 +17,7 @@ Shoddy_increment(Shoddy *self, PyObject *unused)
 static PyMethodDef Shoddy_methods[] = {
     {"increment", (PyCFunction)Shoddy_increment, METH_NOARGS,
      PyDoc_STR("increment state counter")},
-    {NULL,     NULL},
+    {NULL},
 };
 
 static int
index faeb41913df31f995d772b211fd05e5f65196bf8..b22fa77815cfb8316fedbfff50c2de5074f9ed64 100644 (file)
@@ -7,7 +7,7 @@ extern "C" {
 
 /* Bitset interface */
 
-#define BYTE           char
+#define BYTE            char
 
 typedef BYTE *bitset;
 
@@ -18,13 +18,13 @@ int addbit(bitset bs, int ibit); /* Returns 0 if already set */
 int samebitset(bitset bs1, bitset bs2, int nbits);
 void mergebitset(bitset bs1, bitset bs2, int nbits);
 
-#define BITSPERBYTE    (8*sizeof(BYTE))
-#define NBYTES(nbits)  (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE)
+#define BITSPERBYTE     (8*sizeof(BYTE))
+#define NBYTES(nbits)   (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE)
 
-#define BIT2BYTE(ibit) ((ibit) / BITSPERBYTE)
-#define BIT2SHIFT(ibit)        ((ibit) % BITSPERBYTE)
-#define BIT2MASK(ibit) (1 << BIT2SHIFT(ibit))
-#define BYTE2BIT(ibyte)        ((ibyte) * BITSPERBYTE)
+#define BIT2BYTE(ibit)  ((ibit) / BITSPERBYTE)
+#define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE)
+#define BIT2MASK(ibit)  (1 << BIT2SHIFT(ibit))
+#define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE)
 
 #ifdef __cplusplus
 }
index 0f0bf9f369df4fa82e3d14945913fd9fbeaefb8a..3fde4a221fdb18b5e50e5eb3936675f553ed00ea 100644 (file)
@@ -52,9 +52,9 @@ PyAPI_FUNC(PyObject *) PyBytes_FromStringAndSize(const char *, Py_ssize_t);
 PyAPI_FUNC(PyObject *) PyBytes_FromString(const char *);
 PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *);
 PyAPI_FUNC(PyObject *) PyBytes_FromFormatV(const char*, va_list)
-                               Py_GCC_ATTRIBUTE((format(printf, 1, 0)));
+                                Py_GCC_ATTRIBUTE((format(printf, 1, 0)));
 PyAPI_FUNC(PyObject *) PyBytes_FromFormat(const char*, ...)
-                               Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
+                                Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
 PyAPI_FUNC(Py_ssize_t) PyBytes_Size(PyObject *);
 PyAPI_FUNC(char *) PyBytes_AsString(PyObject *);
 PyAPI_FUNC(PyObject *) PyBytes_Repr(PyObject *, int);
@@ -72,8 +72,8 @@ PyAPI_FUNC(PyObject*) _PyBytes_FromHex(
     int use_bytearray);
 #endif
 PyAPI_FUNC(PyObject *) PyBytes_DecodeEscape(const char *, Py_ssize_t,
-                                                  const char *, Py_ssize_t,
-                                                  const char *);
+                                            const char *, Py_ssize_t,
+                                            const char *);
 #ifndef Py_LIMITED_API
 /* Helper for PyBytes_DecodeEscape that detects invalid escape chars. */
 PyAPI_FUNC(PyObject *) _PyBytes_DecodeEscape(const char *, Py_ssize_t,
@@ -132,10 +132,10 @@ PyAPI_FUNC(Py_ssize_t) _PyBytes_InsertThousandsGrouping(char *buffer,
 
 /* Flags used by string formatting */
 #define F_LJUST (1<<0)
-#define F_SIGN (1<<1)
+#define F_SIGN  (1<<1)
 #define F_BLANK (1<<2)
-#define F_ALT  (1<<3)
-#define F_ZERO (1<<4)
+#define F_ALT   (1<<3)
+#define F_ZERO  (1<<4)
 
 #ifndef Py_LIMITED_API
 /* The _PyBytesWriter structure is big: it contains an embedded "stack buffer".
index a0aa4d947c22115f8bc609c8d4f7ca57a2aa3773..2f9b5b75d998aeda50113fe4b62849fdcf4714e6 100644 (file)
@@ -7,8 +7,8 @@ extern "C" {
 #endif
 
 typedef struct {
-       PyObject_HEAD
-       PyObject *ob_ref;       /* Content of the cell or NULL when empty */
+    PyObject_HEAD
+    PyObject *ob_ref;       /* Content of the cell or NULL when empty */
 } PyCellObject;
 
 PyAPI_DATA(PyTypeObject) PyCell_Type;
index eeeb3e95a87e717ee4d262bed635fd8862325209..209f0f4a284301331d6323728e8a6633854471d2 100644 (file)
@@ -30,13 +30,13 @@ PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
 #define PyMethod_GET_FUNCTION(meth) \
         (((PyMethodObject *)meth) -> im_func)
 #define PyMethod_GET_SELF(meth) \
-       (((PyMethodObject *)meth) -> im_self)
+        (((PyMethodObject *)meth) -> im_self)
 
 PyAPI_FUNC(int) PyMethod_ClearFreeList(void);
 
 typedef struct {
-       PyObject_HEAD
-       PyObject *func;
+    PyObject_HEAD
+    PyObject *func;
 } PyInstanceMethodObject;
 
 PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type;
index 385258f93ce49110977892bf405e56ddfb86fc34..8b0f84042372d9c6b15e31629789bc2207ff094d 100644 (file)
@@ -20,17 +20,17 @@ typedef uint16_t _Py_CODEUNIT;
 /* Bytecode object */
 typedef struct {
     PyObject_HEAD
-    int co_argcount;           /* #arguments, except *args */
-    int co_kwonlyargcount;     /* #keyword only arguments */
-    int co_nlocals;            /* #local variables */
-    int co_stacksize;          /* #entries needed for evaluation stack */
-    int co_flags;              /* CO_..., see below */
-    int co_firstlineno;   /* first source line number */
-    PyObject *co_code;         /* instruction opcodes */
-    PyObject *co_consts;       /* list (constants used) */
-    PyObject *co_names;                /* list of strings (names used) */
-    PyObject *co_varnames;     /* tuple of strings (local variable names) */
-    PyObject *co_freevars;     /* tuple of strings (free variable names) */
+    int co_argcount;            /* #arguments, except *args */
+    int co_kwonlyargcount;      /* #keyword only arguments */
+    int co_nlocals;             /* #local variables */
+    int co_stacksize;           /* #entries needed for evaluation stack */
+    int co_flags;               /* CO_..., see below */
+    int co_firstlineno;         /* first source line number */
+    PyObject *co_code;          /* instruction opcodes */
+    PyObject *co_consts;        /* list (constants used) */
+    PyObject *co_names;         /* list of strings (names used) */
+    PyObject *co_varnames;      /* tuple of strings (local variable names) */
+    PyObject *co_freevars;      /* tuple of strings (free variable names) */
     PyObject *co_cellvars;      /* tuple of strings (cell variable names) */
     /* The rest aren't used in either hash or comparisons, except for co_name,
        used in both. This is done to preserve the name and line number
@@ -38,11 +38,11 @@ typedef struct {
        would collapse identical functions/lambdas defined on different lines.
     */
     Py_ssize_t *co_cell2arg;    /* Maps cell vars which are arguments. */
-    PyObject *co_filename;     /* unicode (where it was loaded from) */
-    PyObject *co_name;         /* unicode (name, for reference) */
-    PyObject *co_lnotab;       /* string (encoding addr<->lineno mapping) See
-                                  Objects/lnotab_notes.txt for details. */
-    void *co_zombieframe;     /* for optimization only (see frameobject.c) */
+    PyObject *co_filename;      /* unicode (where it was loaded from) */
+    PyObject *co_name;          /* unicode (name, for reference) */
+    PyObject *co_lnotab;        /* string (encoding addr<->lineno mapping) See
+                                   Objects/lnotab_notes.txt for details. */
+    void *co_zombieframe;       /* for optimization only (see frameobject.c) */
     PyObject *co_weakreflist;   /* to support weakrefs to code objects */
     /* Scratch space for extra data relating to the code object.
        Type is a void* to keep the format private in codeobject.c to force
@@ -51,10 +51,10 @@ typedef struct {
 } PyCodeObject;
 
 /* Masks for co_flags above */
-#define CO_OPTIMIZED   0x0001
-#define CO_NEWLOCALS   0x0002
-#define CO_VARARGS     0x0004
-#define CO_VARKEYWORDS 0x0008
+#define CO_OPTIMIZED    0x0001
+#define CO_NEWLOCALS    0x0002
+#define CO_VARARGS      0x0004
+#define CO_VARKEYWORDS  0x0008
 #define CO_NESTED       0x0010
 #define CO_GENERATOR    0x0020
 /* The CO_NOFREE flag is set if there are no free or cell variables.
@@ -74,7 +74,7 @@ typedef struct {
 #if 0
 #define CO_GENERATOR_ALLOWED    0x1000
 #endif
-#define CO_FUTURE_DIVISION     0x2000
+#define CO_FUTURE_DIVISION      0x2000
 #define CO_FUTURE_ABSOLUTE_IMPORT 0x4000 /* do absolute imports by default */
 #define CO_FUTURE_WITH_STATEMENT  0x8000
 #define CO_FUTURE_PRINT_FUNCTION  0x10000
@@ -101,9 +101,9 @@ PyAPI_DATA(PyTypeObject) PyCode_Type;
 
 /* Public interface */
 PyAPI_FUNC(PyCodeObject *) PyCode_New(
-       int, int, int, int, int, PyObject *, PyObject *,
-       PyObject *, PyObject *, PyObject *, PyObject *,
-       PyObject *, PyObject *, int, PyObject *);
+        int, int, int, int, int, PyObject *, PyObject *,
+        PyObject *, PyObject *, PyObject *, PyObject *,
+        PyObject *, PyObject *, int, PyObject *);
         /* same as struct above */
 
 /* Creates a new empty code object with the specified source location. */
index 5946686c659b5416074868d442060a77a5812156..b37cd261d5ec4d54ac6b8ca9fd6008e70e35859a 100644 (file)
@@ -13,24 +13,24 @@ extern "C" {
    the parser only returns E_EOF when it hits EOF immediately, and it
    never returns E_OK. */
 
-#define E_OK           10      /* No error */
-#define E_EOF          11      /* End Of File */
-#define E_INTR         12      /* Interrupted */
-#define E_TOKEN                13      /* Bad token */
-#define E_SYNTAX       14      /* Syntax error */
-#define E_NOMEM                15      /* Ran out of memory */
-#define E_DONE         16      /* Parsing complete */
-#define E_ERROR                17      /* Execution error */
-#define E_TABSPACE     18      /* Inconsistent mixing of tabs and spaces */
-#define E_OVERFLOW      19     /* Node had too many children */
-#define E_TOODEEP      20      /* Too many indentation levels */
-#define E_DEDENT       21      /* No matching outer block for dedent */
-#define E_DECODE       22      /* Error in decoding into Unicode */
-#define E_EOFS         23      /* EOF in triple-quoted string */
-#define E_EOLS         24      /* EOL in single-quoted string */
-#define E_LINECONT     25      /* Unexpected characters after a line continuation */
+#define E_OK            10      /* No error */
+#define E_EOF           11      /* End Of File */
+#define E_INTR          12      /* Interrupted */
+#define E_TOKEN         13      /* Bad token */
+#define E_SYNTAX        14      /* Syntax error */
+#define E_NOMEM         15      /* Ran out of memory */
+#define E_DONE          16      /* Parsing complete */
+#define E_ERROR         17      /* Execution error */
+#define E_TABSPACE      18      /* Inconsistent mixing of tabs and spaces */
+#define E_OVERFLOW      19      /* Node had too many children */
+#define E_TOODEEP       20      /* Too many indentation levels */
+#define E_DEDENT        21      /* No matching outer block for dedent */
+#define E_DECODE        22      /* Error in decoding into Unicode */
+#define E_EOFS          23      /* EOF in triple-quoted string */
+#define E_EOLS          24      /* EOL in single-quoted string */
+#define E_LINECONT      25      /* Unexpected characters after a line continuation */
 #define E_IDENTIFIER    26      /* Invalid characters in identifier */
-#define E_BADSINGLE    27      /* Ill-formed single statement input */
+#define E_BADSINGLE     27      /* Ill-formed single statement input */
 
 #ifdef __cplusplus
 }
index 77bb8c39aeb7500528d464d5c31ad0a0d0bed03c..89305dcf768687c10a4eae2f9bdb4ba3b74abfd2 100644 (file)
@@ -20,17 +20,17 @@ extern "C" {
 
 typedef struct {
     PyObject_HEAD
-    PyObject *func_code;       /* A code object, the __code__ attribute */
-    PyObject *func_globals;    /* A dictionary (other mappings won't do) */
-    PyObject *func_defaults;   /* NULL or a tuple */
-    PyObject *func_kwdefaults; /* NULL or a dict */
-    PyObject *func_closure;    /* NULL or a tuple of cell objects */
-    PyObject *func_doc;                /* The __doc__ attribute, can be anything */
-    PyObject *func_name;       /* The __name__ attribute, a string object */
-    PyObject *func_dict;       /* The __dict__ attribute, a dict or NULL */
-    PyObject *func_weakreflist;        /* List of weak references */
-    PyObject *func_module;     /* The __module__ attribute, can be anything */
-    PyObject *func_annotations;        /* Annotations, a dict or NULL */
+    PyObject *func_code;        /* A code object, the __code__ attribute */
+    PyObject *func_globals;     /* A dictionary (other mappings won't do) */
+    PyObject *func_defaults;    /* NULL or a tuple */
+    PyObject *func_kwdefaults;  /* NULL or a dict */
+    PyObject *func_closure;     /* NULL or a tuple of cell objects */
+    PyObject *func_doc;         /* The __doc__ attribute, can be anything */
+    PyObject *func_name;        /* The __name__ attribute, a string object */
+    PyObject *func_dict;        /* The __dict__ attribute, a dict or NULL */
+    PyObject *func_weakreflist; /* List of weak references */
+    PyObject *func_module;      /* The __module__ attribute, can be anything */
+    PyObject *func_annotations; /* Annotations, a dict or NULL */
     PyObject *func_qualname;    /* The qualified name */
 
     /* Invariant:
@@ -77,17 +77,17 @@ PyAPI_FUNC(PyObject *) _PyFunction_FastCallKeywords(
 #define PyFunction_GET_CODE(func) \
         (((PyFunctionObject *)func) -> func_code)
 #define PyFunction_GET_GLOBALS(func) \
-       (((PyFunctionObject *)func) -> func_globals)
+        (((PyFunctionObject *)func) -> func_globals)
 #define PyFunction_GET_MODULE(func) \
-       (((PyFunctionObject *)func) -> func_module)
+        (((PyFunctionObject *)func) -> func_module)
 #define PyFunction_GET_DEFAULTS(func) \
-       (((PyFunctionObject *)func) -> func_defaults)
+        (((PyFunctionObject *)func) -> func_defaults)
 #define PyFunction_GET_KW_DEFAULTS(func) \
-       (((PyFunctionObject *)func) -> func_kwdefaults)
+        (((PyFunctionObject *)func) -> func_kwdefaults)
 #define PyFunction_GET_CLOSURE(func) \
-       (((PyFunctionObject *)func) -> func_closure)
+        (((PyFunctionObject *)func) -> func_closure)
 #define PyFunction_GET_ANNOTATIONS(func) \
-       (((PyFunctionObject *)func) -> func_annotations)
+        (((PyFunctionObject *)func) -> func_annotations)
 
 /* The classmethod and staticmethod types lives here, too */
 PyAPI_DATA(PyTypeObject) PyClassMethod_Type;
index f775f9638172b3e9897ecaf1fcf2d368258b6f6e..e1703f4b3603447a775c9eabdd4897b094f0d002 100644 (file)
@@ -12,58 +12,58 @@ extern "C" {
 /* A label of an arc */
 
 typedef struct {
-    int                 lb_type;
-    char       *lb_str;
+    int          lb_type;
+    char        *lb_str;
 } label;
 
-#define EMPTY 0                /* Label number 0 is by definition the empty label */
+#define EMPTY 0         /* Label number 0 is by definition the empty label */
 
 /* A list of labels */
 
 typedef struct {
-    int                 ll_nlabels;
-    label      *ll_label;
+    int          ll_nlabels;
+    label       *ll_label;
 } labellist;
 
 /* An arc from one state to another */
 
 typedef struct {
-    short      a_lbl;          /* Label of this arc */
-    short      a_arrow;        /* State where this arc goes to */
+    short       a_lbl;          /* Label of this arc */
+    short       a_arrow;        /* State where this arc goes to */
 } arc;
 
 /* A state in a DFA */
 
 typedef struct {
-    int                 s_narcs;
-    arc                *s_arc;         /* Array of arcs */
+    int          s_narcs;
+    arc         *s_arc;         /* Array of arcs */
 
     /* Optional accelerators */
-    int                 s_lower;       /* Lowest label index */
-    int                 s_upper;       /* Highest label index */
-    int                *s_accel;       /* Accelerator */
-    int                 s_accept;      /* Nonzero for accepting state */
+    int          s_lower;       /* Lowest label index */
+    int          s_upper;       /* Highest label index */
+    int         *s_accel;       /* Accelerator */
+    int          s_accept;      /* Nonzero for accepting state */
 } state;
 
 /* A DFA */
 
 typedef struct {
-    int                 d_type;        /* Non-terminal this represents */
-    char       *d_name;        /* For printing */
-    int                 d_initial;     /* Initial state */
-    int                 d_nstates;
-    state      *d_state;       /* Array of states */
-    bitset      d_first;
+    int          d_type;        /* Non-terminal this represents */
+    char        *d_name;        /* For printing */
+    int          d_initial;     /* Initial state */
+    int          d_nstates;
+    state       *d_state;       /* Array of states */
+    bitset       d_first;
 } dfa;
 
 /* A grammar */
 
 typedef struct {
-    int                 g_ndfas;
-    dfa                *g_dfa;         /* Array of DFAs */
-    labellist   g_ll;
-    int                 g_start;       /* Start symbol of the grammar */
-    int                 g_accel;       /* Set if accelerators present */
+    int          g_ndfas;
+    dfa         *g_dfa;         /* Array of DFAs */
+    labellist    g_ll;
+    int          g_start;       /* Start symbol of the grammar */
+    int          g_accel;       /* Set if accelerators present */
 } grammar;
 
 /* FUNCTIONS */
index a3b74b4f6dd214ee390100bf9c6182e102314b11..ff4155f9656defa2bc7623ddb4ecee6f45564dfc 100644 (file)
@@ -46,22 +46,22 @@ typedef uint32_t digit;
 typedef int32_t sdigit; /* signed variant of digit */
 typedef uint64_t twodigits;
 typedef int64_t stwodigits; /* signed variant of twodigits */
-#define PyLong_SHIFT   30
-#define _PyLong_DECIMAL_SHIFT  9 /* max(e such that 10**e fits in a digit) */
-#define _PyLong_DECIMAL_BASE   ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */
+#define PyLong_SHIFT    30
+#define _PyLong_DECIMAL_SHIFT   9 /* max(e such that 10**e fits in a digit) */
+#define _PyLong_DECIMAL_BASE    ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */
 #elif PYLONG_BITS_IN_DIGIT == 15
 typedef unsigned short digit;
 typedef short sdigit; /* signed variant of digit */
 typedef unsigned long twodigits;
 typedef long stwodigits; /* signed variant of twodigits */
-#define PyLong_SHIFT   15
-#define _PyLong_DECIMAL_SHIFT  4 /* max(e such that 10**e fits in a digit) */
-#define _PyLong_DECIMAL_BASE   ((digit)10000) /* 10 ** DECIMAL_SHIFT */
+#define PyLong_SHIFT    15
+#define _PyLong_DECIMAL_SHIFT   4 /* max(e such that 10**e fits in a digit) */
+#define _PyLong_DECIMAL_BASE    ((digit)10000) /* 10 ** DECIMAL_SHIFT */
 #else
 #error "PYLONG_BITS_IN_DIGIT should be 15 or 30"
 #endif
-#define PyLong_BASE    ((digit)1 << PyLong_SHIFT)
-#define PyLong_MASK    ((digit)(PyLong_BASE - 1))
+#define PyLong_BASE     ((digit)1 << PyLong_SHIFT)
+#define PyLong_MASK     ((digit)(PyLong_BASE - 1))
 
 #if PyLong_SHIFT % 5 != 0
 #error "longobject.c requires that PyLong_SHIFT be divisible by 5"
@@ -69,12 +69,12 @@ typedef long stwodigits; /* signed variant of twodigits */
 
 /* Long integer representation.
    The absolute value of a number is equal to
-       SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i)
+        SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i)
    Negative numbers are represented with ob_size < 0;
    zero is represented by ob_size == 0.
    In a normalized number, ob_digit[abs(ob_size)-1] (the most significant
    digit) is never zero.  Also, in all cases, for all valid i,
-       0 <= ob_digit[i] <= MASK.
+        0 <= ob_digit[i] <= MASK.
    The allocation function takes care of allocating extra memory
    so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available.
 
@@ -83,8 +83,8 @@ typedef long stwodigits; /* signed variant of twodigits */
 */
 
 struct _longobject {
-       PyObject_VAR_HEAD
-       digit ob_digit[1];
+    PyObject_VAR_HEAD
+    digit ob_digit[1];
 };
 
 PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t);
index 654ad8582301457752a5e86d12a2213c516281e2..40596dfecf1807b21edb10f41f53c004c4877afd 100644 (file)
@@ -8,12 +8,12 @@ extern "C" {
 #endif
 
 typedef struct _node {
-    short              n_type;
-    char               *n_str;
-    int                        n_lineno;
-    int                        n_col_offset;
-    int                        n_nchildren;
-    struct _node       *n_child;
+    short               n_type;
+    char                *n_str;
+    int                 n_lineno;
+    int                 n_col_offset;
+    int                 n_nchildren;
+    struct _node        *n_child;
 } node;
 
 PyAPI_FUNC(node *) PyNode_New(int type);
@@ -25,12 +25,12 @@ PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n);
 #endif
 
 /* Node access functions */
-#define NCH(n)         ((n)->n_nchildren)
+#define NCH(n)          ((n)->n_nchildren)
 
-#define CHILD(n, i)    (&(n)->n_child[i])
-#define RCHILD(n, i)   (CHILD(n, NCH(n) + i))
-#define TYPE(n)                ((n)->n_type)
-#define STR(n)         ((n)->n_str)
+#define CHILD(n, i)     (&(n)->n_child[i])
+#define RCHILD(n, i)    (CHILD(n, NCH(n) + i))
+#define TYPE(n)         ((n)->n_type)
+#define STR(n)          ((n)->n_str)
 #define LINENO(n)       ((n)->n_lineno)
 
 /* Assert that the type of a node is what we expect */
index 2acb854672774d00a63e86c2ea1e2573419da14c..c9407a3f7020fe73549ec0e943307c652c505a4e 100644 (file)
@@ -21,13 +21,13 @@ typedef struct {
 } perrdetail;
 
 #if 0
-#define PyPARSE_YIELD_IS_KEYWORD       0x0001
+#define PyPARSE_YIELD_IS_KEYWORD        0x0001
 #endif
 
-#define PyPARSE_DONT_IMPLY_DEDENT      0x0002
+#define PyPARSE_DONT_IMPLY_DEDENT       0x0002
 
 #if 0
-#define PyPARSE_WITH_IS_KEYWORD                0x0003
+#define PyPARSE_WITH_IS_KEYWORD         0x0003
 #define PyPARSE_PRINT_IS_FUNCTION       0x0004
 #define PyPARSE_UNICODE_LITERALS        0x0008
 #endif
index 23e224d8c3d4c4dcefb87878abf52ed1e2889d8b..64c518e97da7daa5865872607bcfdadd58021804 100644 (file)
@@ -8,28 +8,28 @@
 */
 
 /* Values for PY_RELEASE_LEVEL */
-#define PY_RELEASE_LEVEL_ALPHA 0xA
-#define PY_RELEASE_LEVEL_BETA  0xB
-#define PY_RELEASE_LEVEL_GAMMA 0xC     /* For release candidates */
-#define PY_RELEASE_LEVEL_FINAL 0xF     /* Serial should be 0 here */
-                                       /* Higher for patch releases */
+#define PY_RELEASE_LEVEL_ALPHA  0xA
+#define PY_RELEASE_LEVEL_BETA   0xB
+#define PY_RELEASE_LEVEL_GAMMA  0xC     /* For release candidates */
+#define PY_RELEASE_LEVEL_FINAL  0xF     /* Serial should be 0 here */
+                                        /* Higher for patch releases */
 
 /* Version parsed out into numeric values */
 /*--start constants--*/
-#define PY_MAJOR_VERSION       3
-#define PY_MINOR_VERSION       7
-#define PY_MICRO_VERSION       0
-#define PY_RELEASE_LEVEL       PY_RELEASE_LEVEL_ALPHA
-#define PY_RELEASE_SERIAL      2
+#define PY_MAJOR_VERSION        3
+#define PY_MINOR_VERSION        7
+#define PY_MICRO_VERSION        0
+#define PY_RELEASE_LEVEL        PY_RELEASE_LEVEL_ALPHA
+#define PY_RELEASE_SERIAL       2
 
 /* Version as a string */
-#define PY_VERSION             "3.7.0a2+"
+#define PY_VERSION              "3.7.0a2+"
 /*--end constants--*/
 
 /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
    Use this for numeric comparisons, e.g. #if PY_VERSION_HEX >= ... */
 #define PY_VERSION_HEX ((PY_MAJOR_VERSION << 24) | \
-                       (PY_MINOR_VERSION << 16) | \
-                       (PY_MICRO_VERSION <<  8) | \
-                       (PY_RELEASE_LEVEL <<  4) | \
-                       (PY_RELEASE_SERIAL << 0))
+                        (PY_MINOR_VERSION << 16) | \
+                        (PY_MICRO_VERSION <<  8) | \
+                        (PY_RELEASE_LEVEL <<  4) | \
+                        (PY_RELEASE_SERIAL << 0))
index 4843de6c023e48aca2fc7b132b5dbf2cd3064e13..dbc5e0a5f1394058e68214c54b51d4db1c165cd9 100644 (file)
@@ -10,9 +10,9 @@ extern "C" {
 #include "Python.h"
 
 PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
-                       Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
+                        Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
 PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
-                       Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
+                        Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
 
 #define addarc _Py_addarc
 #define addbit _Py_addbit
index f9a15e622bab6b2da31e71bb0144116449b89cfd..d86cb7486ce33e078f33e7cb7da78d8fd9c20a0e 100644 (file)
@@ -135,9 +135,9 @@ extern double PyFPE_dummy(void *);
 
 #define PyFPE_START_PROTECT(err_string, leave_stmt) \
 if (!PyFPE_counter++ && setjmp(PyFPE_jbuf)) { \
-       PyErr_SetString(PyExc_FloatingPointError, err_string); \
-       PyFPE_counter = 0; \
-       leave_stmt; \
+        PyErr_SetString(PyExc_FloatingPointError, err_string); \
+        PyFPE_counter = 0; \
+        leave_stmt; \
 }
 
 /*
index b24f2926f13d14c3fa53e1007d8ba2c94f51720f..c238b099ea8151e9b512c2b5f23536cf01ac0d7b 100644 (file)
@@ -21,7 +21,7 @@ let these be any arbitrary python type.  Py_None stands for omitted values.
 #ifndef Py_LIMITED_API
 typedef struct {
     PyObject_HEAD
-    PyObject *start, *stop, *step;     /* not NULL */
+    PyObject *start, *stop, *step;      /* not NULL */
 } PySliceObject;
 #endif
 
index 7b74a9b24d2dd07fb5ca059593a40a08a57e7545..3fadb7d614af1101416aaa41af1144e9d61c5f66 100644 (file)
 
 @interface FileSettings : NSObject <FileSettingsSource>
 {
-    NSString *interpreter;     // The pathname of the interpreter to use
-    NSArray *interpreters;     // List of known interpreters
-    BOOL honourhashbang;       // #! line overrides interpreter
-    BOOL debug;                        // -d option: debug parser
-    BOOL verbose;              // -v option: verbose import
-    BOOL inspect;              // -i option: interactive mode after script
-    BOOL optimize;             // -O option: optimize bytecode
-    BOOL nosite;               // -S option: don't import site.py
-    BOOL tabs;                 // -t option: warn about inconsistent tabs
-    NSString *others;          // other options
-    NSString *scriptargs;      // script arguments (not for preferences)
-    BOOL with_terminal;                // Run in terminal window
+    NSString *interpreter;      // The pathname of the interpreter to use
+    NSArray *interpreters;      // List of known interpreters
+    BOOL honourhashbang;        // #! line overrides interpreter
+    BOOL debug;                 // -d option: debug parser
+    BOOL verbose;               // -v option: verbose import
+    BOOL inspect;               // -i option: interactive mode after script
+    BOOL optimize;              // -O option: optimize bytecode
+    BOOL nosite;                // -S option: don't import site.py
+    BOOL tabs;                  // -t option: warn about inconsistent tabs
+    NSString *others;           // other options
+    NSString *scriptargs;       // script arguments (not for preferences)
+    BOOL with_terminal;         // Run in terminal window
 
     FileSettings *origsource;
     NSString *prefskey;
index 097b54177c881d2d9d6eba7522d2b627f2037c35..7252072aa9560535b8e92cc1923416334ad777a8 100644 (file)
@@ -4,8 +4,8 @@
 
 @interface MyAppDelegate : NSObject
 {
-    BOOL       initial_action_done;
-    BOOL       should_terminate;
+    BOOL        initial_action_done;
+    BOOL        should_terminate;
 }
 - (id)init;
 - (IBAction)showPreferences:(id)sender;
index f9c68d6a640f3465c5b510d776ac1b62ef63ca0e..c1238e00d35f4aa8315cd8d29790a1663a24dbc2 100644 (file)
@@ -138,15 +138,15 @@ weakref_functions[] =  {
 
 
 static struct PyModuleDef weakrefmodule = {
-       PyModuleDef_HEAD_INIT,
-       "_weakref",
-       "Weak-reference support module.",
-       -1,
-       weakref_functions,
-       NULL,
-       NULL,
-       NULL,
-       NULL
+    PyModuleDef_HEAD_INIT,
+    "_weakref",
+    "Weak-reference support module.",
+    -1,
+    weakref_functions,
+    NULL,
+    NULL,
+    NULL,
+    NULL
 };
 
 PyMODINIT_FUNC
index 3aa0986b49aa9a7c37a6328250a1c03b8ef196ca..7b3e5fde921cb381f4548a18fc2ebd0dcdc3007b 100644 (file)
@@ -16,12 +16,12 @@ typedef struct rotating_node_s rotating_node_t;
 typedef int (*rotating_tree_enum_fn) (rotating_node_t *node, void *arg);
 
 struct rotating_node_s {
-       void *key;
-       rotating_node_t *left;
-       rotating_node_t *right;
+    void *key;
+    rotating_node_t *left;
+    rotating_node_t *right;
 };
 
 void RotatingTree_Add(rotating_node_t **root, rotating_node_t *node);
 rotating_node_t* RotatingTree_Get(rotating_node_t **root, void *key);
 int RotatingTree_Enum(rotating_node_t *root, rotating_tree_enum_fn enumfn,
-                     void *arg);
+                      void *arg);
index 403236d1ea2b87cdedea2003df3f1e8a7bb0e7a9..39df9487285c84691c69472ff2d14153d51cf25f 100644 (file)
@@ -10,23 +10,23 @@ extern "C" {
 #define MAXSTACK 1500
 
 typedef struct {
-       int              s_state;       /* State in current DFA */
-       dfa             *s_dfa;         /* Current DFA */
-       struct _node    *s_parent;      /* Where to add next node */
+    int              s_state;       /* State in current DFA */
+    dfa             *s_dfa;         /* Current DFA */
+    struct _node    *s_parent;      /* Where to add next node */
 } stackentry;
 
 typedef struct {
-       stackentry      *s_top;         /* Top entry */
-       stackentry       s_base[MAXSTACK];/* Array of stack entries */
-                                       /* NB The stack grows down */
+    stackentry      *s_top;         /* Top entry */
+    stackentry       s_base[MAXSTACK];/* Array of stack entries */
+                                    /* NB The stack grows down */
 } stack;
 
 typedef struct {
-       stack           p_stack;        /* Stack of parser states */
-       grammar         *p_grammar;     /* Grammar to use */
-       node            *p_tree;        /* Top of parse tree */
+    stack           p_stack;        /* Stack of parser states */
+    grammar         *p_grammar;     /* Grammar to use */
+    node            *p_tree;        /* Top of parse tree */
 #ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
-       unsigned long   p_flags;        /* see co_flags in Include/code.h */
+    unsigned long   p_flags;        /* see co_flags in Include/code.h */
 #endif
 } parser_state;
 
index 2579afd443dca8453bcff75619772ed514fb3278..7c6bbfce11dbf80dae7fe4c79d4c52839a0c68ad 100644 (file)
 int
 dup2(int fd1, int fd2)
 {
-       if (fd1 != fd2) {
-               if (fcntl(fd1, F_GETFL) < 0)
-                       return BADEXIT;
-               if (fcntl(fd2, F_GETFL) >= 0)
-                       close(fd2);
-               if (fcntl(fd1, F_DUPFD, fd2) < 0)
-                       return BADEXIT;
-       }
-       return fd2;
+    if (fd1 != fd2) {
+        if (fcntl(fd1, F_GETFL) < 0)
+            return BADEXIT;
+        if (fcntl(fd2, F_GETFL) >= 0)
+            close(fd2);
+        if (fcntl(fd1, F_DUPFD, fd2) < 0)
+            return BADEXIT;
+    }
+    return fd2;
 }
index 68991402b5b0001cfbf52a9394baa3340f52fe88..81a0f7ac5378bd55e02ab93148293266d8491921 100644 (file)
@@ -8,5 +8,5 @@
 const char *
 Py_GetPlatform(void)
 {
-       return PLATFORM;
+    return PLATFORM;
 }
index 7bd6efd0a0154700113ba39a6c0fd820e82bfbd3..c32b6f9d60d4b751d30d0539f103ee7c52e6a633 100644 (file)
@@ -8,8 +8,8 @@
 const char *
 Py_GetVersion(void)
 {
-       static char version[250];
-       PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s",
-                     PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler());
-       return version;
+    static char version[250];
+    PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s",
+                  PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler());
+    return version;
 }
index ab0ef83ead094acf287ca54cff1c33ed1630b895..925fa4654d9fc0e1295493f2a6882007c18bd2f8 100644 (file)
@@ -19,5 +19,5 @@ int PyFPE_counter = 0;
 double
 PyFPE_dummy(void *dummy)
 {
-       return 1.0;
+    return 1.0;
 }
index 1259ed12dffe5c9bb690698f5398a7f8c32ba06b..6dbf32dcc4f92dd52d60884adf5036466078f2f1 100644 (file)
@@ -16,14 +16,14 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen,
     if (return_bytes) {
         /* If _PyBytes_FromSize() were public we could avoid malloc+copy. */
         retbuf = (Py_UCS1*) PyMem_Malloc(arglen*2);
-       if (!retbuf)
-           return PyErr_NoMemory();
+        if (!retbuf)
+            return PyErr_NoMemory();
         retval = NULL;  /* silence a compiler warning, assigned later. */
     } else {
-       retval = PyUnicode_New(arglen*2, 127);
-       if (!retval)
-           return NULL;
-       retbuf = PyUnicode_1BYTE_DATA(retval);
+        retval = PyUnicode_New(arglen*2, 127);
+        if (!retval)
+            return NULL;
+        retbuf = PyUnicode_1BYTE_DATA(retval);
     }
 
     /* make hex version of string, taken from shamodule.c */
index 769d3db130988c6c6bc898ffecaeaa9fa11ac038..99dc77417bd6d17f34e43aaa3e74ed6e43a1e835 100644 (file)
@@ -5,10 +5,10 @@
 char *
 strdup(const char *str)
 {
-       if (str != NULL) {
-               char *copy = malloc(strlen(str) + 1);
-               if (copy != NULL)
-                       return strcpy(copy, str);
-       }
-       return NULL;
+    if (str != NULL) {
+        char *copy = malloc(strlen(str) + 1);
+        if (copy != NULL)
+            return strcpy(copy, str);
+    }
+    return NULL;
 }