Skip to content

Commit 3859e8f

Browse files
author
georg.brandl
committed
Remove unnecessary casts from type object initializers.
git-svn-id: http://svn.python.org/projects/python/trunk@43454 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent d1c4590 commit 3859e8f

3 files changed

Lines changed: 35 additions & 35 deletions

File tree

Modules/cStringIO.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -503,17 +503,17 @@ static PyTypeObject Otype = {
503503
0, /*tp_itemsize*/
504504
/* methods */
505505
(destructor)O_dealloc, /*tp_dealloc*/
506-
(printfunc)0, /*tp_print*/
506+
0, /*tp_print*/
507507
0, /*tp_getattr */
508508
0, /*tp_setattr */
509-
(cmpfunc)0, /*tp_compare*/
510-
(reprfunc)0, /*tp_repr*/
509+
0, /*tp_compare*/
510+
0, /*tp_repr*/
511511
0, /*tp_as_number*/
512512
0, /*tp_as_sequence*/
513513
0, /*tp_as_mapping*/
514-
(hashfunc)0, /*tp_hash*/
515-
(ternaryfunc)0, /*tp_call*/
516-
(reprfunc)0, /*tp_str*/
514+
0, /*tp_hash*/
515+
0 , /*tp_call*/
516+
0, /*tp_str*/
517517
0, /*tp_getattro */
518518
0, /*tp_setattro */
519519
0, /*tp_as_buffer */
@@ -624,17 +624,17 @@ static PyTypeObject Itype = {
624624
0, /*tp_itemsize*/
625625
/* methods */
626626
(destructor)I_dealloc, /*tp_dealloc*/
627-
(printfunc)0, /*tp_print*/
627+
0, /*tp_print*/
628628
0, /* tp_getattr */
629-
(setattrfunc)0, /*tp_setattr*/
630-
(cmpfunc)0, /*tp_compare*/
631-
(reprfunc)0, /*tp_repr*/
629+
0, /*tp_setattr*/
630+
0, /*tp_compare*/
631+
0, /*tp_repr*/
632632
0, /*tp_as_number*/
633633
0, /*tp_as_sequence*/
634634
0, /*tp_as_mapping*/
635-
(hashfunc)0, /*tp_hash*/
636-
(ternaryfunc)0, /*tp_call*/
637-
(reprfunc)0, /*tp_str*/
635+
0, /*tp_hash*/
636+
0, /*tp_call*/
637+
0, /*tp_str*/
638638
0, /* tp_getattro */
639639
0, /* tp_setattro */
640640
0, /* tp_as_buffer */

Modules/collectionsmodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,11 +832,11 @@ static PyTypeObject deque_type = {
832832
0, /* tp_itemsize */
833833
/* methods */
834834
(destructor)deque_dealloc, /* tp_dealloc */
835-
(printfunc)deque_tp_print, /* tp_print */
835+
deque_tp_print, /* tp_print */
836836
0, /* tp_getattr */
837837
0, /* tp_setattr */
838838
0, /* tp_compare */
839-
(reprfunc)deque_repr, /* tp_repr */
839+
deque_repr, /* tp_repr */
840840
0, /* tp_as_number */
841841
&deque_as_sequence, /* tp_as_sequence */
842842
0, /* tp_as_mapping */
@@ -1302,7 +1302,7 @@ static PyTypeObject defdict_type = {
13021302
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
13031303
Py_TPFLAGS_HAVE_WEAKREFS, /* tp_flags */
13041304
defdict_doc, /* tp_doc */
1305-
(traverseproc)defdict_traverse, /* tp_traverse */
1305+
defdict_traverse, /* tp_traverse */
13061306
(inquiry)defdict_tp_clear, /* tp_clear */
13071307
0, /* tp_richcompare */
13081308
0, /* tp_weaklistoffset*/
@@ -1316,7 +1316,7 @@ static PyTypeObject defdict_type = {
13161316
0, /* tp_descr_get */
13171317
0, /* tp_descr_set */
13181318
0, /* tp_dictoffset */
1319-
(initproc)defdict_init, /* tp_init */
1319+
defdict_init, /* tp_init */
13201320
PyType_GenericAlloc, /* tp_alloc */
13211321
0, /* tp_new */
13221322
PyObject_GC_Del, /* tp_free */

Modules/threadmodule.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -375,41 +375,41 @@ static PyTypeObject localtype = {
375375
/* tp_basicsize */ sizeof(localobject),
376376
/* tp_itemsize */ 0,
377377
/* tp_dealloc */ (destructor)local_dealloc,
378-
/* tp_print */ (printfunc)0,
379-
/* tp_getattr */ (getattrfunc)0,
380-
/* tp_setattr */ (setattrfunc)0,
381-
/* tp_compare */ (cmpfunc)0,
382-
/* tp_repr */ (reprfunc)0,
378+
/* tp_print */ 0,
379+
/* tp_getattr */ 0,
380+
/* tp_setattr */ 0,
381+
/* tp_compare */ 0,
382+
/* tp_repr */ 0,
383383
/* tp_as_number */ 0,
384384
/* tp_as_sequence */ 0,
385385
/* tp_as_mapping */ 0,
386-
/* tp_hash */ (hashfunc)0,
387-
/* tp_call */ (ternaryfunc)0,
388-
/* tp_str */ (reprfunc)0,
386+
/* tp_hash */ 0,
387+
/* tp_call */ 0,
388+
/* tp_str */ 0,
389389
/* tp_getattro */ (getattrofunc)local_getattro,
390390
/* tp_setattro */ (setattrofunc)local_setattro,
391391
/* tp_as_buffer */ 0,
392392
/* tp_flags */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
393393
/* tp_doc */ "Thread-local data",
394394
/* tp_traverse */ (traverseproc)local_traverse,
395395
/* tp_clear */ (inquiry)local_clear,
396-
/* tp_richcompare */ (richcmpfunc)0,
397-
/* tp_weaklistoffset */ (long)0,
398-
/* tp_iter */ (getiterfunc)0,
399-
/* tp_iternext */ (iternextfunc)0,
396+
/* tp_richcompare */ 0,
397+
/* tp_weaklistoffset */ 0,
398+
/* tp_iter */ 0,
399+
/* tp_iternext */ 0,
400400
/* tp_methods */ 0,
401401
/* tp_members */ 0,
402402
/* tp_getset */ local_getset,
403403
/* tp_base */ 0,
404404
/* tp_dict */ 0, /* internal use */
405-
/* tp_descr_get */ (descrgetfunc)0,
406-
/* tp_descr_set */ (descrsetfunc)0,
405+
/* tp_descr_get */ 0,
406+
/* tp_descr_set */ 0,
407407
/* tp_dictoffset */ offsetof(localobject, dict),
408-
/* tp_init */ (initproc)0,
409-
/* tp_alloc */ (allocfunc)0,
410-
/* tp_new */ (newfunc)local_new,
408+
/* tp_init */ 0,
409+
/* tp_alloc */ 0,
410+
/* tp_new */ local_new,
411411
/* tp_free */ 0, /* Low-level free-mem routine */
412-
/* tp_is_gc */ (inquiry)0, /* For PyObject_IS_GC */
412+
/* tp_is_gc */ 0, /* For PyObject_IS_GC */
413413
};
414414

415415

0 commit comments

Comments
 (0)