From 1709b65a72700fbd42aebddefc1b3dc94eed5662 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 5 Jul 2013 20:26:32 +0200 Subject: dither: don't use long double This fixes compilation with broken libcs, like on Cygwin. C99 absolutely requires long double and associated functions like expl, even if long double is double. But newlib (used by cygwin) omits declaration for these if long double is equivalent to double. The extra precision is not needed here, so remove it to make life easier for the single person using mpv with cygwin. --- video/out/dither.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video/out/dither.c b/video/out/dither.c index 1919010e74..ac3e9f41d6 100644 --- a/video/out/dither.c +++ b/video/out/dither.c @@ -79,14 +79,14 @@ static void makegauss(struct ctx *k, unsigned int sizeb) for (index_t c = 0; c < k->size2; c++) k->gauss[c] = 0; - long double sigma = -logl(1.5 / UINT64_MAX * gauss_size2) / k->gauss_radius; + double sigma = -log(1.5 / UINT64_MAX * gauss_size2) / k->gauss_radius; for (index_t gy = 0; gy <= k->gauss_radius; gy++) { for (index_t gx = 0; gx <= gy; gx++) { int cx = (int)gx - k->gauss_radius; int cy = (int)gy - k->gauss_radius; int sq = cx * cx + cy * cy; - long double e = expl(-sqrtl(sq) * sigma); + double e = exp(-sqrt(sq) * sigma); uint64_t v = e / gauss_size2 * UINT64_MAX; k->gauss[XY(k, gx, gy)] = k->gauss[XY(k, gy, gx)] = -- cgit v1.2.3