Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiple instances of incorrect definitions of PyTypeObject #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 36 additions & 24 deletions src/pylzma/pylzma_aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,37 +155,49 @@ CAESDecrypt_Type = {
sizeof(CAESDecryptObject), /* int tp_basicsize; */
0, /* int tp_itemsize; // not used much */
NULL, /* destructor tp_dealloc; */
NULL, /* printfunc tp_print; */
0, /* Py_ssize_t tp_vectorcall_offset; */
NULL, /* getattrfunc tp_getattr; // __getattr__ */
NULL, /* setattrfunc tp_setattr; // __setattr__ */
NULL, /* cmpfunc tp_compare; // __cmp__ */
NULL, /* PyAsyncMethods *tp_as_async; */
NULL, /* reprfunc tp_repr; // __repr__ */
NULL, /* PyNumberMethods *tp_as_number; */
NULL, /* PySequenceMethods *tp_as_sequence; */
NULL, /* PyMappingMethods *tp_as_mapping; */
NULL, /* hashfunc tp_hash; // __hash__ */
NULL, /* ternaryfunc tp_call; // __call__ */
NULL, /* reprfunc tp_str; // __str__ */
0, /* tp_getattro*/
0, /* tp_setattro*/
0, /* tp_as_buffer*/
Py_TPFLAGS_DEFAULT, /*tp_flags*/
"AES decryption class", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
aesdecrypt_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 */
(initproc)aesdecrypt_init, /* tp_init */
0, /* tp_alloc */
0, /* tp_new */
0, /* getattrofunc tp_getattro; */
0, /* setattrofunc tp_setattro; */
NULL, /* PyBufferProcs *tp_as_buffer; */
Py_TPFLAGS_DEFAULT, /* unsigned long tp_flags; */
"AES decryption class", /* const char *tp_doc; */
0, /* traverseproc tp_traverse; */
0, /* inquiry tp_clear; */
0, /* richcmpfunc tp_richcompare; */
0, /* Py_ssize_t tp_weaklistoffset; */
0, /* getiterfunc tp_iter; */
0, /* iternextfunc tp_iternext; */
aesdecrypt_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
NULL, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */
0, /* descrgetfunc tp_descr_get; */
0, /* descrsetfunc tp_descr_set; */
0, /* Py_ssize_t tp_dictoffset; */
(initproc)aesdecrypt_init, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */
NULL, /* newfunc tp_new; */
NULL, /* freefunc tp_free; */
NULL, /* inquiry tp_is_gc; */
NULL, /* PyObject *tp_bases; */
NULL, /* PyObject *tp_mro; */
NULL, /* PyObject *tp_cache; */
NULL, /* PyObject *tp_subclasses; */
NULL, /* PyObject *tp_weaklist; */
NULL, /* destructor tp_del; */
0, /* unsigned int tp_version_tag; */
NULL, /* destructor tp_finalize; */
NULL, /* vectorcallfunc tp_vectorcall; */
0 /* unsigned char tp_watched; */
};
62 changes: 37 additions & 25 deletions src/pylzma/pylzma_compressfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,41 +227,53 @@ pylzma_compfile_init(CCompressionFileObject *self, PyObject *args, PyObject *kwa
PyTypeObject
CCompressionFileObject_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
"pylzma.compressfile", /* char *tp_name; */
"pylzma.compressfile", /* char *tp_name; */
sizeof(CCompressionFileObject), /* int tp_basicsize; */
0, /* int tp_itemsize; // not used much */
(destructor)pylzma_compfile_dealloc, /* destructor tp_dealloc; */
NULL, /* printfunc tp_print; */
0, /* Py_ssize_t tp_vectorcall_offset; */
NULL, /* getattrfunc tp_getattr; // __getattr__ */
NULL, /* setattrfunc tp_setattr; // __setattr__ */
NULL, /* cmpfunc tp_compare; // __cmp__ */
NULL, /* PyAsyncMethods *tp_as_async; */
NULL, /* reprfunc tp_repr; // __repr__ */
NULL, /* PyNumberMethods *tp_as_number; */
NULL, /* PySequenceMethods *tp_as_sequence; */
NULL, /* PyMappingMethods *tp_as_mapping; */
NULL, /* hashfunc tp_hash; // __hash__ */
NULL, /* ternaryfunc tp_call; // __call__ */
NULL, /* reprfunc tp_str; // __str__ */
0, /* tp_getattro*/
0, /* tp_setattro*/
0, /* tp_as_buffer*/
Py_TPFLAGS_DEFAULT, /*tp_flags*/
"File compression class", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
pylzma_compfile_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 */
(initproc)pylzma_compfile_init, /* tp_init */
0, /* tp_alloc */
0, /* tp_new */
0, /* getattrofunc tp_getattro; */
0, /* setattrofunc tp_setattro; */
NULL, /* PyBufferProcs *tp_as_buffer; */
Py_TPFLAGS_DEFAULT, /* unsigned long tp_flags; */
"File compression class", /* const char *tp_doc; */
0, /* traverseproc tp_traverse; */
0, /* inquiry tp_clear; */
0, /* richcmpfunc tp_richcompare; */
0, /* Py_ssize_t tp_weaklistoffset; */
0, /* getiterfunc tp_iter; */
0, /* iternextfunc tp_iternext; */
pylzma_compfile_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
NULL, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */
0, /* descrgetfunc tp_descr_get; */
0, /* descrsetfunc tp_descr_set; */
0, /* Py_ssize_t tp_dictoffset; */
(initproc)pylzma_compfile_init, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */
NULL, /* newfunc tp_new; */
NULL, /* freefunc tp_free; */
NULL, /* inquiry tp_is_gc; */
NULL, /* PyObject *tp_bases; */
NULL, /* PyObject *tp_mro; */
NULL, /* PyObject *tp_cache; */
NULL, /* PyObject *tp_subclasses; */
NULL, /* PyObject *tp_weaklist; */
NULL, /* destructor tp_del; */
0, /* unsigned int tp_version_tag; */
NULL, /* destructor tp_finalize; */
NULL, /* vectorcallfunc tp_vectorcall; */
0 /* unsigned char tp_watched; */
};
60 changes: 36 additions & 24 deletions src/pylzma/pylzma_decompressobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,37 +382,49 @@ CDecompressionObject_Type = {
sizeof(CDecompressionObject), /* int tp_basicsize; */
0, /* int tp_itemsize; // not used much */
(destructor)pylzma_decomp_dealloc, /* destructor tp_dealloc; */
NULL, /* printfunc tp_print; */
0, /* Py_ssize_t tp_vectorcall_offset; */
NULL, /* getattrfunc tp_getattr; // __getattr__ */
NULL, /* setattrfunc tp_setattr; // __setattr__ */
NULL, /* cmpfunc tp_compare; // __cmp__ */
NULL, /* PyAsyncMethods *tp_as_async; */
NULL, /* reprfunc tp_repr; // __repr__ */
NULL, /* PyNumberMethods *tp_as_number; */
NULL, /* PySequenceMethods *tp_as_sequence; */
NULL, /* PyMappingMethods *tp_as_mapping; */
NULL, /* hashfunc tp_hash; // __hash__ */
NULL, /* ternaryfunc tp_call; // __call__ */
NULL, /* reprfunc tp_str; // __str__ */
0, /* tp_getattro*/
0, /* tp_setattro*/
0, /* tp_as_buffer*/
Py_TPFLAGS_DEFAULT, /*tp_flags*/
"Decompression class", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
pylzma_decomp_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 */
(initproc)pylzma_decomp_init, /* tp_init */
0, /* tp_alloc */
0, /* tp_new */
0, /* getattrofunc tp_getattro; */
0, /* setattrofunc tp_setattro; */
NULL, /* PyBufferProcs *tp_as_buffer; */
Py_TPFLAGS_DEFAULT, /* unsigned long tp_flags; */
"Decompression class", /* const char *tp_doc; */
0, /* traverseproc tp_traverse; */
0, /* inquiry tp_clear; */
0, /* richcmpfunc tp_richcompare; */
0, /* Py_ssize_t tp_weaklistoffset; */
0, /* getiterfunc tp_iter; */
0, /* iternextfunc tp_iternext; */
pylzma_decomp_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
NULL, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */
0, /* descrgetfunc tp_descr_get; */
0, /* descrsetfunc tp_descr_set; */
0, /* Py_ssize_t tp_dictoffset; */
(initproc)pylzma_decomp_init, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */
NULL, /* newfunc tp_new; */
NULL, /* freefunc tp_free; */
NULL, /* inquiry tp_is_gc; */
NULL, /* PyObject *tp_bases; */
NULL, /* PyObject *tp_mro; */
NULL, /* PyObject *tp_cache; */
NULL, /* PyObject *tp_subclasses; */
NULL, /* PyObject *tp_weaklist; */
NULL, /* destructor tp_del; */
0, /* unsigned int tp_version_tag; */
NULL, /* destructor tp_finalize; */
NULL, /* vectorcallfunc tp_vectorcall; */
0 /* unsigned char tp_watched; */
};
Loading