]> granicus.if.org Git - curl/commitdiff
tool_cb_prg: fix double-promotion warning
authorMarcel Raad <raad@teamviewer.com>
Mon, 1 May 2017 09:46:44 +0000 (11:46 +0200)
committerMarcel Raad <raad@teamviewer.com>
Mon, 1 May 2017 09:46:44 +0000 (11:46 +0200)
clang complains:
tool_cb_prg.c:86:22: error: implicit conversion increases
floating-point precision: 'float' to 'double'
[-Werror,-Wdouble-promotion]

Fix this by using a double instead of a float constant.

src/tool_cb_prg.c

index eae80fe12c07310ea3c862e3fb8d13ff005bf460..d4ecb3cefbec15c937a2aebd4d0b356814e13f49 100644 (file)
@@ -83,7 +83,7 @@ int tool_progress_cb(void *clientp,
   }
   else if(point != bar->prev) {
     frac = (double)point / (double)total;
-    percent = frac * 100.0f;
+    percent = frac * 100.0;
     barwidth = bar->width - 7;
     num = (int) (((double)barwidth) * frac);
     if(num > MAX_BARLENGTH)