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
446c8d59
Commit
446c8d59
authored
Apr 05, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #11707: Fix compilation errors with Visual Studio
Fix also a compiler (gcc) warning.
parent
7ab9e22e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
Modules/_functoolsmodule.c
Modules/_functoolsmodule.c
+8
-6
No files found.
Modules/_functoolsmodule.c
View file @
446c8d59
...
...
@@ -333,7 +333,7 @@ static PyTypeObject partial_type = {
/* cmp_to_key ***************************************************************/
typedef
struct
{
PyObject_HEAD
;
PyObject_HEAD
PyObject
*
cmp
;
PyObject
*
object
;
}
keyobject
;
...
...
@@ -471,13 +471,15 @@ keyobject_richcompare(PyObject *ko, PyObject *other, int op)
}
static
PyObject
*
functools_cmp_to_key
(
PyObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
){
PyObject
*
cmp
;
functools_cmp_to_key
(
PyObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
{
PyObject
*
cmp
;
static
char
*
kwargs
[]
=
{
"mycmp"
,
NULL
};
keyobject
*
object
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"O:cmp_to_key"
,
kwargs
,
&
cmp
))
return
NULL
;
keyobject
*
object
=
PyObject_New
(
keyobject
,
&
keyobject_type
);
object
=
PyObject_New
(
keyobject
,
&
keyobject_type
);
if
(
!
object
)
return
NULL
;
Py_INCREF
(
cmp
);
...
...
@@ -572,8 +574,8 @@ PyDoc_STRVAR(module_doc,
static
PyMethodDef
module_methods
[]
=
{
{
"reduce"
,
functools_reduce
,
METH_VARARGS
,
functools_reduce_doc
},
{
"cmp_to_key"
,
functools_cmp_to_key
,
METH_VARARGS
|
METH_KEYWORDS
,
functools_cmp_to_key_doc
},
{
"cmp_to_key"
,
(
PyCFunction
)
functools_cmp_to_key
,
METH_VARARGS
|
METH_KEYWORDS
,
functools_cmp_to_key_doc
},
{
NULL
,
NULL
}
/* sentinel */
};
...
...
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