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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
c92189e7
Commit
c92189e7
authored
May 23, 2011
by
Mark Florisson
Committed by
Dag Sverre Seljebotn
May 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove platform-specific NaN initialization
parent
a002ad59
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
38 deletions
+18
-38
Cython/Compiler/Naming.py
Cython/Compiler/Naming.py
+0
-3
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+13
-30
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+5
-5
No files found.
Cython/Compiler/Naming.py
View file @
c92189e7
...
@@ -117,9 +117,6 @@ api_guard_prefix = "__PYX_HAVE_API__"
...
@@ -117,9 +117,6 @@ api_guard_prefix = "__PYX_HAVE_API__"
api_func_guard
=
"__PYX_HAVE_API_FUNC_"
api_func_guard
=
"__PYX_HAVE_API_FUNC_"
PYX_NAN
=
"__PYX_NAN"
PYX_NAN
=
"__PYX_NAN"
HUGE_VAL
=
"Py_HUGE_VAL"
LONG_LONG_MAX
=
"__PYX_LONG_LONG_MAX"
ULONG_LONG_MAX
=
"__PYX_ULONG_LONG_MAX"
def
py_version_hex
(
major
,
minor
=
0
,
micro
=
0
,
release_level
=
0
,
release_serial
=
0
):
def
py_version_hex
(
major
,
minor
=
0
,
micro
=
0
,
release_level
=
0
,
release_serial
=
0
):
return
(
major
<<
24
)
|
(
minor
<<
16
)
|
(
micro
<<
8
)
|
(
release_level
<<
4
)
|
(
release_serial
)
return
(
major
<<
24
)
|
(
minor
<<
16
)
|
(
micro
<<
8
)
|
(
release_level
<<
4
)
|
(
release_serial
)
Cython/Compiler/Nodes.py
View file @
c92189e7
...
@@ -7592,36 +7592,19 @@ bad:
...
@@ -7592,36 +7592,19 @@ bad:
################ Utility code for cython.parallel stuff ################
################ Utility code for cython.parallel stuff ################
invalid_values_utility_code
=
UtilityCode
(
proto
=
"""
invalid_values_utility_code
=
UtilityCode
(
#ifdef HAVE_LONG_LONG
proto
=
"""
\
#define %(LONG_LONG_MAX)s PY_LLONG_MAX
#include <string.h>
#define %(ULONG_LONG_MAX)s PY_ULLONG_MAX
#else
#define PY_LONG_LONG LONG_LONG
#if defined(LLONG_MAX)
void __pyx_init_nan(void);
#define %(LONG_LONG_MAX)s LLONG_MAX
#define %(ULONG_LONG_MAX)s ULLONG_MAX
#else
#define %(LONG_LONG_MAX)s LONG_MAX
#define %(ULONG_LONG_MAX)s ULONG_MAX
#endif
#endif
/* Define NAN */
static float %(PYX_NAN)s;
#ifdef Py_NAN
"""
%
vars
(
Naming
),
#define %(PYX_NAN)s Py_NAN
#elif defined(NAN)
init
=
"""
#define %(PYX_NAN)s NAN
/* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
#elif defined(HUGE_VALL)
a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
#define %(PYX_NAN)s HUGE_VALL
a signalling NaN. */
#elif defined(__STDC__) && __STDC_VERSION__ >= 199901L
memset(&%(PYX_NAN)s, 0xFF, sizeof(%(PYX_NAN)s));
/* C99 or greater */
#include <float.h>
#define %(PYX_NAN)s LDBL_MAX
#else
static PY_LONG_LONG __pyx__nan = %(LONG_LONG_MAX)s;
#define %(PYX_NAN)s (*(double*) &__pyx__nan)
#endif
"""
%
vars
(
Naming
))
"""
%
vars
(
Naming
))
Cython/Compiler/PyrexTypes.py
View file @
c92189e7
...
@@ -2370,11 +2370,11 @@ rank_to_type_name = (
...
@@ -2370,11 +2370,11 @@ rank_to_type_name = (
)
)
typename_to_maxval
=
{
typename_to_maxval
=
{
"char"
:
(
"
CHAR_MAX"
,
"UCHAR_MAX
"
),
"char"
:
(
"
'?'"
,
"'?'
"
),
"short"
:
(
"
SHRT_MAX"
,
"USHRT_MAX
"
),
"short"
:
(
"
0xbad"
,
"0xbad0
"
),
"int"
:
(
"
INT_MAX"
,
"UINT_MAX
"
),
"int"
:
(
"
0xbad"
,
"0xbad0
"
),
"long"
:
(
"
LONG_MAX"
,
"ULONG_MAX
"
),
"long"
:
(
"
0xbad0bad"
,
"0xbad0bad0
"
),
"PY_LONG_LONG"
:
(
Naming
.
LONG_LONG_MAX
,
Naming
.
ULONG_LONG_MAX
),
"PY_LONG_LONG"
:
(
"0xbad0bad0bad0bad"
,
"0xbad0bad0bad0bad0"
),
# CFloatType overrides invalid_value
# CFloatType overrides invalid_value
}
}
...
...
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