Skip to content

Commit ed62e64

Browse files
benjaminppetere
andauthored
[2.7] Fix misleading mentions of tp_size in comments (GH-9138)
Many type object initializations labeled a field "tp_size" in the comment, but the name of that field is tp_basicsize.. (cherry picked from commit 0e0bc4e) Co-authored-by: Peter Eisentraut <[email protected]>
1 parent f51a466 commit ed62e64

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

Modules/md5module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ copy() -- return a copy of the current md5 object");
236236
static PyTypeObject MD5type = {
237237
PyVarObject_HEAD_INIT(NULL, 0)
238238
"_md5.md5", /*tp_name*/
239-
sizeof(md5object), /*tp_size*/
239+
sizeof(md5object), /*tp_basicsize*/
240240
0, /*tp_itemsize*/
241241
/* methods */
242242
(destructor)md5_dealloc, /*tp_dealloc*/

Modules/mmapmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ To map anonymous memory, pass -1 as the fileno (both versions).");
10261026
static PyTypeObject mmap_object_type = {
10271027
PyVarObject_HEAD_INIT(NULL, 0)
10281028
"mmap.mmap", /* tp_name */
1029-
sizeof(mmap_object), /* tp_size */
1029+
sizeof(mmap_object), /* tp_basicsize */
10301030
0, /* tp_itemsize */
10311031
/* methods */
10321032
(destructor) mmap_object_dealloc, /* tp_dealloc */

Modules/ossaudiodev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ oss_mixer_getattr(oss_mixer_t *self, char *name)
842842
static PyTypeObject OSSAudioType = {
843843
PyVarObject_HEAD_INIT(&PyType_Type, 0)
844844
"ossaudiodev.oss_audio_device", /*tp_name*/
845-
sizeof(oss_audio_t), /*tp_size*/
845+
sizeof(oss_audio_t), /*tp_basicsize*/
846846
0, /*tp_itemsize*/
847847
/* methods */
848848
(destructor)oss_dealloc, /*tp_dealloc*/
@@ -856,7 +856,7 @@ static PyTypeObject OSSAudioType = {
856856
static PyTypeObject OSSMixerType = {
857857
PyVarObject_HEAD_INIT(&PyType_Type, 0)
858858
"ossaudiodev.oss_mixer_device", /*tp_name*/
859-
sizeof(oss_mixer_t), /*tp_size*/
859+
sizeof(oss_mixer_t), /*tp_basicsize*/
860860
0, /*tp_itemsize*/
861861
/* methods */
862862
(destructor)oss_mixer_dealloc, /*tp_dealloc*/

Modules/sha256module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ static PyMemberDef SHA_members[] = {
537537
static PyTypeObject SHA224type = {
538538
PyVarObject_HEAD_INIT(NULL, 0)
539539
"_sha256.sha224", /*tp_name*/
540-
sizeof(SHAobject), /*tp_size*/
540+
sizeof(SHAobject), /*tp_basicsize*/
541541
0, /*tp_itemsize*/
542542
/* methods */
543543
SHA_dealloc, /*tp_dealloc*/
@@ -571,7 +571,7 @@ static PyTypeObject SHA224type = {
571571
static PyTypeObject SHA256type = {
572572
PyVarObject_HEAD_INIT(NULL, 0)
573573
"_sha256.sha256", /*tp_name*/
574-
sizeof(SHAobject), /*tp_size*/
574+
sizeof(SHAobject), /*tp_basicsize*/
575575
0, /*tp_itemsize*/
576576
/* methods */
577577
SHA_dealloc, /*tp_dealloc*/

Modules/sha512module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ static PyMemberDef SHA_members[] = {
603603
static PyTypeObject SHA384type = {
604604
PyVarObject_HEAD_INIT(NULL, 0)
605605
"_sha512.sha384", /*tp_name*/
606-
sizeof(SHAobject), /*tp_size*/
606+
sizeof(SHAobject), /*tp_basicsize*/
607607
0, /*tp_itemsize*/
608608
/* methods */
609609
SHA512_dealloc, /*tp_dealloc*/
@@ -637,7 +637,7 @@ static PyTypeObject SHA384type = {
637637
static PyTypeObject SHA512type = {
638638
PyVarObject_HEAD_INIT(NULL, 0)
639639
"_sha512.sha512", /*tp_name*/
640-
sizeof(SHAobject), /*tp_size*/
640+
sizeof(SHAobject), /*tp_basicsize*/
641641
0, /*tp_itemsize*/
642642
/* methods */
643643
SHA512_dealloc, /*tp_dealloc*/

Objects/moduleobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ The name must be a string; the optional doc argument can have any type.");
221221
PyTypeObject PyModule_Type = {
222222
PyVarObject_HEAD_INIT(&PyType_Type, 0)
223223
"module", /* tp_name */
224-
sizeof(PyModuleObject), /* tp_size */
224+
sizeof(PyModuleObject), /* tp_basicsize */
225225
0, /* tp_itemsize */
226226
(destructor)module_dealloc, /* tp_dealloc */
227227
0, /* tp_print */

0 commit comments

Comments
 (0)