]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Prefer double instead of long double for speed.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 25 Jun 2015 08:48:46 +0000 (09:48 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 25 Jun 2015 08:48:46 +0000 (09:48 +0100)
src/libutil/printf.c

index 14e372f4e3ea0ad627cb9b7d3b5a5e177a5cdeaf..e27bb9cdbc858f56110f855df4758ba2b36142f2 100644 (file)
@@ -332,7 +332,7 @@ rspamd_vprintf_common (rspamd_printf_append_func func,
        gchar zero, numbuf[G_ASCII_DTOSTR_BUF_SIZE], *p, *last, c;
        const gchar *buf_start = fmt;
        gint d;
-       long double f, scale;
+       gdouble f, scale;
        glong written = 0, wr, slen;
        gint64 i64;
        guint64 ui64;
@@ -572,10 +572,10 @@ rspamd_vprintf_common (rspamd_printf_append_func func,
                        case 'f':
                        case 'F':
                                if (*fmt == 'f') {
-                                       f = (long double) va_arg (args, double);
+                                       f = (gdouble) va_arg (args, double);
                                }
                                else {
-                                       f = (long double) va_arg (args, long double);
+                                       f = (gdouble) va_arg (args, long double);
                                }
 
                                if (isnormal (f)) {
@@ -634,10 +634,10 @@ rspamd_vprintf_common (rspamd_printf_append_func func,
                        case 'g':
                        case 'G':
                                if (*fmt == 'g') {
-                                       f = (long double) va_arg (args, double);
+                                       f = (gdouble) va_arg (args, double);
                                }
                                else {
-                                       f = (long double) va_arg (args, long double);
+                                       f = (gdouble) va_arg (args, long double);
                                }
 
                                g_ascii_formatd (numbuf, sizeof (numbuf), "%g", (double)f);