]> granicus.if.org Git - python/commitdiff
Merged revisions 74575 via svnmerge from
authorMark Dickinson <dickinsm@gmail.com>
Fri, 28 Aug 2009 20:57:42 +0000 (20:57 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Fri, 28 Aug 2009 20:57:42 +0000 (20:57 +0000)
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
........

Objects/stringobject.c
Objects/unicodeobject.c

index 8916552d77ed0f62e7eeb2c4117439f6a1252fb5..2ae397a1b95ee41f9935ed7c767856c80d47b82a 100644 (file)
@@ -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';
index 69110583e535183136ef8c945b898e800380a5ae..e4f27e6762c227220c53bb0540362a6bf0db54f2 100644 (file)
@@ -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';