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
Hide 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__"
api_func_guard
=
"__PYX_HAVE_API_FUNC_"
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
):
return
(
major
<<
24
)
|
(
minor
<<
16
)
|
(
micro
<<
8
)
|
(
release_level
<<
4
)
|
(
release_serial
)
Cython/Compiler/Nodes.py
View file @
c92189e7
...
...
@@ -7592,36 +7592,19 @@ bad:
################ Utility code for cython.parallel stuff ################
invalid_values_utility_code
=
UtilityCode
(
proto
=
"""
#ifdef HAVE_LONG_LONG
#define %(LONG_LONG_MAX)s PY_LLONG_MAX
#define %(ULONG_LONG_MAX)s PY_ULLONG_MAX
#else
#define PY_LONG_LONG LONG_LONG
invalid_values_utility_code
=
UtilityCode
(
proto
=
"""
\
#include <string.h>
#if defined(LLONG_MAX)
#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
void __pyx_init_nan(void);
/* Define NAN */
#ifdef Py_NAN
#define %(PYX_NAN)s Py_NAN
#elif defined(NAN)
#define %(PYX_NAN)s NAN
#elif defined(HUGE_VALL)
#define %(PYX_NAN)s HUGE_VALL
#elif defined(__STDC__) && __STDC_VERSION__ >= 199901L
/* 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
))
static float %(PYX_NAN)s;
"""
%
vars
(
Naming
),
init
=
"""
/* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
a signalling NaN. */
memset(&%(PYX_NAN)s, 0xFF, sizeof(%(PYX_NAN)s));
"""
%
vars
(
Naming
))
Cython/Compiler/PyrexTypes.py
View file @
c92189e7
...
...
@@ -2370,11 +2370,11 @@ rank_to_type_name = (
)
typename_to_maxval
=
{
"char"
:
(
"
CHAR_MAX"
,
"UCHAR_MAX
"
),
"short"
:
(
"
SHRT_MAX"
,
"USHRT_MAX
"
),
"int"
:
(
"
INT_MAX"
,
"UINT_MAX
"
),
"long"
:
(
"
LONG_MAX"
,
"ULONG_MAX
"
),
"PY_LONG_LONG"
:
(
Naming
.
LONG_LONG_MAX
,
Naming
.
ULONG_LONG_MAX
),
"char"
:
(
"
'?'"
,
"'?'
"
),
"short"
:
(
"
0xbad"
,
"0xbad0
"
),
"int"
:
(
"
0xbad"
,
"0xbad0
"
),
"long"
:
(
"
0xbad0bad"
,
"0xbad0bad0
"
),
"PY_LONG_LONG"
:
(
"0xbad0bad0bad0bad"
,
"0xbad0bad0bad0bad0"
),
# 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