]> granicus.if.org Git - python/commitdiff
Remove unnecessary casts in type object initializers.
authorGeorg Brandl <georg@python.org>
Thu, 30 Mar 2006 11:57:00 +0000 (11:57 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 30 Mar 2006 11:57:00 +0000 (11:57 +0000)
20 files changed:
Objects/boolobject.c
Objects/classobject.c
Objects/cobject.c
Objects/complexobject.c
Objects/descrobject.c
Objects/dictobject.c
Objects/fileobject.c
Objects/floatobject.c
Objects/intobject.c
Objects/iterobject.c
Objects/longobject.c
Objects/object.c
Objects/rangeobject.c
Objects/setobject.c
Objects/sliceobject.c
Objects/stringobject.c
Objects/structseq.c
Objects/typeobject.c
Objects/unicodeobject.c
Objects/weakrefobject.c

index f2429fe9b2ccc06abcbae2beca97628b8b9e111b..37be295ac7d56eabca110a2c8735c4c3cbac807a 100644 (file)
@@ -103,44 +103,44 @@ The class bool is a subclass of the class int, and cannot be subclassed.");
 /* Arithmetic methods -- only so we can override &, |, ^. */
 
 static PyNumberMethods bool_as_number = {
-       0,                                      /* nb_add */
-       0,                                      /* nb_subtract */
-       0,                                      /* nb_multiply */
-       0,                                      /* nb_divide */
-       0,                                      /* nb_remainder */
-       0,                                      /* nb_divmod */
-       0,                                      /* nb_power */
-       0,                                      /* nb_negative */
-       0,                                      /* nb_positive */
-       0,                                      /* nb_absolute */
-       0,                                      /* nb_nonzero */
-       0,                                      /* nb_invert */
-       0,                                      /* nb_lshift */
-       0,                                      /* nb_rshift */
-       (binaryfunc)bool_and,                   /* nb_and */
-       (binaryfunc)bool_xor,                   /* nb_xor */
-       (binaryfunc)bool_or,                    /* nb_or */
-       0,                                      /* nb_coerce */
-       0,                                      /* nb_int */
-       0,                                      /* nb_long */
-       0,                                      /* nb_float */
-       0,                                      /* nb_oct */
-       0,                                      /* nb_hex */
-       0,                                      /* nb_inplace_add */
-       0,                                      /* nb_inplace_subtract */
-       0,                                      /* nb_inplace_multiply */
-       0,                                      /* nb_inplace_divide */
-       0,                                      /* nb_inplace_remainder */
-       0,                                      /* nb_inplace_power */
-       0,                                      /* nb_inplace_lshift */
-       0,                                      /* nb_inplace_rshift */
-       0,                                      /* nb_inplace_and */
-       0,                                      /* nb_inplace_xor */
-       0,                                      /* nb_inplace_or */
-       0,                                      /* nb_floor_divide */
-       0,                                      /* nb_true_divide */
-       0,                                      /* nb_inplace_floor_divide */
-       0,                                      /* nb_inplace_true_divide */
+       0,                      /* nb_add */
+       0,                      /* nb_subtract */
+       0,                      /* nb_multiply */
+       0,                      /* nb_divide */
+       0,                      /* nb_remainder */
+       0,                      /* nb_divmod */
+       0,                      /* nb_power */
+       0,                      /* nb_negative */
+       0,                      /* nb_positive */
+       0,                      /* nb_absolute */
+       0,                      /* nb_nonzero */
+       0,                      /* nb_invert */
+       0,                      /* nb_lshift */
+       0,                      /* nb_rshift */
+       bool_and,               /* nb_and */
+       bool_xor,               /* nb_xor */
+       bool_or,                /* nb_or */
+       0,                      /* nb_coerce */
+       0,                      /* nb_int */
+       0,                      /* nb_long */
+       0,                      /* nb_float */
+       0,                      /* nb_oct */
+       0,                      /* nb_hex */
+       0,                      /* nb_inplace_add */
+       0,                      /* nb_inplace_subtract */
+       0,                      /* nb_inplace_multiply */
+       0,                      /* nb_inplace_divide */
+       0,                      /* nb_inplace_remainder */
+       0,                      /* nb_inplace_power */
+       0,                      /* nb_inplace_lshift */
+       0,                      /* nb_inplace_rshift */
+       0,                      /* nb_inplace_and */
+       0,                      /* nb_inplace_xor */
+       0,                      /* nb_inplace_or */
+       0,                      /* nb_floor_divide */
+       0,                      /* nb_true_divide */
+       0,                      /* nb_inplace_floor_divide */
+       0,                      /* nb_inplace_true_divide */
 };
 
 /* The type object for bool.  Note that this cannot be subclassed! */
index ea95ec06d9c44d9e2d74e1324c508e3c612638d9..b7c19856804d20e930694c2df5b4144c734623be 100644 (file)
@@ -2030,45 +2030,45 @@ instance_call(PyObject *func, PyObject *arg, PyObject *kw)
 
 
 static PyNumberMethods instance_as_number = {
-       (binaryfunc)instance_add,               /* nb_add */
-       (binaryfunc)instance_sub,               /* nb_subtract */
-       (binaryfunc)instance_mul,               /* nb_multiply */
-       (binaryfunc)instance_div,               /* nb_divide */
-       (binaryfunc)instance_mod,               /* nb_remainder */
-       (binaryfunc)instance_divmod,            /* nb_divmod */
-       (ternaryfunc)instance_pow,              /* nb_power */
-       (unaryfunc)instance_neg,                /* nb_negative */
-       (unaryfunc)instance_pos,                /* nb_positive */
-       (unaryfunc)instance_abs,                /* nb_absolute */
-       (inquiry)instance_nonzero,              /* nb_nonzero */
-       (unaryfunc)instance_invert,             /* nb_invert */
-       (binaryfunc)instance_lshift,            /* nb_lshift */
-       (binaryfunc)instance_rshift,            /* nb_rshift */
-       (binaryfunc)instance_and,               /* nb_and */
-       (binaryfunc)instance_xor,               /* nb_xor */
-       (binaryfunc)instance_or,                /* nb_or */
-       (coercion)instance_coerce,              /* nb_coerce */
-       (unaryfunc)instance_int,                /* nb_int */
-       (unaryfunc)instance_long,               /* nb_long */
-       (unaryfunc)instance_float,              /* nb_float */
-       (unaryfunc)instance_oct,                /* nb_oct */
-       (unaryfunc)instance_hex,                /* nb_hex */
-       (binaryfunc)instance_iadd,              /* nb_inplace_add */
-       (binaryfunc)instance_isub,              /* nb_inplace_subtract */
-       (binaryfunc)instance_imul,              /* nb_inplace_multiply */
-       (binaryfunc)instance_idiv,              /* nb_inplace_divide */
-       (binaryfunc)instance_imod,              /* nb_inplace_remainder */
-       (ternaryfunc)instance_ipow,             /* nb_inplace_power */
-       (binaryfunc)instance_ilshift,           /* nb_inplace_lshift */
-       (binaryfunc)instance_irshift,           /* nb_inplace_rshift */
-       (binaryfunc)instance_iand,              /* nb_inplace_and */
-       (binaryfunc)instance_ixor,              /* nb_inplace_xor */
-       (binaryfunc)instance_ior,               /* nb_inplace_or */
-       (binaryfunc)instance_floordiv,          /* nb_floor_divide */
-       (binaryfunc)instance_truediv,           /* nb_true_divide */
-       (binaryfunc)instance_ifloordiv,         /* nb_inplace_floor_divide */
-       (binaryfunc)instance_itruediv,          /* nb_inplace_true_divide */
-       (lenfunc)instance_index,                /* nb_index */
+       instance_add,                   /* nb_add */
+       instance_sub,                   /* nb_subtract */
+       instance_mul,                   /* nb_multiply */
+       instance_div,                   /* nb_divide */
+       instance_mod,                   /* nb_remainder */
+       instance_divmod,                /* nb_divmod */
+       instance_pow,                   /* nb_power */
+       (unaryfunc)instance_neg,        /* nb_negative */
+       (unaryfunc)instance_pos,        /* nb_positive */
+       (unaryfunc)instance_abs,        /* nb_absolute */
+       (inquiry)instance_nonzero,      /* nb_nonzero */
+       (unaryfunc)instance_invert,     /* nb_invert */
+       instance_lshift,                /* nb_lshift */
+       instance_rshift,                /* nb_rshift */
+       instance_and,                   /* nb_and */
+       instance_xor,                   /* nb_xor */
+       instance_or,                    /* nb_or */
+       instance_coerce,                /* nb_coerce */
+       (unaryfunc)instance_int,        /* nb_int */
+       (unaryfunc)instance_long,       /* nb_long */
+       (unaryfunc)instance_float,      /* nb_float */
+       (unaryfunc)instance_oct,        /* nb_oct */
+       (unaryfunc)instance_hex,        /* nb_hex */
+       instance_iadd,                  /* nb_inplace_add */
+       instance_isub,                  /* nb_inplace_subtract */
+       instance_imul,                  /* nb_inplace_multiply */
+       instance_idiv,                  /* nb_inplace_divide */
+       instance_imod,                  /* nb_inplace_remainder */
+       instance_ipow,                  /* nb_inplace_power */
+       instance_ilshift,               /* nb_inplace_lshift */
+       instance_irshift,               /* nb_inplace_rshift */
+       instance_iand,                  /* nb_inplace_and */
+       instance_ixor,                  /* nb_inplace_xor */
+       instance_ior,                   /* nb_inplace_or */
+       instance_floordiv,              /* nb_floor_divide */
+       instance_truediv,               /* nb_true_divide */
+       instance_ifloordiv,             /* nb_inplace_floor_divide */
+       instance_itruediv,              /* nb_inplace_true_divide */
+       (lenfunc)instance_index,        /* nb_index */
 };
 
 PyTypeObject PyInstance_Type = {
@@ -2514,7 +2514,7 @@ PyTypeObject PyMethod_Type = {
        (hashfunc)instancemethod_hash,          /* tp_hash */
        instancemethod_call,                    /* tp_call */
        0,                                      /* tp_str */
-       (getattrofunc)instancemethod_getattro,  /* tp_getattro */
+       instancemethod_getattro,                /* tp_getattro */
        PyObject_GenericSetAttr,                /* tp_setattro */
        0,                                      /* tp_as_buffer */
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC  | Py_TPFLAGS_HAVE_WEAKREFS, /* tp_flags */
index f764a1dffd20b2205a308d2167baa3c6c4b3e30f..b2cae9a40401e1d82eb7ff00aefa62b3437b7196 100644 (file)
@@ -136,25 +136,26 @@ mechanism to link to one another.");
 
 PyTypeObject PyCObject_Type = {
     PyObject_HEAD_INIT(&PyType_Type)
-    0,                                 /*ob_size*/
-    "PyCObject",                       /*tp_name*/
-    sizeof(PyCObject),                 /*tp_basicsize*/
-    0,                                 /*tp_itemsize*/
+    0,                         /*ob_size*/
+    "PyCObject",               /*tp_name*/
+    sizeof(PyCObject),         /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
     /* methods */
-    (destructor)PyCObject_dealloc,     /*tp_dealloc*/
-    (printfunc)0,                      /*tp_print*/
-    (getattrfunc)0,                    /*tp_getattr*/
-    (setattrfunc)0,                    /*tp_setattr*/
-    (cmpfunc)0,                                /*tp_compare*/
-    (reprfunc)0,                       /*tp_repr*/
-    0,                                 /*tp_as_number*/
-    0,                                 /*tp_as_sequence*/
-    0,                                 /*tp_as_mapping*/
-    (hashfunc)0,                       /*tp_hash*/
-    (ternaryfunc)0,                    /*tp_call*/
-    (reprfunc)0,                       /*tp_str*/
-
-    /* Space for future expansion */
-    0L,0L,0L,0L,
-    PyCObject_Type__doc__              /* Documentation string */
+    (destructor)PyCObject_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash*/
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    0,                         /*tp_flags*/
+    PyCObject_Type__doc__      /*tp_doc*/
 };
index 5c84eff1db265c5f28bf79d7e5698f61660afde8..1b2ea9b7a1191cffb5be5c95e20bdca24f68c39d 100644 (file)
@@ -962,10 +962,10 @@ static PyNumberMethods complex_as_number = {
        0,                                      /* nb_and */
        0,                                      /* nb_xor */
        0,                                      /* nb_or */
-       (coercion)complex_coerce,               /* nb_coerce */
-       (unaryfunc)complex_int,                 /* nb_int */
-       (unaryfunc)complex_long,                /* nb_long */
-       (unaryfunc)complex_float,               /* nb_float */
+       complex_coerce,                         /* nb_coerce */
+       complex_int,                            /* nb_int */
+       complex_long,                           /* nb_long */
+       complex_float,                          /* nb_float */
        0,                                      /* nb_oct */
        0,                                      /* nb_hex */
        0,                                      /* nb_inplace_add */
@@ -991,7 +991,7 @@ PyTypeObject PyComplex_Type = {
        "complex",
        sizeof(PyComplexObject),
        0,
-       (destructor)complex_dealloc,            /* tp_dealloc */
+       complex_dealloc,                        /* tp_dealloc */
        (printfunc)complex_print,               /* tp_print */
        0,                                      /* tp_getattr */
        0,                                      /* tp_setattr */
index 949406250fc10e11794c91c4bade8766d370a1f3..bfa25e98f6a234d6fa038afb15058d7605b32065 100644 (file)
@@ -480,7 +480,7 @@ static PyTypeObject PyMemberDescr_Type = {
        0,                                      /* tp_as_sequence */
        0,                                      /* tp_as_mapping */
        0,                                      /* tp_hash */
-       (ternaryfunc)0,                         /* tp_call */
+       0,                                      /* tp_call */
        0,                                      /* tp_str */
        PyObject_GenericGetAttr,                /* tp_getattro */
        0,                                      /* tp_setattro */
@@ -518,7 +518,7 @@ static PyTypeObject PyGetSetDescr_Type = {
        0,                                      /* tp_as_sequence */
        0,                                      /* tp_as_mapping */
        0,                                      /* tp_hash */
-       (ternaryfunc)0,                         /* tp_call */
+       0,                                      /* tp_call */
        0,                                      /* tp_str */
        PyObject_GenericGetAttr,                /* tp_getattro */
        0,                                      /* tp_setattro */
index 0eccdbba9f00abe2d09861a831e3bf0a2168e062..f6fa1eb9e4440af8b122c109d395d82f7cc93021 100644 (file)
@@ -1880,16 +1880,16 @@ PyDict_Contains(PyObject *op, PyObject *key)
 
 /* Hack to implement "key in dict" */
 static PySequenceMethods dict_as_sequence = {
-       0,                                      /* sq_length */
-       0,                                      /* sq_concat */
-       0,                                      /* sq_repeat */
-       0,                                      /* sq_item */
-       0,                                      /* sq_slice */
-       0,                                      /* sq_ass_item */
-       0,                                      /* sq_ass_slice */
-       (objobjproc)PyDict_Contains,            /* sq_contains */
-       0,                                      /* sq_inplace_concat */
-       0,                                      /* sq_inplace_repeat */
+       0,                      /* sq_length */
+       0,                      /* sq_concat */
+       0,                      /* sq_repeat */
+       0,                      /* sq_item */
+       0,                      /* sq_slice */
+       0,                      /* sq_ass_item */
+       0,                      /* sq_ass_slice */
+       PyDict_Contains,        /* sq_contains */
+       0,                      /* sq_inplace_concat */
+       0,                      /* sq_inplace_repeat */
 };
 
 static PyObject *
@@ -1966,8 +1966,8 @@ PyTypeObject PyDict_Type = {
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
                Py_TPFLAGS_BASETYPE,            /* tp_flags */
        dictionary_doc,                         /* tp_doc */
-       (traverseproc)dict_traverse,            /* tp_traverse */
-       (inquiry)dict_tp_clear,                 /* tp_clear */
+       dict_traverse,                          /* tp_traverse */
+       dict_tp_clear,                          /* tp_clear */
        dict_richcompare,                       /* tp_richcompare */
        0,                                      /* tp_weaklistoffset */
        (getiterfunc)dict_iter,                 /* tp_iter */
@@ -1980,7 +1980,7 @@ PyTypeObject PyDict_Type = {
        0,                                      /* tp_descr_get */
        0,                                      /* tp_descr_set */
        0,                                      /* tp_dictoffset */
-       (initproc)dict_init,                    /* tp_init */
+       dict_init,                              /* tp_init */
        PyType_GenericAlloc,                    /* tp_alloc */
        dict_new,                               /* tp_new */
        PyObject_GC_Del,                        /* tp_free */
index 57a9e9d39bb2da16859d9604e53852662c490308..29c89db52feb7ee8b06db8d28e437315776bd2f3 100644 (file)
@@ -2063,7 +2063,7 @@ PyTypeObject PyFile_Type = {
        0,                                      /* tp_descr_get */
        0,                                      /* tp_descr_set */
        0,                                      /* tp_dictoffset */
-       (initproc)file_init,                    /* tp_init */
+       file_init,                              /* tp_init */
        PyType_GenericAlloc,                    /* tp_alloc */
        file_new,                               /* tp_new */
        PyObject_Del,                           /* tp_free */
index c27a41a060e9de1c3e415f725377d78be32c2b2c..64a5122c45131a5964057459f0c65d5f18dd844a 100644 (file)
@@ -1125,13 +1125,13 @@ Convert a string or number to a floating point number, if possible.");
 
 
 static PyNumberMethods float_as_number = {
-       (binaryfunc)float_add, /*nb_add*/
-       (binaryfunc)float_sub, /*nb_subtract*/
-       (binaryfunc)float_mul, /*nb_multiply*/
-       (binaryfunc)float_classic_div, /*nb_divide*/
-       (binaryfunc)float_rem, /*nb_remainder*/
-       (binaryfunc)float_divmod, /*nb_divmod*/
-       (ternaryfunc)float_pow, /*nb_power*/
+       float_add,      /*nb_add*/
+       float_sub,      /*nb_subtract*/
+       float_mul,      /*nb_multiply*/
+       float_classic_div, /*nb_divide*/
+       float_rem,      /*nb_remainder*/
+       float_divmod,   /*nb_divmod*/
+       float_pow,      /*nb_power*/
        (unaryfunc)float_neg, /*nb_negative*/
        (unaryfunc)float_pos, /*nb_positive*/
        (unaryfunc)float_abs, /*nb_absolute*/
@@ -1142,10 +1142,10 @@ static PyNumberMethods float_as_number = {
        0,              /*nb_and*/
        0,              /*nb_xor*/
        0,              /*nb_or*/
-       (coercion)float_coerce, /*nb_coerce*/
-       (unaryfunc)float_int, /*nb_int*/
-       (unaryfunc)float_long, /*nb_long*/
-       (unaryfunc)float_float, /*nb_float*/
+       float_coerce,   /*nb_coerce*/
+       float_int,      /*nb_int*/
+       float_long,     /*nb_long*/
+       float_float,    /*nb_float*/
        0,              /* nb_oct */
        0,              /* nb_hex */
        0,              /* nb_inplace_add */
@@ -1191,7 +1191,7 @@ PyTypeObject PyFloat_Type = {
        float_doc,                              /* tp_doc */
        0,                                      /* tp_traverse */
        0,                                      /* tp_clear */
-       (richcmpfunc)float_richcompare,         /* tp_richcompare */
+       float_richcompare,                      /* tp_richcompare */
        0,                                      /* tp_weaklistoffset */
        0,                                      /* tp_iter */
        0,                                      /* tp_iternext */
index 86e2e8c08fbca78a34f2316f06d3ed8f1bcabad2..a88d51f0f87d21f06d77146e9fc6afd55c19c980 100644 (file)
@@ -1069,7 +1069,7 @@ static PyNumberMethods int_as_number = {
        int_true_divide,        /* nb_true_divide */
        0,                      /* nb_inplace_floor_divide */
        0,                      /* nb_inplace_true_divide */
-       (lenfunc)PyInt_AsSsize_t, /* nb_index */
+       PyInt_AsSsize_t,        /* nb_index */
 };
 
 PyTypeObject PyInt_Type = {
index 51f551bf6942d8c2b45d3719ba08e26ce2451bee..14cacc69389b40a634e6d031779d5b51ee196c24 100644 (file)
@@ -123,7 +123,7 @@ PyTypeObject PySeqIter_Type = {
        0,                                      /* tp_richcompare */
        0,                                      /* tp_weaklistoffset */
        PyObject_SelfIter,                      /* tp_iter */
-       (iternextfunc)iter_iternext,            /* tp_iternext */
+       iter_iternext,                          /* tp_iternext */
        seqiter_methods,                        /* tp_methods */
        0,                                      /* tp_members */
 };
index 6b1a4811f3bb5cbc18ecaa80f3bee76fe3d8875a..ebcce45cfee07299a6c70cc2677462b0406b7fa5 100644 (file)
@@ -3130,26 +3130,26 @@ static PyNumberMethods long_as_number = {
        (binaryfunc)    long_add,       /*nb_add*/
        (binaryfunc)    long_sub,       /*nb_subtract*/
        (binaryfunc)    long_mul,       /*nb_multiply*/
-       (binaryfunc)    long_classic_div, /*nb_divide*/
-       (binaryfunc)    long_mod,       /*nb_remainder*/
-       (binaryfunc)    long_divmod,    /*nb_divmod*/
-       (ternaryfunc)   long_pow,       /*nb_power*/
+                       long_classic_div, /*nb_divide*/
+                       long_mod,       /*nb_remainder*/
+                       long_divmod,    /*nb_divmod*/
+                       long_pow,       /*nb_power*/
        (unaryfunc)     long_neg,       /*nb_negative*/
        (unaryfunc)     long_pos,       /*tp_positive*/
        (unaryfunc)     long_abs,       /*tp_absolute*/
        (inquiry)       long_nonzero,   /*tp_nonzero*/
        (unaryfunc)     long_invert,    /*nb_invert*/
-       (binaryfunc)    long_lshift,    /*nb_lshift*/
+                       long_lshift,    /*nb_lshift*/
        (binaryfunc)    long_rshift,    /*nb_rshift*/
-       (binaryfunc)    long_and,       /*nb_and*/
-       (binaryfunc)    long_xor,       /*nb_xor*/
-       (binaryfunc)    long_or,        /*nb_or*/
-       (coercion)      long_coerce,    /*nb_coerce*/
-       (unaryfunc)     long_int,       /*nb_int*/
-       (unaryfunc)     long_long,      /*nb_long*/
-       (unaryfunc)     long_float,     /*nb_float*/
-       (unaryfunc)     long_oct,       /*nb_oct*/
-       (unaryfunc)     long_hex,       /*nb_hex*/
+                       long_and,       /*nb_and*/
+                       long_xor,       /*nb_xor*/
+                       long_or,        /*nb_or*/
+                       long_coerce,    /*nb_coerce*/
+                       long_int,       /*nb_int*/
+                       long_long,      /*nb_long*/
+                       long_float,     /*nb_float*/
+                       long_oct,       /*nb_oct*/
+                       long_hex,       /*nb_hex*/
        0,                              /* nb_inplace_add */
        0,                              /* nb_inplace_subtract */
        0,                              /* nb_inplace_multiply */
@@ -3161,11 +3161,11 @@ static PyNumberMethods long_as_number = {
        0,                              /* nb_inplace_and */
        0,                              /* nb_inplace_xor */
        0,                              /* nb_inplace_or */
-       (binaryfunc)long_div,           /* nb_floor_divide */
+       long_div,                       /* nb_floor_divide */
        long_true_divide,               /* nb_true_divide */
        0,                              /* nb_inplace_floor_divide */
        0,                              /* nb_inplace_true_divide */
-       (lenfunc)long_index,            /* nb_index */
+       long_index,                     /* nb_index */
 };
 
 PyTypeObject PyLong_Type = {
@@ -3174,18 +3174,18 @@ PyTypeObject PyLong_Type = {
        "long",                                 /* tp_name */
        sizeof(PyLongObject) - sizeof(digit),   /* tp_basicsize */
        sizeof(digit),                          /* tp_itemsize */
-       (destructor)long_dealloc,               /* tp_dealloc */
+       long_dealloc,                           /* tp_dealloc */
        0,                                      /* tp_print */
        0,                                      /* tp_getattr */
        0,                                      /* tp_setattr */
        (cmpfunc)long_compare,                  /* tp_compare */
-       (reprfunc)long_repr,                    /* tp_repr */
+       long_repr,                              /* tp_repr */
        &long_as_number,                        /* tp_as_number */
        0,                                      /* tp_as_sequence */
        0,                                      /* tp_as_mapping */
        (hashfunc)long_hash,                    /* tp_hash */
         0,                                     /* tp_call */
-        (reprfunc)long_str,                    /* tp_str */
+        long_str,                              /* tp_str */
        PyObject_GenericGetAttr,                /* tp_getattro */
        0,                                      /* tp_setattro */
        0,                                      /* tp_as_buffer */
index 63fb4fdfeff77bc43c42fd10d74022cffefa1681..e73dad59eac406e15d54ecc29125d49767d031e6 100644 (file)
@@ -1774,12 +1774,12 @@ static PyTypeObject PyNone_Type = {
        "NoneType",
        0,
        0,
-       (destructor)none_dealloc,            /*tp_dealloc*/ /*never called*/
+       none_dealloc,   /*tp_dealloc*/ /*never called*/
        0,              /*tp_print*/
        0,              /*tp_getattr*/
        0,              /*tp_setattr*/
        0,              /*tp_compare*/
-       (reprfunc)none_repr, /*tp_repr*/
+       none_repr,      /*tp_repr*/
        0,              /*tp_as_number*/
        0,              /*tp_as_sequence*/
        0,              /*tp_as_mapping*/
@@ -1805,12 +1805,12 @@ static PyTypeObject PyNotImplemented_Type = {
        "NotImplementedType",
        0,
        0,
-       (destructor)none_dealloc,            /*tp_dealloc*/ /*never called*/
+       none_dealloc,   /*tp_dealloc*/ /*never called*/
        0,              /*tp_print*/
        0,              /*tp_getattr*/
        0,              /*tp_setattr*/
        0,              /*tp_compare*/
-       (reprfunc)NotImplemented_repr, /*tp_repr*/
+       NotImplemented_repr, /*tp_repr*/
        0,              /*tp_as_number*/
        0,              /*tp_as_sequence*/
        0,              /*tp_as_mapping*/
index a9c0b55f9d3d60683c29dbdc5279203fe36edf14..707ad4690e234dc746392a5bcc341b57b8628c52 100644 (file)
@@ -157,44 +157,44 @@ static PyMethodDef range_methods[] = {
 
 PyTypeObject PyRange_Type = {
        PyObject_HEAD_INIT(&PyType_Type)
-       0,                              /* Number of items for varobject */
-       "xrange",                       /* Name of this type */
-       sizeof(rangeobject),            /* Basic object size */
-       0,                              /* Item size for varobject */
-       (destructor)PyObject_Del,       /* tp_dealloc */
-       0,                              /* tp_print */
-       0,                              /* tp_getattr */
-       0,                              /* tp_setattr */
-       0,                              /* tp_compare */
-       (reprfunc)range_repr,           /* tp_repr */
-       0,                              /* tp_as_number */
-       &range_as_sequence,             /* tp_as_sequence */
-       0,                              /* tp_as_mapping */
-       0,                              /* tp_hash */
-       0,                              /* tp_call */
-       0,                              /* tp_str */
-       PyObject_GenericGetAttr,        /* tp_getattro */
-       0,                              /* tp_setattro */
-       0,                              /* tp_as_buffer */
-       Py_TPFLAGS_DEFAULT,             /* tp_flags */
-       range_doc,                      /* tp_doc */
-       0,                              /* tp_traverse */
-       0,                              /* tp_clear */
-       0,                              /* tp_richcompare */
-       0,                              /* tp_weaklistoffset */
-       (getiterfunc)range_iter,        /* tp_iter */
-       0,                              /* tp_iternext */
-       range_methods,                  /* tp_methods */
-       0,                              /* tp_members */
-       0,                              /* tp_getset */
-       0,                              /* tp_base */
-       0,                              /* tp_dict */
-       0,                              /* tp_descr_get */
-       0,                              /* tp_descr_set */
-       0,                              /* tp_dictoffset */
-       0,                              /* tp_init */
-       0,                              /* tp_alloc */
-       range_new,                      /* tp_new */
+       0,                      /* Number of items for varobject */
+       "xrange",               /* Name of this type */
+       sizeof(rangeobject),    /* Basic object size */
+       0,                      /* Item size for varobject */
+       (destructor)PyObject_Del, /* tp_dealloc */
+       0,                      /* tp_print */
+       0,                      /* tp_getattr */
+       0,                      /* tp_setattr */
+       0,                      /* tp_compare */
+       (reprfunc)range_repr,   /* tp_repr */
+       0,                      /* tp_as_number */
+       &range_as_sequence,     /* tp_as_sequence */
+       0,                      /* tp_as_mapping */
+       0,                      /* tp_hash */
+       0,                      /* tp_call */
+       0,                      /* tp_str */
+       PyObject_GenericGetAttr,  /* tp_getattro */
+       0,                      /* tp_setattro */
+       0,                      /* tp_as_buffer */
+       Py_TPFLAGS_DEFAULT,     /* tp_flags */
+       range_doc,              /* tp_doc */
+       0,                      /* tp_traverse */
+       0,                      /* tp_clear */
+       0,                      /* tp_richcompare */
+       0,                      /* tp_weaklistoffset */
+       range_iter,             /* tp_iter */
+       0,                      /* tp_iternext */
+       range_methods,          /* tp_methods */
+       0,                      /* tp_members */
+       0,                      /* tp_getset */
+       0,                      /* tp_base */
+       0,                      /* tp_dict */
+       0,                      /* tp_descr_get */
+       0,                      /* tp_descr_set */
+       0,                      /* tp_dictoffset */
+       0,                      /* tp_init */
+       0,                      /* tp_alloc */
+       range_new,              /* tp_new */
 };
 
 /*********************** Xrange Iterator **************************/
index 3541ff18b4ef750146e2ad6831635c222cd78cb6..7422e6704441a8bc2b60c27c8a6d60e93b539b17 100644 (file)
@@ -1531,7 +1531,7 @@ set_richcompare(PySetObject *v, PyObject *w, int op)
 }
 
 static int
-set_nocmp(PyObject *self)
+set_nocmp(PyObject *self, PyObject *other)
 {
        PyErr_SetString(PyExc_TypeError, "cannot compare sets using cmp()");
        return -1;
@@ -1688,7 +1688,7 @@ set_init(PySetObject *self, PyObject *args, PyObject *kwds)
 }
 
 static PySequenceMethods set_as_sequence = {
-       (lenfunc)set_len,               /* sq_length */
+       set_len,                        /* sq_length */
        0,                              /* sq_concat */
        0,                              /* sq_repeat */
        0,                              /* sq_item */
@@ -1804,7 +1804,7 @@ PyTypeObject PySet_Type = {
        (printfunc)set_tp_print,        /* tp_print */
        0,                              /* tp_getattr */
        0,                              /* tp_setattr */
-       (cmpfunc)set_nocmp,             /* tp_compare */
+       set_nocmp,                      /* tp_compare */
        (reprfunc)set_repr,             /* tp_repr */
        &set_as_number,                 /* tp_as_number */
        &set_as_sequence,               /* tp_as_sequence */
@@ -1899,7 +1899,7 @@ PyTypeObject PyFrozenSet_Type = {
        (printfunc)set_tp_print,        /* tp_print */
        0,                              /* tp_getattr */
        0,                              /* tp_setattr */
-       (cmpfunc)set_nocmp,             /* tp_compare */
+       set_nocmp,                      /* tp_compare */
        (reprfunc)set_repr,             /* tp_repr */
        &frozenset_as_number,           /* tp_as_number */
        &set_as_sequence,               /* tp_as_sequence */
index ed00ce402e9786139a69a1bc4379d89814ed77b2..dbf27323a8cdbd9c0ec08a0f7930962640566785 100644 (file)
@@ -24,26 +24,26 @@ ellipsis_repr(PyObject *op)
 
 static PyTypeObject PyEllipsis_Type = {
        PyObject_HEAD_INIT(&PyType_Type)
-       0,                                      /* ob_size */
-       "ellipsis",                             /* tp_name */
-       0,                                      /* tp_basicsize */
-       0,                                      /* tp_itemsize */
-       0, /*never called*/                     /* tp_dealloc */
-       0,                                      /* tp_print */
-       0,                                      /* tp_getattr */
-       0,                                      /* tp_setattr */
-       0,                                      /* tp_compare */
-       (reprfunc)ellipsis_repr,                /* tp_repr */
-       0,                                      /* tp_as_number */
-       0,                                      /* tp_as_sequence */
-       0,                                      /* tp_as_mapping */
-       0,                                      /* tp_hash */
-       0,                                      /* tp_call */
-       0,                                      /* tp_str */
-       PyObject_GenericGetAttr,                /* tp_getattro */
-       0,                                      /* tp_setattro */
-       0,                                      /* tp_as_buffer */
-       Py_TPFLAGS_DEFAULT,                     /* tp_flags */
+       0,                              /* ob_size */
+       "ellipsis",                     /* tp_name */
+       0,                              /* tp_basicsize */
+       0,                              /* tp_itemsize */
+       0, /*never called*/             /* tp_dealloc */
+       0,                              /* tp_print */
+       0,                              /* tp_getattr */
+       0,                              /* tp_setattr */
+       0,                              /* tp_compare */
+       ellipsis_repr,                  /* tp_repr */
+       0,                              /* tp_as_number */
+       0,                              /* tp_as_sequence */
+       0,                              /* tp_as_mapping */
+       0,                              /* tp_hash */
+       0,                              /* tp_call */
+       0,                              /* tp_str */
+       PyObject_GenericGetAttr,        /* tp_getattro */
+       0,                              /* tp_setattro */
+       0,                              /* tp_as_buffer */
+       Py_TPFLAGS_DEFAULT,             /* tp_flags */
 };
 
 PyObject _Py_EllipsisObject = {
index e440bea71320e482ced5da280b2497670aa9478f..3e3f1a963ad7fd6c7d2761b44c1b3200cbb7e8af 100644 (file)
@@ -3460,18 +3460,18 @@ PyTypeObject PyString_Type = {
        "str",
        sizeof(PyStringObject),
        sizeof(char),
-       (destructor)string_dealloc,             /* tp_dealloc */
+       string_dealloc,                         /* tp_dealloc */
        (printfunc)string_print,                /* tp_print */
        0,                                      /* tp_getattr */
        0,                                      /* tp_setattr */
        0,                                      /* tp_compare */
-       (reprfunc)string_repr,                  /* tp_repr */
+       string_repr,                            /* tp_repr */
        &string_as_number,                      /* tp_as_number */
        &string_as_sequence,                    /* tp_as_sequence */
        &string_as_mapping,                     /* tp_as_mapping */
        (hashfunc)string_hash,                  /* tp_hash */
        0,                                      /* tp_call */
-       (reprfunc)string_str,                   /* tp_str */
+       string_str,                             /* tp_str */
        PyObject_GenericGetAttr,                /* tp_getattro */
        0,                                      /* tp_setattro */
        &string_as_buffer,                      /* tp_as_buffer */
index 218d0b4dc9d711aed4198e2cf334b5e22eba5d48..e1e7cfae62e8223b041bff6ba87778213c3e22a6 100644 (file)
@@ -315,7 +315,7 @@ static PyTypeObject _struct_sequence_template = {
        0,                                      /* tp_as_number */
        &structseq_as_sequence,                 /* tp_as_sequence */
        0,                                      /* tp_as_mapping */
-       (hashfunc)structseq_hash,               /* tp_hash */
+       structseq_hash,                         /* tp_hash */
        0,                                      /* tp_call */
        0,                                      /* tp_str */
        0,                                      /* tp_getattro */
index e45a480822a9646bdaaaacca82ab6200b15faf5c..7a59bb22d68d9550aa3374f460bc6dda08270519 100644 (file)
@@ -2788,7 +2788,7 @@ PyTypeObject PyBaseObject_Type = {
        "object",                               /* tp_name */
        sizeof(PyObject),                       /* tp_basicsize */
        0,                                      /* tp_itemsize */
-       (destructor)object_dealloc,             /* tp_dealloc */
+       object_dealloc,                         /* tp_dealloc */
        0,                                      /* tp_print */
        0,                                      /* tp_getattr */
        0,                                      /* tp_setattr */
index 52bff2dfcb38ada7242f319f3102206aafa0a02c..9ebefd07d41de7c080aaa452c87a44b18642c215 100644 (file)
@@ -6380,7 +6380,7 @@ static PyMethodDef unicode_methods[] = {
     /* Order is according to common usage: often used methods should
        appear first, since lookup is done sequentially. */
 
-    {"encode", (PyCFunction) unicode_encode, METH_VARARGS, encode__doc__},
+    {"encode",  unicode_encode, METH_VARARGS, encode__doc__},
     {"replace", (PyCFunction) unicode_replace, METH_VARARGS, replace__doc__},
     {"split", (PyCFunction) unicode_split, METH_VARARGS, split__doc__},
     {"rsplit", (PyCFunction) unicode_rsplit, METH_VARARGS, rsplit__doc__},
@@ -6451,13 +6451,13 @@ static PyNumberMethods unicode_as_number = {
 
 static PySequenceMethods unicode_as_sequence = {
     (lenfunc) unicode_length,          /* sq_length */
-    (binaryfunc) PyUnicode_Concat,     /* sq_concat */
+    PyUnicode_Concat,                  /* sq_concat */
     (ssizeargfunc) unicode_repeat,     /* sq_repeat */
     (ssizeargfunc) unicode_getitem,    /* sq_item */
     (ssizessizeargfunc) unicode_slice,         /* sq_slice */
     0,                                         /* sq_ass_item */
     0,                                         /* sq_ass_slice */
-    (objobjproc)PyUnicode_Contains,    /*sq_contains*/
+    PyUnicode_Contains,                /* sq_contains */
 };
 
 #define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX)
@@ -7337,7 +7337,7 @@ PyTypeObject PyUnicode_Type = {
     0,                                 /* tp_getattr */
     0,                                         /* tp_setattr */
     (cmpfunc) unicode_compare,                 /* tp_compare */
-    (reprfunc) unicode_repr,           /* tp_repr */
+    unicode_repr,                      /* tp_repr */
     &unicode_as_number,                /* tp_as_number */
     &unicode_as_sequence,              /* tp_as_sequence */
     &unicode_as_mapping,               /* tp_as_mapping */
index 1d68bb5a7119e0f132c3cf3058b641e964ea6f1b..a116efc8637f7e22b073c593b584efb3f0aa6a2c 100644 (file)
@@ -367,7 +367,7 @@ _PyWeakref_RefType = {
     0,                          /*tp_descr_get*/
     0,                          /*tp_descr_set*/
     0,                          /*tp_dictoffset*/
-    (initproc)weakref___init__, /*tp_init*/
+    weakref___init__,           /*tp_init*/
     PyType_GenericAlloc,        /*tp_alloc*/
     weakref___new__,            /*tp_new*/
     PyObject_GC_Del,            /*tp_free*/
@@ -588,40 +588,40 @@ proxy_iternext(PyWeakReference *proxy)
 
 
 static PyNumberMethods proxy_as_number = {
-    (binaryfunc)proxy_add,      /*nb_add*/
-    (binaryfunc)proxy_sub,      /*nb_subtract*/
-    (binaryfunc)proxy_mul,      /*nb_multiply*/
-    (binaryfunc)proxy_div,      /*nb_divide*/
-    (binaryfunc)proxy_mod,      /*nb_remainder*/
-    (binaryfunc)proxy_divmod,   /*nb_divmod*/
-    (ternaryfunc)proxy_pow,     /*nb_power*/
-    (unaryfunc)proxy_neg,       /*nb_negative*/
-    (unaryfunc)proxy_pos,       /*nb_positive*/
-    (unaryfunc)proxy_abs,       /*nb_absolute*/
-    (inquiry)proxy_nonzero,     /*nb_nonzero*/
-    (unaryfunc)proxy_invert,    /*nb_invert*/
-    (binaryfunc)proxy_lshift,   /*nb_lshift*/
-    (binaryfunc)proxy_rshift,   /*nb_rshift*/
-    (binaryfunc)proxy_and,      /*nb_and*/
-    (binaryfunc)proxy_xor,      /*nb_xor*/
-    (binaryfunc)proxy_or,       /*nb_or*/
-    (coercion)0,                /*nb_coerce*/
-    (unaryfunc)proxy_int,       /*nb_int*/
-    (unaryfunc)proxy_long,      /*nb_long*/
-    (unaryfunc)proxy_float,     /*nb_float*/
-    (unaryfunc)0,               /*nb_oct*/
-    (unaryfunc)0,               /*nb_hex*/
-    (binaryfunc)proxy_iadd,     /*nb_inplace_add*/
-    (binaryfunc)proxy_isub,     /*nb_inplace_subtract*/
-    (binaryfunc)proxy_imul,     /*nb_inplace_multiply*/
-    (binaryfunc)proxy_idiv,     /*nb_inplace_divide*/
-    (binaryfunc)proxy_imod,     /*nb_inplace_remainder*/
-    (ternaryfunc)proxy_ipow,    /*nb_inplace_power*/
-    (binaryfunc)proxy_ilshift,  /*nb_inplace_lshift*/
-    (binaryfunc)proxy_irshift,  /*nb_inplace_rshift*/
-    (binaryfunc)proxy_iand,     /*nb_inplace_and*/
-    (binaryfunc)proxy_ixor,     /*nb_inplace_xor*/
-    (binaryfunc)proxy_ior,      /*nb_inplace_or*/
+    proxy_add,              /*nb_add*/
+    proxy_sub,              /*nb_subtract*/
+    proxy_mul,              /*nb_multiply*/
+    proxy_div,              /*nb_divide*/
+    proxy_mod,              /*nb_remainder*/
+    proxy_divmod,           /*nb_divmod*/
+    proxy_pow,              /*nb_power*/
+    proxy_neg,              /*nb_negative*/
+    proxy_pos,              /*nb_positive*/
+    proxy_abs,              /*nb_absolute*/
+    (inquiry)proxy_nonzero, /*nb_nonzero*/
+    proxy_invert,           /*nb_invert*/
+    proxy_lshift,           /*nb_lshift*/
+    proxy_rshift,           /*nb_rshift*/
+    proxy_and,              /*nb_and*/
+    proxy_xor,              /*nb_xor*/
+    proxy_or,               /*nb_or*/
+    0,                      /*nb_coerce*/
+    proxy_int,              /*nb_int*/
+    proxy_long,             /*nb_long*/
+    proxy_float,            /*nb_float*/
+    0,                      /*nb_oct*/
+    0,                      /*nb_hex*/
+    proxy_iadd,             /*nb_inplace_add*/
+    proxy_isub,             /*nb_inplace_subtract*/
+    proxy_imul,             /*nb_inplace_multiply*/
+    proxy_idiv,             /*nb_inplace_divide*/
+    proxy_imod,             /*nb_inplace_remainder*/
+    proxy_ipow,             /*nb_inplace_power*/
+    proxy_ilshift,          /*nb_inplace_lshift*/
+    proxy_irshift,          /*nb_inplace_rshift*/
+    proxy_iand,             /*nb_inplace_and*/
+    proxy_ixor,             /*nb_inplace_xor*/
+    proxy_ior,              /*nb_inplace_or*/
 };
 
 static PySequenceMethods proxy_as_sequence = {
@@ -636,8 +636,8 @@ static PySequenceMethods proxy_as_sequence = {
 };
 
 static PyMappingMethods proxy_as_mapping = {
-    (lenfunc)proxy_length,      /*mp_length*/
-    (binaryfunc)proxy_getitem,  /*mp_subscript*/
+    (lenfunc)proxy_length,        /*mp_length*/
+    proxy_getitem,                /*mp_subscript*/
     (objobjargproc)proxy_setitem, /*mp_ass_subscript*/
 };
 
@@ -655,14 +655,14 @@ _PyWeakref_ProxyType = {
     0,                                 /* tp_getattr */
     0,                                         /* tp_setattr */
     proxy_compare,                     /* tp_compare */
-    (unaryfunc)proxy_repr,             /* tp_repr */
+    (reprfunc)proxy_repr,              /* tp_repr */
     &proxy_as_number,                  /* tp_as_number */
     &proxy_as_sequence,                        /* tp_as_sequence */
     &proxy_as_mapping,                 /* tp_as_mapping */
     0,                                 /* tp_hash */
-    (ternaryfunc)0,                    /* tp_call */
-    (unaryfunc)proxy_str,              /* tp_str */
-    (getattrofunc)proxy_getattr,        /* tp_getattro */
+    0,                                 /* tp_call */
+    proxy_str,                          /* tp_str */
+    proxy_getattr,                      /* tp_getattro */
     (setattrofunc)proxy_setattr,        /* tp_setattro */
     0,                                 /* tp_as_buffer */
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC
@@ -695,9 +695,9 @@ _PyWeakref_CallableProxyType = {
     &proxy_as_sequence,                        /* tp_as_sequence */
     &proxy_as_mapping,                 /* tp_as_mapping */
     0,                                 /* tp_hash */
-    (ternaryfunc)proxy_call,           /* tp_call */
-    (unaryfunc)proxy_str,              /* tp_str */
-    (getattrofunc)proxy_getattr,        /* tp_getattro */
+    proxy_call,                                /* tp_call */
+    proxy_str,                         /* tp_str */
+    proxy_getattr,                      /* tp_getattro */
     (setattrofunc)proxy_setattr,        /* tp_setattro */
     0,                                 /* tp_as_buffer */
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC