Skip to content

Commit c181874

Browse files
author
Ralf W. Grosse-Kunstleve
committed
initialize all slots of PyTypeObject to avoid g++ -Wall -W warnings
[SVN r32372]
1 parent 203a42c commit c181874

1 file changed

Lines changed: 88 additions & 20 deletions

File tree

test/m1.cpp

Lines changed: 88 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,50 @@ PyTypeObject NoddyType = {
3636
"Noddy",
3737
sizeof(NoddyObject),
3838
0,
39-
dealloc, /*tp_dealloc*/
40-
0, /*tp_print*/
41-
0, /*tp_getattr*/
42-
0, /*tp_setattr*/
43-
0, /*tp_compare*/
44-
0, /*tp_repr*/
45-
0, /*tp_as_number*/
46-
0, /*tp_as_sequence*/
47-
0, /*tp_as_mapping*/
48-
0, /*tp_hash */
39+
dealloc, /* tp_dealloc */
40+
0, /* tp_print */
41+
0, /* tp_getattr */
42+
0, /* tp_setattr */
43+
0, /* tp_compare */
44+
0, /* tp_repr */
45+
0, /* tp_as_number */
46+
0, /* tp_as_sequence */
47+
0, /* tp_as_mapping */
48+
0, /* tp_hash */
49+
0, /* tp_call */
50+
0, /* tp_str */
51+
0, /* tp_getattro */
52+
0, /* tp_setattro */
53+
0, /* tp_as_buffer */
54+
0, /* tp_flags */
55+
0, /* tp_doc */
56+
0, /* tp_traverse */
57+
0, /* tp_clear */
58+
0, /* tp_richcompare */
59+
0, /* tp_weaklistoffset */
60+
0, /* tp_iter */
61+
0, /* tp_iternext */
62+
0, /* tp_methods */
63+
0, /* tp_members */
64+
0, /* tp_getset */
65+
0, /* tp_base */
66+
0, /* tp_dict */
67+
0, /* tp_descr_get */
68+
0, /* tp_descr_set */
69+
0, /* tp_dictoffset */
70+
0, /* tp_init */
71+
0, /* tp_alloc */
72+
0, /* tp_new */
73+
0, /* tp_free */
74+
0, /* tp_is_gc */
75+
0, /* tp_bases */
76+
0, /* tp_mro */
77+
0, /* tp_cache */
78+
0, /* tp_subclasses */
79+
0, /* tp_weaklist */
80+
#if PYTHON_API_VERSION >= 1012
81+
0 /* tp_del */
82+
#endif
4983
};
5084

5185
// Create a Noddy containing 42
@@ -74,16 +108,50 @@ PyTypeObject SimpleType = {
74108
"Simple",
75109
sizeof(SimpleObject),
76110
0,
77-
dealloc, /*tp_dealloc*/
78-
0, /*tp_print*/
79-
0, /*tp_getattr*/
80-
0, /*tp_setattr*/
81-
0, /*tp_compare*/
82-
0, /*tp_repr*/
83-
0, /*tp_as_number*/
84-
0, /*tp_as_sequence*/
85-
0, /*tp_as_mapping*/
86-
0, /*tp_hash */
111+
dealloc, /* tp_dealloc */
112+
0, /* tp_print */
113+
0, /* tp_getattr */
114+
0, /* tp_setattr */
115+
0, /* tp_compare */
116+
0, /* tp_repr */
117+
0, /* tp_as_number */
118+
0, /* tp_as_sequence */
119+
0, /* tp_as_mapping */
120+
0, /* tp_hash */
121+
0, /* tp_call */
122+
0, /* tp_str */
123+
0, /* tp_getattro */
124+
0, /* tp_setattro */
125+
0, /* tp_as_buffer */
126+
0, /* tp_flags */
127+
0, /* tp_doc */
128+
0, /* tp_traverse */
129+
0, /* tp_clear */
130+
0, /* tp_richcompare */
131+
0, /* tp_weaklistoffset */
132+
0, /* tp_iter */
133+
0, /* tp_iternext */
134+
0, /* tp_methods */
135+
0, /* tp_members */
136+
0, /* tp_getset */
137+
0, /* tp_base */
138+
0, /* tp_dict */
139+
0, /* tp_descr_get */
140+
0, /* tp_descr_set */
141+
0, /* tp_dictoffset */
142+
0, /* tp_init */
143+
0, /* tp_alloc */
144+
0, /* tp_new */
145+
0, /* tp_free */
146+
0, /* tp_is_gc */
147+
0, /* tp_bases */
148+
0, /* tp_mro */
149+
0, /* tp_cache */
150+
0, /* tp_subclasses */
151+
0, /* tp_weaklist */
152+
#if PYTHON_API_VERSION >= 1012
153+
0 /* tp_del */
154+
#endif
87155
};
88156

89157
// Create a Simple containing "hello, world"

0 commit comments

Comments
 (0)