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
Xavier Thompson
cython
Commits
b2dc5c22
Commit
b2dc5c22
authored
Jun 01, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid using abs with arbitrarily-sized ints.
Here the residue always fits into an int. This fixes #1721.
parent
f8cbb006
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+3
-3
No files found.
Cython/Utility/TypeConversion.c
View file @
b2dc5c22
...
...
@@ -656,21 +656,21 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value, Py_ssize_t wid
int
digit_pos
;
switch
(
format_char
)
{
case
'o'
:
digit_pos
=
abs
(
remaining
%
(
8
*
8
));
digit_pos
=
abs
(
(
int
)(
remaining
%
(
8
*
8
)
));
remaining
=
remaining
/
(
8
*
8
);
dpos
-=
2
;
*
(
uint16_t
*
)
dpos
=
((
uint16_t
*
)
DIGIT_PAIRS_8
)[
digit_pos
];
/* copy 2 digits at a time */
last_one_off
=
(
digit_pos
<
8
);
break
;
case
'd'
:
digit_pos
=
abs
(
remaining
%
(
10
*
10
));
digit_pos
=
abs
(
(
int
)(
remaining
%
(
10
*
10
)
));
remaining
=
remaining
/
(
10
*
10
);
dpos
-=
2
;
*
(
uint16_t
*
)
dpos
=
((
uint16_t
*
)
DIGIT_PAIRS_10
)[
digit_pos
];
/* copy 2 digits at a time */
last_one_off
=
(
digit_pos
<
10
);
break
;
case
'x'
:
*
(
--
dpos
)
=
hex_digits
[
abs
(
remaining
%
16
)];
*
(
--
dpos
)
=
hex_digits
[
abs
(
(
int
)(
remaining
%
16
)
)];
remaining
=
remaining
/
16
;
break
;
default:
...
...
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