makesrna: use int64 for rounding check
authorCampbell Barton <ideasman42@gmail.com>
Fri, 10 Jul 2015 06:42:36 +0000 (16:42 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 10 Jul 2015 06:42:36 +0000 (16:42 +1000)
Harmless but larger values would overflow

source/blender/makesrna/intern/makesrna.c

index dfd0f13ec1aa2dcc3c59d547cc959b751eedd7c7..0f00dd7a5862bb39a00e6b71819465416c4654bb 100644 (file)
@@ -503,7 +503,7 @@ static void rna_float_print(FILE *f, float num)
 {
        if (num == -FLT_MAX) fprintf(f, "-FLT_MAX");
        else if (num == FLT_MAX) fprintf(f, "FLT_MAX");
-       else if ((int)num == num) fprintf(f, "%.1ff", num);
+       else if ((int64_t)num == num) fprintf(f, "%.1ff", num);
        else fprintf(f, "%.10ff", num);
 }