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
Boxiang Sun
cython
Commits
e9126671
Commit
e9126671
authored
Nov 21, 2017
by
Jeroen Demeyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix types of values in libc.limits
parent
8cbdb269
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
24 deletions
+29
-24
Cython/Includes/libc/limits.pxd
Cython/Includes/libc/limits.pxd
+19
-20
tests/run/fstring.pyx
tests/run/fstring.pyx
+10
-4
No files found.
Cython/Includes/libc/limits.pxd
View file @
e9126671
# 5.2.4.2.1 Sizes of integer types <limits.h>
cdef
extern
from
"<limits.h>"
:
const
int
CHAR_BIT
const
int
MB_LEN_MAX
enum
:
CHAR_BIT
enum
:
MB_LEN
_MAX
const
char
CHAR_MIN
const
char
CHAR
_MAX
enum
:
CHAR_MIN
enum
:
CHAR_MAX
const
signed
char
SCHAR_MIN
const
signed
char
SCHAR_MAX
const
unsigned
char
UCHAR_MAX
enum
:
SCHAR
_MIN
enum
:
SCHAR
_MAX
enum
:
UCHAR
_MAX
const
short
SHRT
_MIN
const
short
SHRT
_MAX
const
unsigned
short
USHRT
_MAX
enum
:
SHR
T_MIN
enum
:
SHR
T_MAX
enum
:
USHR
T_MAX
const
int
IN
T_MIN
const
int
IN
T_MAX
const
unsigned
int
UIN
T_MAX
enum
:
INT
_MIN
enum
:
INT
_MAX
enum
:
UINT
_MAX
const
long
LONG
_MIN
const
long
LONG
_MAX
const
unsigned
long
ULONG
_MAX
enum
:
LONG_MIN
enum
:
LONG_MAX
enum
:
ULONG_MAX
enum
:
LLONG_MIN
enum
:
LLONG_MAX
enum
:
ULLONG_MAX
const
long
long
LLONG_MIN
const
long
long
LLONG_MAX
const
unsigned
long
long
ULLONG_MAX
tests/run/fstring.pyx
View file @
e9126671
...
...
@@ -10,10 +10,7 @@ cimport cython
import
sys
IS_PYPY
=
hasattr
(
sys
,
'pypy_version_info'
)
cdef
extern
from
*
:
int
INT_MAX
long
LONG_MAX
long
LONG_MIN
from
libc.limits
cimport
INT_MAX
,
LONG_MAX
,
LONG_MIN
max_int
=
INT_MAX
max_long
=
LONG_MAX
...
...
@@ -149,6 +146,15 @@ def format_c_numbers_max(int n, long l):
return
s1
,
s2
def
format_c_number_const
():
"""
>>> s = format_c_number_const()
>>> s == '{0}'.format(max_long) or s
True
"""
return
f"
{
LONG_MAX
}
"
def
format_c_number_range
(
int
n
):
"""
>>> for i in range(-1000, 1000):
...
...
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