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
c48c8db1
Commit
c48c8db1
authored
Apr 05, 2006
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PY_SSIZE_T_MIN, as suggested by Ralf W. Grosse-Kunstleve.
parent
726dcf34
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
Include/pyport.h
Include/pyport.h
+2
-0
Objects/longobject.c
Objects/longobject.c
+1
-1
No files found.
Include/pyport.h
View file @
c48c8db1
...
...
@@ -99,6 +99,8 @@ typedef Py_intptr_t Py_ssize_t;
/* Largest positive value of type Py_ssize_t. */
#define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1))
/* Smallest positive value of type Py_ssize_t. */
#define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1)
/* PY_FORMAT_SIZE_T is a platform-specific modifier for use in a printf
* format to convert an argument with the width of a size_t or Py_ssize_t.
...
...
Objects/longobject.c
View file @
c48c8db1
...
...
@@ -281,7 +281,7 @@ _long_as_ssize_t(PyObject *vv) {
if
(
sign
>
0
)
return
PY_SSIZE_T_MAX
;
else
return
-
PY_SSIZE_T_MAX
-
1
;
return
PY_SSIZE_T_MIN
;
}
/* Get a Py_ssize_t from a long int object.
...
...
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