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
2fdd58ad
Commit
2fdd58ad
authored
Aug 28, 2009
by
Mark Dickinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence gcc 'comparison always false' warning
parent
f7cda528
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
Objects/stringobject.c
Objects/stringobject.c
+3
-1
Objects/unicodeobject.c
Objects/unicodeobject.c
+3
-1
No files found.
Objects/stringobject.c
View file @
2fdd58ad
...
@@ -4341,14 +4341,16 @@ formatfloat(char *buf, size_t buflen, int flags,
...
@@ -4341,14 +4341,16 @@ formatfloat(char *buf, size_t buflen, int flags,
}
}
if
(
prec
<
0
)
if
(
prec
<
0
)
prec
=
6
;
prec
=
6
;
#if SIZEOF_INT > 4
/* make sure that the decimal representation of precision really does
/* make sure that the decimal representation of precision really does
need at most 10 digits: platforms with sizeof(int) == 8 exist! */
need at most 10 digits: platforms with sizeof(int) == 8 exist! */
if
(
prec
>
0x7fffffff
L
)
{
if
(
prec
>
0x7fffffff
)
{
PyErr_SetString
(
PyExc_OverflowError
,
PyErr_SetString
(
PyExc_OverflowError
,
"outrageously large precision "
"outrageously large precision "
"for formatted float"
);
"for formatted float"
);
return
-
1
;
return
-
1
;
}
}
#endif
if
(
type
==
'f'
&&
fabs
(
x
)
>=
1e50
)
if
(
type
==
'f'
&&
fabs
(
x
)
>=
1e50
)
type
=
'g'
;
type
=
'g'
;
...
...
Objects/unicodeobject.c
View file @
2fdd58ad
...
@@ -8325,14 +8325,16 @@ formatfloat(Py_UNICODE *buf,
...
@@ -8325,14 +8325,16 @@ formatfloat(Py_UNICODE *buf,
return
-
1
;
return
-
1
;
if
(
prec
<
0
)
if
(
prec
<
0
)
prec
=
6
;
prec
=
6
;
#if SIZEOF_INT > 4
/* make sure that the decimal representation of precision really does
/* make sure that the decimal representation of precision really does
need at most 10 digits: platforms with sizeof(int) == 8 exist! */
need at most 10 digits: platforms with sizeof(int) == 8 exist! */
if
(
prec
>
0x7fffffff
L
)
{
if
(
prec
>
0x7fffffff
)
{
PyErr_SetString
(
PyExc_OverflowError
,
PyErr_SetString
(
PyExc_OverflowError
,
"outrageously large precision "
"outrageously large precision "
"for formatted float"
);
"for formatted float"
);
return
-
1
;
return
-
1
;
}
}
#endif
if
(
type
==
'f'
&&
fabs
(
x
)
>=
1e50
)
if
(
type
==
'f'
&&
fabs
(
x
)
>=
1e50
)
type
=
'g'
;
type
=
'g'
;
...
...
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