]> granicus.if.org Git - python/commitdiff
Apparently some compiler gives a warning on
authorMichael W. Hudson <mwh@python.net>
Thu, 30 Jun 2005 00:02:26 +0000 (00:02 +0000)
committerMichael W. Hudson <mwh@python.net>
Thu, 30 Jun 2005 00:02:26 +0000 (00:02 +0000)
float y = x;

when x is a double.  Go figure.

Objects/floatobject.c

index c95b5c9edbf3bb25ff3057439686171c07d8f7d0..d02e053c8d42b5817bf63939df2c52e37d43a194 100644 (file)
@@ -1427,7 +1427,7 @@ _PyFloat_Pack4(double x, unsigned char *p, int le)
                return -1;
        }
        else {
-               float y = x;
+               float y = (float)x;
                const char *s = (char*)&y;
                int i, incr = 1;