Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4cc6bdff
Commit
4cc6bdff
authored
Feb 16, 1999
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the portable form of initializing the ob_type field for new types.
parent
1016e2bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
Modules/xxmodule.c
Modules/xxmodule.c
+8
-2
No files found.
Modules/xxmodule.c
View file @
4cc6bdff
...
@@ -132,8 +132,10 @@ Xxo_setattr(self, name, v)
...
@@ -132,8 +132,10 @@ Xxo_setattr(self, name, v)
return
PyDict_SetItemString
(
self
->
x_attr
,
name
,
v
);
return
PyDict_SetItemString
(
self
->
x_attr
,
name
,
v
);
}
}
staticforward
PyTypeObject
Xxo_Type
=
{
statichere
PyTypeObject
Xxo_Type
=
{
PyObject_HEAD_INIT
(
&
PyType_Type
)
/* The ob_type field must be initialized in the module init function
* to be portable to Windows without using C++. */
PyObject_HEAD_INIT
(
NULL
)
0
,
/*ob_size*/
0
,
/*ob_size*/
"Xxo"
,
/*tp_name*/
"Xxo"
,
/*tp_name*/
sizeof
(
XxoObject
),
/*tp_basicsize*/
sizeof
(
XxoObject
),
/*tp_basicsize*/
...
@@ -242,6 +244,10 @@ initxx()
...
@@ -242,6 +244,10 @@ initxx()
{
{
PyObject
*
m
,
*
d
;
PyObject
*
m
,
*
d
;
/* Initialize the type of the new type object here; doing it here
* is required for portability to Windows without requiring C++. */
Xxo_Type
.
ob_type
=
&
PyType_Type
;
/* Create the module and add the functions */
/* Create the module and add the functions */
m
=
Py_InitModule
(
"xx"
,
xx_methods
);
m
=
Py_InitModule
(
"xx"
,
xx_methods
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment