Cleanup: quiet harmless but annoying overflow
authorCampbell Barton <ideasman42@gmail.com>
Tue, 11 Apr 2017 01:48:00 +0000 (11:48 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 11 Apr 2017 01:49:21 +0000 (11:49 +1000)
Caused asan to print warnings generating RNA

source/blender/makesrna/intern/makesrna.c

index 4552c7730975c70d12dc9be84fcc40cb68caf303..9d68c05dda04c086e99c5e2222f0c40faa3f26f6 100644 (file)
@@ -507,7 +507,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 ((int64_t)num == num) fprintf(f, "%.1ff", num);
+       else if ((ABS(num) < INT64_MAX) && ((int64_t)num == num)) fprintf(f, "%.1ff", num);
        else fprintf(f, "%.10ff", num);
 }