summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-08-28 20:57:42 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-08-28 20:57:42 (GMT)
commit75be68bd109d9622a294a382f31744df04c51227 (patch)
treede0b1bbe2a670e7eb38439ef8b7d5e4701b9809d /Objects
parent4bd4e235bd6ae11a2e411fa9f91e1bfeb48aa4b0 (diff)
downloadcpython-75be68bd109d9622a294a382f31744df04c51227.zip
cpython-75be68bd109d9622a294a382f31744df04c51227.tar.gz
cpython-75be68bd109d9622a294a382f31744df04c51227.tar.bz2
Merged revisions 74575 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74575 | mark.dickinson | 2009-08-28 21:46:24 +0100 (Fri, 28 Aug 2009) | 1 line Silence gcc 'comparison always false' warning ........
Diffstat (limited to 'Objects')
-rw-r--r--Objects/stringobject.c4
-rw-r--r--Objects/unicodeobject.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 8916552..2ae397a 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -4336,14 +4336,16 @@ formatfloat(char *buf, size_t buflen, int flags,
}
if (prec < 0)
prec = 6;
+#if SIZEOF_INT > 4
/* make sure that the decimal representation of precision really does
need at most 10 digits: platforms with sizeof(int) == 8 exist! */
- if (prec > 0x7fffffffL) {
+ if (prec > 0x7fffffff) {
PyErr_SetString(PyExc_OverflowError,
"outrageously large precision "
"for formatted float");
return -1;
}
+#endif
if (type == 'f' && fabs(x) >= 1e50)
type = 'g';
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 6911058..e4f27e6 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -8212,14 +8212,16 @@ formatfloat(Py_UNICODE *buf,
return -1;
if (prec < 0)
prec = 6;
+#if SIZEOF_INT > 4
/* make sure that the decimal representation of precision really does
need at most 10 digits: platforms with sizeof(int) == 8 exist! */
- if (prec > 0x7fffffffL) {
+ if (prec > 0x7fffffff) {
PyErr_SetString(PyExc_OverflowError,
"outrageously large precision "
"for formatted float");
return -1;
}
+#endif
if (type == 'f' && fabs(x) >= 1e50)
type = 'g';