]> granicus.if.org Git - python/commitdiff
Silence gcc 'comparison always false' warning
authorMark Dickinson <dickinsm@gmail.com>
Fri, 28 Aug 2009 20:46:24 +0000 (20:46 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Fri, 28 Aug 2009 20:46:24 +0000 (20:46 +0000)
Objects/stringobject.c
Objects/unicodeobject.c

index 316a271a95479c36ded021080f4d859b56fc416f..d78e2a3d155c804671a3fec1a7bfd1d0e26624c9 100644 (file)
@@ -4341,14 +4341,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 0b23e71f3d5c5c1147f0dcaf0cf25960e1453d6d..c4b490295f32e14e7a0f8b5bba0888d9d1996be1 100644 (file)
@@ -8325,14 +8325,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';