From b3d483a035e0674a1b04f606334e5a51e01426a8 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Wed, 9 Apr 2014 22:35:00 +0300 Subject: [PATCH] core: revert two of the changes in Bllacky's pull request #187. `ndigits` is actually an int, used as a field width specifier in snprintf(). s is an extensively-used pointer. --- sgminer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sgminer.c b/sgminer.c index 62cdfd65..ed74b990 100644 --- a/sgminer.c +++ b/sgminer.c @@ -2181,7 +2181,7 @@ static void suffix_string(uint64_t val, char *buf, size_t bufsiz, int sigdigits) } else { /* Always show sigdigits + 1, padded on right with zeroes * followed by suffix */ - double ndigits = sigdigits - 1 - (dval > 0.0 ? floor(log10(dval)) : 0); + int ndigits = sigdigits - 1 - (dval > 0.0 ? (int)floor(log10(dval)) : 0); snprintf(buf, bufsiz, "%*.*f%s", sigdigits + 1, ndigits, dval, suffix); } @@ -2687,7 +2687,7 @@ static bool submit_upstream_work(struct work *work, CURL *curl, bool resubmit) { char *hexstr = NULL; json_t *val, *res, *err; -// char *s; + char *s; bool rc = false; int thr_id = work->thr_id; struct cgpu_info *cgpu;