diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-03-22 15:15:42 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-03-22 15:15:42 -0400 |
commit | 2250cd87ebb0ac92b48ce6f7f15991db22bfb112 (patch) | |
tree | 2325ecf970ad94d5ed2e75eacd2fae893e8c9e59 /gtk/gtkpapersize.c | |
parent | ddf7501acd2169f09d773e037b20889dfe89ab2f (diff) | |
download | gtk+-2250cd87ebb0ac92b48ce6f7f15991db22bfb112.tar.gz |
paper size: Don't use abs() on floats
Use fabs() instead. Pointed out by clang.
Diffstat (limited to 'gtk/gtkpapersize.c')
-rw-r--r-- | gtk/gtkpapersize.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk/gtkpapersize.c b/gtk/gtkpapersize.c index c68e4a99aa..a9399a6e9e 100644 --- a/gtk/gtkpapersize.c +++ b/gtk/gtkpapersize.c @@ -24,6 +24,7 @@ #if defined(HAVE__NL_PAPER_HEIGHT) && defined(HAVE__NL_PAPER_WIDTH) #include <langinfo.h> #endif +#include <math.h> #include "gtkpapersize.h" #include "gtkprintutils.h" @@ -442,8 +443,8 @@ gtk_paper_size_new_from_ipp (const gchar *ipp_name, x_dimension = _gtk_print_convert_from_mm (standard_names_offsets[i].width, GTK_UNIT_POINTS); y_dimension = _gtk_print_convert_from_mm (standard_names_offsets[i].height, GTK_UNIT_POINTS); - if (abs (x_dimension - width) <= PAPER_SIZE_TOLERANCE && - abs (y_dimension - height) <= PAPER_SIZE_TOLERANCE) + if (fabs (x_dimension - width) <= PAPER_SIZE_TOLERANCE && + fabs (y_dimension - height) <= PAPER_SIZE_TOLERANCE) { display_name = g_strdup (g_dpgettext2 (GETTEXT_PACKAGE, "paper size", |