Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
00d3bbf2
Commit
00d3bbf2
authored
May 26, 2018
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt some non-const C-API declarations that were already constified in Py2.5.
parent
327267f2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
16 deletions
+16
-16
Cython/Includes/cpython/dict.pxd
Cython/Includes/cpython/dict.pxd
+3
-3
Cython/Includes/cpython/module.pxd
Cython/Includes/cpython/module.pxd
+7
-7
Cython/Includes/cpython/object.pxd
Cython/Includes/cpython/object.pxd
+4
-4
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+2
-2
No files found.
Cython/Includes/cpython/dict.pxd
View file @
00d3bbf2
...
...
@@ -52,7 +52,7 @@ cdef extern from "Python.h":
# be hashable; if it isn't, TypeError will be raised. Return 0 on
# success or -1 on failure.
int
PyDict_SetItemString
(
object
p
,
char
*
key
,
object
val
)
except
-
1
int
PyDict_SetItemString
(
object
p
,
c
onst
c
har
*
key
,
object
val
)
except
-
1
# Insert value into the dictionary p using key as a key. key
# should be a char*. The key object is created using
# PyString_FromString(key). Return 0 on success or -1 on failure.
...
...
@@ -62,7 +62,7 @@ cdef extern from "Python.h":
# hashable; if it isn't, TypeError is raised. Return 0 on success
# or -1 on failure.
int
PyDict_DelItemString
(
object
p
,
char
*
key
)
except
-
1
int
PyDict_DelItemString
(
object
p
,
c
onst
c
har
*
key
)
except
-
1
# Remove the entry in dictionary p which has a key specified by
# the string key. Return 0 on success or -1 on failure.
...
...
@@ -72,7 +72,7 @@ cdef extern from "Python.h":
# NULL if the key key is not present, but without setting an
# exception.
PyObject
*
PyDict_GetItemString
(
object
p
,
char
*
key
)
PyObject
*
PyDict_GetItemString
(
object
p
,
c
onst
c
har
*
key
)
# Return value: Borrowed reference.
# This is the same as PyDict_GetItem(), but key is specified as a
# char*, rather than a PyObject*.
...
...
Cython/Includes/cpython/module.pxd
View file @
00d3bbf2
...
...
@@ -6,7 +6,7 @@ cdef extern from "Python.h":
#####################################################################
# 5.3 Importing Modules
#####################################################################
object
PyImport_ImportModule
(
char
*
name
)
object
PyImport_ImportModule
(
c
onst
c
har
*
name
)
# Return value: New reference.
# This is a simplified interface to PyImport_ImportModuleEx()
# below, leaving the globals and locals arguments set to
...
...
@@ -20,7 +20,7 @@ cdef extern from "Python.h":
# loaded.) Return a new reference to the imported module, or NULL
# with an exception set on failure.
object
PyImport_ImportModuleEx
(
char
*
name
,
object
globals
,
object
locals
,
object
fromlist
)
object
PyImport_ImportModuleEx
(
c
onst
c
har
*
name
,
object
globals
,
object
locals
,
object
fromlist
)
# Return value: New reference.
# Import a module. This is best described by referring to the
...
...
@@ -64,7 +64,7 @@ cdef extern from "Python.h":
# the reloaded module, or NULL with an exception set on failure
# (the module still exists in this case).
PyObject
*
PyImport_AddModule
(
char
*
name
)
except
NULL
PyObject
*
PyImport_AddModule
(
c
onst
c
har
*
name
)
except
NULL
# Return value: Borrowed reference.
# Return the module object corresponding to a module name. The
# name argument may be of the form package.module. First check the
...
...
@@ -145,7 +145,7 @@ cdef extern from "Python.h":
bint
PyModule_CheckExact
(
object
p
)
# Return true if p is a module object, but not a subtype of PyModule_Type.
object
PyModule_New
(
char
*
name
)
object
PyModule_New
(
c
onst
c
har
*
name
)
# Return value: New reference.
# Return a new module object with the __name__ attribute set to
# name. Only the module's __doc__ and __name__ attributes are
...
...
@@ -170,18 +170,18 @@ cdef extern from "Python.h":
# module's __file__ attribute. If this is not defined, or if it is
# not a string, raise SystemError and return NULL.
int
PyModule_AddObject
(
object
module
,
char
*
name
,
object
value
)
except
-
1
int
PyModule_AddObject
(
object
module
,
c
onst
c
har
*
name
,
object
value
)
except
-
1
# Add an object to module as name. This is a convenience function
# which can be used from the module's initialization
# function. This steals a reference to value. Return -1 on error,
# 0 on success.
int
PyModule_AddIntConstant
(
object
module
,
char
*
name
,
long
value
)
except
-
1
int
PyModule_AddIntConstant
(
object
module
,
c
onst
c
har
*
name
,
long
value
)
except
-
1
# Add an integer constant to module as name. This convenience
# function can be used from the module's initialization
# function. Return -1 on error, 0 on success.
int
PyModule_AddStringConstant
(
object
module
,
c
har
*
name
,
char
*
value
)
except
-
1
int
PyModule_AddStringConstant
(
object
module
,
c
onst
char
*
name
,
const
char
*
value
)
except
-
1
# Add a string constant to module as name. This convenience
# function can be used from the module's initialization
# function. The string value must be null-terminated. Return -1 on
...
...
Cython/Includes/cpython/object.pxd
View file @
00d3bbf2
...
...
@@ -82,12 +82,12 @@ cdef extern from "Python.h":
# option currently supported is Py_PRINT_RAW; if given, the str()
# of the object is written instead of the repr().
bint
PyObject_HasAttrString
(
object
o
,
char
*
attr_name
)
bint
PyObject_HasAttrString
(
object
o
,
c
onst
c
har
*
attr_name
)
# Returns 1 if o has the attribute attr_name, and 0
# otherwise. This is equivalent to the Python expression
# "hasattr(o, attr_name)". This function always succeeds.
object
PyObject_GetAttrString
(
object
o
,
char
*
attr_name
)
object
PyObject_GetAttrString
(
object
o
,
c
onst
c
har
*
attr_name
)
# Return value: New reference. Retrieve an attribute named
# attr_name from object o. Returns the attribute value on success,
# or NULL on failure. This is the equivalent of the Python
...
...
@@ -106,7 +106,7 @@ cdef extern from "Python.h":
object
PyObject_GenericGetAttr
(
object
o
,
object
attr_name
)
int
PyObject_SetAttrString
(
object
o
,
char
*
attr_name
,
object
v
)
except
-
1
int
PyObject_SetAttrString
(
object
o
,
c
onst
c
har
*
attr_name
,
object
v
)
except
-
1
# Set the value of the attribute named attr_name, for object o, to
# the value v. Returns -1 on failure. This is the equivalent of
# the Python statement "o.attr_name = v".
...
...
@@ -118,7 +118,7 @@ cdef extern from "Python.h":
int
PyObject_GenericSetAttr
(
object
o
,
object
attr_name
,
object
v
)
except
-
1
int
PyObject_DelAttrString
(
object
o
,
char
*
attr_name
)
except
-
1
int
PyObject_DelAttrString
(
object
o
,
c
onst
c
har
*
attr_name
)
except
-
1
# Delete attribute named attr_name, for object o. Returns -1 on
# failure. This is the equivalent of the Python statement: "del
# o.attr_name".
...
...
Cython/Utility/ModuleSetupCode.c
View file @
00d3bbf2
...
...
@@ -1138,9 +1138,9 @@ static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
static
__Pyx_RefNannyAPIStruct
*
__Pyx_RefNannyImportAPI
(
const
char
*
modname
)
{
PyObject
*
m
=
NULL
,
*
p
=
NULL
;
void
*
r
=
NULL
;
m
=
PyImport_ImportModule
(
(
char
*
)
modname
);
m
=
PyImport_ImportModule
(
modname
);
if
(
!
m
)
goto
end
;
p
=
PyObject_GetAttrString
(
m
,
(
char
*
)
"RefNannyAPI"
);
p
=
PyObject_GetAttrString
(
m
,
"RefNannyAPI"
);
if
(
!
p
)
goto
end
;
r
=
PyLong_AsVoidPtr
(
p
);
end:
...
...
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