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
Gwenaël Samain
cython
Commits
14f7508f
Commit
14f7508f
authored
Apr 06, 2009
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use PY_FORMAT_SIZE_T to format Py_ssize_t values
parent
279e68ea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+1
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
14f7508f
...
@@ -2135,7 +2135,7 @@ class SliceIndexNode(ExprNode):
...
@@ -2135,7 +2135,7 @@ class SliceIndexNode(ExprNode):
check
=
stop
check
=
stop
if
check
:
if
check
:
code
.
putln
(
"if (unlikely((%s) != %d)) {"
%
(
check
,
target_size
))
code
.
putln
(
"if (unlikely((%s) != %d)) {"
%
(
check
,
target_size
))
code
.
putln
(
'PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %%
d, got %%d", %d,
(%s));'
%
(
code
.
putln
(
'PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %%
"PY_FORMAT_SIZE_T"d, got %%"PY_FORMAT_SIZE_T"d", (Py_ssize_t)%d, (Py_ssize_t)
(%s));'
%
(
target_size
,
check
))
target_size
,
check
))
code
.
putln
(
code
.
error_goto
(
self
.
pos
))
code
.
putln
(
code
.
error_goto
(
self
.
pos
))
code
.
putln
(
"}"
)
code
.
putln
(
"}"
)
...
...
Cython/Compiler/ModuleNode.py
View file @
14f7508f
...
@@ -425,6 +425,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -425,6 +425,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
" typedef int Py_ssize_t;"
)
code
.
putln
(
" typedef int Py_ssize_t;"
)
code
.
putln
(
" #define PY_SSIZE_T_MAX INT_MAX"
)
code
.
putln
(
" #define PY_SSIZE_T_MAX INT_MAX"
)
code
.
putln
(
" #define PY_SSIZE_T_MIN INT_MIN"
)
code
.
putln
(
" #define PY_SSIZE_T_MIN INT_MIN"
)
code
.
putln
(
" #define PY_FORMAT_SIZE_T
\
"
\
"
"
)
code
.
putln
(
" #define PyInt_FromSsize_t(z) PyInt_FromLong(z)"
)
code
.
putln
(
" #define PyInt_FromSsize_t(z) PyInt_FromLong(z)"
)
code
.
putln
(
" #define PyInt_AsSsize_t(o) PyInt_AsLong(o)"
)
code
.
putln
(
" #define PyInt_AsSsize_t(o) PyInt_AsLong(o)"
)
code
.
putln
(
" #define PyNumber_Index(o) PyNumber_Int(o)"
)
code
.
putln
(
" #define PyNumber_Index(o) PyNumber_Int(o)"
)
...
...
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