Skip to content

Commit 19b7494

Browse files
committed
Use C99 style struct allocation
1 parent 13a33b0 commit 19b7494

File tree

1 file changed

+9
-37
lines changed

1 file changed

+9
-37
lines changed

src/isal/igzip_lib.c

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -481,43 +481,15 @@ static PyMemberDef IgzipDecompressor_members[] = {
481481

482482
static PyTypeObject IgzipDecompressor_Type = {
483483
PyVarObject_HEAD_INIT(NULL, 0)
484-
"igzip_lib.IgzipDecompressor", /* tp_name */
485-
sizeof(IgzipDecompressor), /* tp_basicsize */
486-
0, /* tp_itemsize */
487-
(destructor)IgzipDecompressor_dealloc,/* tp_dealloc */
488-
0, /* tp_vectorcall_offset */
489-
0, /* tp_getattr */
490-
0, /* tp_setattr */
491-
0, /* tp_as_async */
492-
0, /* tp_repr */
493-
0, /* tp_as_number */
494-
0, /* tp_as_sequence */
495-
0, /* tp_as_mapping */
496-
0, /* tp_hash */
497-
0, /* tp_call */
498-
0, /* tp_str */
499-
0, /* tp_getattro */
500-
0, /* tp_setattro */
501-
0, /* tp_as_buffer */
502-
Py_TPFLAGS_DEFAULT, /* tp_flags */
503-
igzip_lib_IgzipDecompressor___init____doc__, /* tp_doc */
504-
0, /* tp_traverse */
505-
0, /* tp_clear */
506-
0, /* tp_richcompare */
507-
0, /* tp_weaklistoffset */
508-
0, /* tp_iter */
509-
0, /* tp_iternext */
510-
IgzipDecompressor_methods, /* tp_methods */
511-
IgzipDecompressor_members, /* tp_members */
512-
0, /* tp_getset */
513-
0, /* tp_base */
514-
0, /* tp_dict */
515-
0, /* tp_descr_get */
516-
0, /* tp_descr_set */
517-
0, /* tp_dictoffset */
518-
igzip_lib_IgzipDecompressor___init__, /* tp_init */
519-
0, /* tp_alloc */
520-
PyType_GenericNew, /* tp_new */
484+
.tp_name = "igzip_lib.IgzipDecompressor",
485+
.tp_basicsize = sizeof(IgzipDecompressor),
486+
.tp_dealloc = (destructor)IgzipDecompressor_dealloc,
487+
.tp_flags = Py_TPFLAGS_DEFAULT,
488+
.tp_doc = igzip_lib_IgzipDecompressor___init____doc__,
489+
.tp_methods = IgzipDecompressor_methods,
490+
.tp_members = IgzipDecompressor_members,
491+
.tp_init = igzip_lib_IgzipDecompressor___init__,
492+
.tp_new = PyType_GenericNew,
521493
};
522494

523495
static PyMethodDef IgzipLibMethods[] = {

0 commit comments

Comments
 (0)