From 1e5f3997e2928024509a271dab38a029950e1d66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Sat, 26 Feb 2022 03:02:38 +0100 Subject: [PATCH] avoid some avoidable implicit promotion to double --- babl/base/babl-trc.c | 24 +++++++++---------- babl/base/pow-24.h | 7 +++--- babl/base/util.h | 2 +- extensions/cairo.c | 37 +++++++++++++++-------------- extensions/fast-float.c | 48 +++++++++++++++++++------------------- extensions/float.c | 4 ++-- extensions/gegl-fixups.c | 8 +++---- extensions/gggl-lies.c | 22 +++++++++--------- extensions/gggl.c | 50 ++++++++++++++++++++-------------------- extensions/gimp-8bit.c | 14 +++++------ extensions/grey.c | 2 +- 11 files changed, 109 insertions(+), 109 deletions(-) diff --git a/babl/base/babl-trc.c b/babl/base/babl-trc.c index 2299b09..09beb07 100644 --- a/babl/base/babl-trc.c +++ b/babl/base/babl-trc.c @@ -52,13 +52,13 @@ babl_trc_lut_from_linear (const Babl *trc_, if (entry >= trc->lut_size -1) { entry = trc->lut_size - 1; - diff = 0.0; + diff = 0.0f; } else if (entry < 0) entry = 0; - if (diff > 0.0) + if (diff > 0.0f) { - ret = trc->inv_lut[entry] * (1.0 - diff) + trc->inv_lut[entry+1] * diff; + ret = trc->inv_lut[entry] * (1.0f - diff) + trc->inv_lut[entry+1] * diff; } else { @@ -81,9 +81,9 @@ babl_trc_lut_to_linear (const Babl *trc_, if (entry >= trc->lut_size) entry = trc->lut_size - 1; else if (entry < 0) entry = 0; - if (diff > 0.0 && entry < trc->lut_size - 1) + if (diff > 0.0f && entry < trc->lut_size - 1) { - ret = trc->lut[entry] * (1.0 - diff) + trc->lut[entry+1] * diff; + ret = trc->lut[entry] * (1.0f - diff) + trc->lut[entry+1] * diff; } else { @@ -189,13 +189,13 @@ _babl_trc_formula_srgb_from_linear (const Babl *trc_, { float v = _babl_trc_gamma_from_linear ((Babl *) trc, x - f); v = (v-b)/a; - if (v < 0.0 || v >= 0.0) + if (v < 0.0f || v >= 0.0f) return v; - return 0.0; + return 0.0f; } - if (c > 0.0) + if (c > 0.0f) return (x - e) / c; - return 0.0; + return 0.0f; } static inline float @@ -231,10 +231,10 @@ _babl_trc_formula_cie_from_linear (const Babl *trc_, { float v = _babl_trc_gamma_from_linear ((Babl *) trc, x - c); v = (v-b)/a; - if (v < 0.0 || v >= 0.0) + if (v < 0.0f || v >= 0.0f) return v; } - return 0.0; + return 0.0f; } static inline float @@ -479,7 +479,7 @@ BABL_SIMD_SUFFIX (babl_trc_new) (const char *name, for (k = 0; k < 16; k++) { double guess = (min + max) / 2; - float reversed_index = babl_trc_lut_to_linear (BABL(&trc_db[i]), guess) * (n_lut-1.0); + float reversed_index = babl_trc_lut_to_linear (BABL(&trc_db[i]), guess) * (n_lut-1.0f); if (reversed_index < j) { diff --git a/babl/base/pow-24.h b/babl/base/pow-24.h index ecd1282..98e2374 100644 --- a/babl/base/pow-24.h +++ b/babl/base/pow-24.h @@ -98,7 +98,7 @@ static inline float babl_frexpf(float x, int *e) if (!ee) { if (x) { - x = babl_frexpf(x*18446744073709551616.0, e); + x = babl_frexpf(x*18446744073709551616.0f, e); *e -= 64; } else *e = 0; return x; @@ -130,11 +130,12 @@ static inline float babl_frexpf(float x, int *e) static inline float init_newtonf (float x, float exponent, float c0, float c1, float c2) { +#define fM_LN2 0.69314718055994530942f int iexp = 0; float y = babl_frexpf(x, &iexp); y = 2*y+(iexp-2); - c1 *= M_LN2*exponent; - c2 *= M_LN2*M_LN2*exponent*exponent; + c1 *= fM_LN2*exponent; + c2 *= fM_LN2*fM_LN2*exponent*exponent; return y = c0 + c1*y + c2*y*y; } diff --git a/babl/base/util.h b/babl/base/util.h index 9f46211..0d50363 100644 --- a/babl/base/util.h +++ b/babl/base/util.h @@ -59,7 +59,7 @@ static inline float babl_epsilon_for_zero_float (float value) { return value * (value > BABL_ALPHA_FLOOR_F || value < -BABL_ALPHA_FLOOR_F) + - BABL_ALPHA_FLOOR * (value <= BABL_ALPHA_FLOOR_F && + BABL_ALPHA_FLOOR_F * (value <= BABL_ALPHA_FLOOR_F && value >= -BABL_ALPHA_FLOOR_F); } diff --git a/extensions/cairo.c b/extensions/cairo.c index 1b905d0..a22eecd 100644 --- a/extensions/cairo.c +++ b/extensions/cairo.c @@ -143,10 +143,10 @@ conv_cairo32_rgba8_le (const Babl *conversion, } else { - float falpha = alpha / 255.0; - *dst++ = red / falpha + 0.5; - *dst++ = green / falpha + 0.5; - *dst++ = blue / falpha + 0.5; + float falpha = alpha / 255.0f; + *dst++ = red / falpha + 0.5f; + *dst++ = green / falpha + 0.5f; + *dst++ = blue / falpha + 0.5f; *dst++ = alpha; } } @@ -243,9 +243,9 @@ extensions/x86-64-v3-cairo.so 0: cairo-ARGB32 to cairo-RGB24 error:0.002999 cos int alpha = src[3]; if (alpha) { - float falpha = (alpha/255.0); + float falpha = (alpha/255.0f); for (int c = 0; c < 3; c++) - *dst++ = (*src++)/falpha + .5; + *dst++ = (*src++)/falpha + .5f; } else { @@ -447,17 +447,17 @@ conv_rgbafloat_cairo32_le (const Babl *conversion, float green = *fsrc++; float blue = *fsrc++; float alpha = *fsrc++; - if (alpha >= 1.0) + if (alpha >= 1.0f) { - int val = babl_trc_from_linear (trc[2], blue) * 0xff + .0; + int val = babl_trc_from_linear (trc[2], blue) * 0xff; *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; - val = babl_trc_from_linear (trc[1], green) * 0xff + .0; + val = babl_trc_from_linear (trc[1], green) * 0xff; *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; - val = babl_trc_from_linear (trc[0], red) * 0xff + .0; + val = babl_trc_from_linear (trc[0], red) * 0xff; *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; *cdst++ = 0xff; } - else if (alpha <= 0.0) + else if (alpha <= 0.0f) { (*(uint32_t*)cdst)=0; cdst+=4; @@ -465,13 +465,12 @@ conv_rgbafloat_cairo32_le (const Babl *conversion, else { float balpha = alpha * 0xff; - int val = babl_trc_from_linear (trc[2], blue) * balpha + 0.0; + int val = babl_trc_from_linear (trc[2], blue) * balpha; *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; - val = babl_trc_from_linear (trc[1], green) * balpha + 0.0; + val = babl_trc_from_linear (trc[1], green) * balpha; *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; - val = babl_trc_from_linear (trc[0], red) * balpha + 0.0; + val = babl_trc_from_linear (trc[0], red) * balpha; *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; - balpha+=0.0; if (balpha > 255)balpha=255; *cdst++ = balpha; } @@ -495,7 +494,7 @@ conv_yafloat_cairo32_le (const Babl *conversion, { float gray = *fsrc++; float alpha = *fsrc++; - if (alpha >= 1.0) + if (alpha >= 1.0f) { int val = babl_trc_from_linear (trc[0], gray) * 0xff; val = val >= 0xff ? 0xff : val <= 0 ? 0 : val; @@ -504,7 +503,7 @@ conv_yafloat_cairo32_le (const Babl *conversion, *cdst++ = val; *cdst++ = 0xff; } - else if (alpha <= 0.0) + else if (alpha <= 0.0f) { (*(uint32_t*)cdst)=0; cdst+=4; @@ -537,7 +536,7 @@ conv_yafloat_nl_cairo32_le (const Babl *conversion, { float gray = *fsrc++; float alpha = *fsrc++; - if (alpha >= 1.0) + if (alpha >= 1.0f) { int val = gray * 0xff; val = val >= 0xff ? 0xff : val <= 0 ? 0 : val; @@ -546,7 +545,7 @@ conv_yafloat_nl_cairo32_le (const Babl *conversion, *cdst++ = val; *cdst++ = 0xff; } - else if (alpha <= 0.0) + else if (alpha <= 0.0f) { (*(uint32_t*)cdst)=0; cdst+=4; diff --git a/extensions/fast-float.c b/extensions/fast-float.c index 451e20d..659d60f 100644 --- a/extensions/fast-float.c +++ b/extensions/fast-float.c @@ -146,15 +146,15 @@ babl_lookup_new (BablLookupFunction function, end = u.f; } - if (precision <= 0.000005) shift = 0; /* checked for later */ - else if (precision <= 0.000010) shift = 8; - else if (precision <= 0.000020) shift = 9; - else if (precision <= 0.000040) shift = 10; - else if (precision <= 0.000081) shift = 11; - else if (precision <= 0.000161) shift = 12; - else if (precision <= 0.000200) shift = 13; - else if (precision <= 0.000324) shift = 14; - else if (precision <= 0.000649) shift = 15; + if (precision <= 0.000005f) shift = 0; /* checked for later */ + else if (precision <= 0.000010f) shift = 8; + else if (precision <= 0.000020f) shift = 9; + else if (precision <= 0.000040f) shift = 10; + else if (precision <= 0.000081f) shift = 11; + else if (precision <= 0.000161f) shift = 12; + else if (precision <= 0.000200f) shift = 13; + else if (precision <= 0.000324f) shift = 14; + else if (precision <= 0.000649f) shift = 15; else shift = 16; /* a bit better than 8bit sRGB quality */ @@ -162,16 +162,16 @@ babl_lookup_new (BablLookupFunction function, * causes lookups very close to zero to be passed directly to the * function instead. */ - if (start == 0.0) + if (start == 0.0f) start = precision; - if (end == 0.0) + if (end == 0.0f) end = -precision; /* Compute start and */ - if (start < 0.0 || end < 0.0) + if (start < 0.0f || end < 0.0f) { - if (end < 0.0) + if (end < 0.0f) { u.f = start; positive_max = (u.i << LSHIFT) >> shift; @@ -301,7 +301,7 @@ conv_rgbaF_linear_rgbAF_gamma (const Babl *conversion, float green = *fsrc++; float blue = *fsrc++; float alpha = *fsrc++; - if (alpha == 1.0) + if (alpha == 1.0f) { *fdst++ = linear_to_gamma_2_2_lut (red); *fdst++ = linear_to_gamma_2_2_lut (green); @@ -352,7 +352,7 @@ conv_rgbaF_linear_rgba8_gamma (const Babl *conversion, *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; val = linear_to_gamma_2_2_lut (blue) * 0xff + 0.5f; *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; - val = alpha * 0xff + 0.5; + val = alpha * 0xff + 0.5f; *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; } } @@ -374,7 +374,7 @@ conv_rgbaF_linear_rgbA8_gamma (const Babl *conversion, float green = *fsrc++; float blue = *fsrc++; float alpha = *fsrc++; - if (alpha >= 1.0) + if (alpha >= 1.0f) { int val = linear_to_gamma_2_2_lut (red) * 0xff + 0.5f; *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; @@ -411,7 +411,7 @@ conv_yaF_linear_rgbA8_gamma (const Babl *conversion,unsigned char *src, { float gray = *fsrc++; float alpha = *fsrc++; - if (alpha >= 1.0) + if (alpha >= 1.0f) { int val = linear_to_gamma_2_2_lut (gray) * 0xff + 0.5f; *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; @@ -419,7 +419,7 @@ conv_yaF_linear_rgbA8_gamma (const Babl *conversion,unsigned char *src, *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; *cdst++ = 0xff; } - else if (alpha <= 0.0) + else if (alpha <= 0.0f) { *((uint32_t*)(cdst))=0; cdst+=4; @@ -453,7 +453,7 @@ conv_rgbaF_linear_rgbA8_gamma_cairo (const Babl *conversion,unsigned char *src, float green = *fsrc++; float blue = *fsrc++; float alpha = *fsrc++; - if (alpha >= 1.0) + if (alpha >= 1.0f) { int val = linear_to_gamma_2_2_lut (blue) * 0xff + 0.5f; *cdst++ = val >= 0xff ? 0xff : val <= 0 ? 0 : val; @@ -494,7 +494,7 @@ conv_rgbAF_linear_rgbAF_gamma (const Babl *conversion, float blue = *fsrc++; float alpha = *fsrc++; - if (alpha == 1.0) + if (alpha == 1.0f) { *fdst++ = linear_to_gamma_2_2_lut (red); *fdst++ = linear_to_gamma_2_2_lut (green); @@ -503,7 +503,7 @@ conv_rgbAF_linear_rgbAF_gamma (const Babl *conversion, } else { - float alpha_recip = 1.0 / alpha; + float alpha_recip = 1.0f / alpha; *fdst++ = linear_to_gamma_2_2_lut (red * alpha_recip) * alpha; *fdst++ = linear_to_gamma_2_2_lut (green * alpha_recip) * alpha; *fdst++ = linear_to_gamma_2_2_lut (blue * alpha_recip) * alpha; @@ -677,10 +677,10 @@ init (void) float a; /* tweaking the precision - does impact speed.. */ - fast_pow = babl_lookup_new (core_lookup, NULL, 0.0, 1.0, 0.000199); - fast_rpow = babl_lookup_new (core_rlookup, NULL, 0.0, 1.0, 0.000250); + fast_pow = babl_lookup_new (core_lookup, NULL, 0.0f, 1.0f, 0.000199f); + fast_rpow = babl_lookup_new (core_rlookup, NULL, 0.0f, 1.0f, 0.000250f); - for (f = 0.0; f < 1.0; f+= 0.0000001) + for (f = 0.0; f < 1.0f; f+= 0.0000001f) { a = linear_to_gamma_2_2_lut (f); a = gamma_2_2_to_linear_lut (f); diff --git a/extensions/float.c b/extensions/float.c index 74b5a8a..cbe042c 100644 --- a/extensions/float.c +++ b/extensions/float.c @@ -168,7 +168,7 @@ conv_rgbAF_linear_rgbAF_nonlinear (const Babl *conversion, } else { - float alpha_recip = 1.0 / alpha; + float alpha_recip = 1.0f / alpha; *fdst++ = babl_trc_from_linear (trc[0], *fsrc++ * alpha_recip) * alpha; *fdst++ = babl_trc_from_linear (trc[1], *fsrc++ * alpha_recip) * alpha; *fdst++ = babl_trc_from_linear (trc[2], *fsrc++ * alpha_recip) * alpha; @@ -204,7 +204,7 @@ conv_yAF_linear_yAF_nonlinear (const Babl *conversion, } else { - float alpha_recip = 1.0 / alpha; + float alpha_recip = 1.0f / alpha; *fdst++ = babl_trc_from_linear (trc[0], *fsrc++ * alpha_recip) * alpha; *fdst++ = *fsrc++; } diff --git a/extensions/gegl-fixups.c b/extensions/gegl-fixups.c index 881b785..613a405 100644 --- a/extensions/gegl-fixups.c +++ b/extensions/gegl-fixups.c @@ -82,7 +82,7 @@ table_init (void) float f; uint32_t s; } u; - u.f = 0.0; + u.f = 0.0f; //u.s[0] = 0; @@ -91,15 +91,15 @@ table_init (void) int c; int cg; - if (u.f <= 0.0) + if (u.f <= 0.0f) { c = 0; cg = 0; } else { - c = (u.f * 255.1619) + 0.5; - cg = (linear_to_gamma_2_2 (u.f) * 255.1619) + 0.5; + c = (u.f * 255.1619f) + 0.5f; + cg = (linear_to_gamma_2_2 (u.f) * 255.1619f) + 0.5f; if (cg > 255) cg = 255; if (c > 255) c = 255; } diff --git a/extensions/gggl-lies.c b/extensions/gggl-lies.c index 4a2e9cd..e903c86 100644 --- a/extensions/gggl-lies.c +++ b/extensions/gggl-lies.c @@ -59,17 +59,17 @@ conv_F_8 (const Babl *conversion, while (n--) { float f = ((*(float *) src)); - if (f < 0.0) + if (f < 0.0f) { *(unsigned char *) dst = 0; } - else if (f > 1.0) + else if (f > 1.0f) { *(unsigned char *) dst = 255; } else { - *(unsigned char *) dst = lrint (f * 255.0); + *(unsigned char *) dst = lrint (f * 255.0f); } dst += 1; src += 4; @@ -87,17 +87,17 @@ conv_F_16 (const Babl *conversion, while (n--) { float f = ((*(float *) src)); - if (f < 0.0) + if (f < 0.0f) { *(unsigned short *) dst = 0; } - else if (f > 1.0) + else if (f > 1.0f) { *(unsigned short *) dst = 65535; } else { - *(unsigned short *) dst = lrint (f * 65535.0); + *(unsigned short *) dst = lrint (f * 65535.0f); } dst += 2; src += 4; @@ -116,7 +116,7 @@ conv_8_F (const Babl *conversion, while (n--) { - (*(float *) dst) = (*(unsigned char *) src / 255.0); + (*(float *) dst) = (*(unsigned char *) src / 255.0f); dst += 4; src += 1; } @@ -649,11 +649,11 @@ conv_rgbaF_rgbA8 (const Babl *conversion, for (c = 0; c < 3; c++) { - *(unsigned char *) dst = lrint (((*(float *) src) * alpha) * 255.0); + *(unsigned char *) dst = lrint (((*(float *) src) * alpha) * 255.0f); dst += 1; src += 4; } - *(unsigned char *) dst = lrint (alpha * 255.0); + *(unsigned char *) dst = lrint (alpha * 255.0f); dst++; src += 4; } @@ -673,7 +673,7 @@ conv_rgbaF_rgb8 (const Babl *conversion, for (c = 0; c < 3; c++) { - *(unsigned char *) dst = lrint ((*(float *) src) * 255.0); + *(unsigned char *) dst = lrint ((*(float *) src) * 255.0f); dst += 1; src += 4; } @@ -695,7 +695,7 @@ conv_rgbaF_rgb16 (const Babl *conversion, for (c = 0; c < 3; c++) { - *(unsigned short *) dst = lrint ((*(float *) src) * 65535.0); + *(unsigned short *) dst = lrint ((*(float *) src) * 65535.0f); dst += 2; src += 4; } diff --git a/extensions/gggl.c b/extensions/gggl.c index 06843ea..95ff2e8 100644 --- a/extensions/gggl.c +++ b/extensions/gggl.c @@ -61,7 +61,7 @@ conv_F_8 (const Babl *conversion, while (n--) { float f = ((*(float *) src)); - int uval = lrint (f * 255.0); + int uval = lrint (f * 255.0f); if (uval < 0) uval = 0; if (uval > 255) uval = 255; @@ -83,17 +83,17 @@ conv_F_16 (const Babl *conversion, while (n--) { float f = ((*(float *) src)); - if (f < 0.0) + if (f < 0.0f) { *(unsigned short *) dst = 0; } - else if (f > 1.0) + else if (f > 1.0f) { *(unsigned short *) dst = 65535; } else { - *(unsigned short *) dst = lrint (f * 65535.0); + *(unsigned short *) dst = lrint (f * 65535.0f); } dst += 2; src += 4; @@ -110,7 +110,7 @@ conv_8_F (const Babl *conversion, while (n--) { - (*(float *) dst) = ((*(unsigned char *) src) / 255.0); + (*(float *) dst) = ((*(unsigned char *) src) / 255.0f); dst += 4; src += 1; } @@ -146,7 +146,7 @@ conv_rgbaF_rgb8 (const Babl *conversion, for (c = 0; c < 3; c++) { - int val = rint ((*(float *) src) * 255.0); + int val = rint ((*(float *) src) * 255.0f); if (val < 0) *(unsigned char *) dst = 0; else if (val > 255) @@ -679,11 +679,11 @@ conv_rgbaF_rgbA8 (const Babl *conversion, for (c = 0; c < 3; c++) { - *(unsigned char *) dst = lrint (((*(float *) src) * alpha) * 255.0); + *(unsigned char *) dst = lrint (((*(float *) src) * alpha) * 255.0f); dst += 1; src += 4; } - *(unsigned char *) dst = lrint (alpha * 255.0); + *(unsigned char *) dst = lrint (alpha * 255.0f); dst++; src += 4; } @@ -703,12 +703,12 @@ conv_rgbaF_rgb16 (const Babl *conversion, for (c = 0; c < 3; c++) { - if ((*(float *) src) >= 1.0) + if ((*(float *) src) >= 1.0f) *(unsigned short *) dst = 65535; else if ((*(float *) src) <=0) *(unsigned short *) dst = 0; else - *(unsigned short *) dst = lrint ((*(float *) src) * 65535.0); + *(unsigned short *) dst = lrint ((*(float *) src) * 65535.0f); dst += 2; src += 4; } @@ -733,11 +733,11 @@ conv_rgbA16_rgbaF (const Babl *conversion, if (alpha == 0.0f) recip_alpha = 10000.0; else - recip_alpha = 1.0/alpha; + recip_alpha = 1.0f/alpha; for (c = 0; c < 3; c++) { - (*(float *) dst) = (*(unsigned short *) src / 65535.0) * recip_alpha; + (*(float *) dst) = (*(unsigned short *) src / 65535.0f) * recip_alpha; dst += 4; src += 2; } @@ -782,7 +782,7 @@ conv_gF_rgbaF (const Babl *conversion, int c; for (c = 0; c < 3; c++) { - (*(float *) dst) = *(unsigned char *) src / 255.0; + (*(float *) dst) = *(unsigned char *) src / 255.0f; dst += 4; src += 1; } @@ -801,7 +801,7 @@ conv_gF_rgbaF (const Babl *conversion, int c; for (c = 0; c < 3; c++) { - (*(float *) dst) = *(unsigned char *) src / 255.0; + (*(float *) dst) = *(unsigned char *) src / 255.0f; dst += 4; } src += 1; @@ -903,13 +903,13 @@ conv_rgbA8_rgba8 (const Babl *conversion, } else { - float alpha = src[3]/255.0; - float ralpha = 1.0/alpha; + float alpha = src[3]/255.0f; + float ralpha = 1.0f/alpha; //unsigned aa = ((255 << 16)) / src[3]; unsigned aa = ((1 << 10)) * ralpha; - *dst++ = (src[0] * aa + .5) / 1024.0 + 0.5; - *dst++ = (src[1] * aa +.5) / 1024.0 + 0.5; - *dst++ = (src[2] * aa +.5) / 1024.0 + 0.5; + *dst++ = (src[0] * aa + .5f) / 1024.0f + 0.5f; + *dst++ = (src[1] * aa +.5f) / 1024.0f + 0.5f; + *dst++ = (src[2] * aa +.5f) / 1024.0f + 0.5f; *dst++ = src[3]; } src += 4; @@ -1032,9 +1032,9 @@ conv_yuvaF_rgbaF (const Babl *conversion, U = src_f[1]; V = src_f[2]; - R = Y + 1.40200 * (V /*-0.5*/); - G = Y - 0.34414 * (U /*-0.5*/) -0.71414 * (V /*-0.5*/); - B = Y + 1.77200 * (U /*-0.5*/); + R = Y + 1.40200f * (V /*-0.5*/); + G = Y - 0.34414f * (U /*-0.5*/) -0.71414f * (V /*-0.5*/); + B = Y + 1.77200f * (U /*-0.5*/); dst_f[0] = R; dst_f[1] = G; @@ -1066,9 +1066,9 @@ conv_yuvF_rgbF (const Babl *conversion, U = src_f[1]; V = src_f[2]; - R = Y + 1.40200 * (V /*-0.5*/); - G = Y - 0.34414 * (U /*-0.5*/) -0.71414 * (V /*-0.5*/); - B = Y + 1.77200 * (U /*-0.5*/); + R = Y + 1.40200f * (V /*-0.5*/); + G = Y - 0.34414f * (U /*-0.5*/) -0.71414f * (V /*-0.5*/); + B = Y + 1.77200f * (U /*-0.5*/); dst_f[0] = R; dst_f[1] = G; diff --git a/extensions/gimp-8bit.c b/extensions/gimp-8bit.c index 326058d..3d81661 100644 --- a/extensions/gimp-8bit.c +++ b/extensions/gimp-8bit.c @@ -366,13 +366,13 @@ conv_rgbaF_linear_rgb8_linear (const Babl *conversion, while (n--) { - v = rint (*fsrc++ * 255.0); + v = rint (*fsrc++ * 255.0f); *dst++ = (v < 0) ? 0 : ((v > 255) ? 255 : v); - v = rint (*fsrc++ * 255.0); + v = rint (*fsrc++ * 255.0f); *dst++ = (v < 0) ? 0 : ((v > 255) ? 255 : v); - v = rint (*fsrc++ * 255.0); + v = rint (*fsrc++ * 255.0f); *dst++ = (v < 0) ? 0 : ((v > 255) ? 255 : v); fsrc++; @@ -391,16 +391,16 @@ conv_rgbaF_linear_rgba8_linear (const Babl *conversion, while (n--) { - v = rint (*fsrc++ * 255.0); + v = rint (*fsrc++ * 255.0f); *dst++ = (v < 0) ? 0 : ((v > 255) ? 255 : v); - v = rint (*fsrc++ * 255.0); + v = rint (*fsrc++ * 255.0f); *dst++ = (v < 0) ? 0 : ((v > 255) ? 255 : v); - v = rint (*fsrc++ * 255.0); + v = rint (*fsrc++ * 255.0f); *dst++ = (v < 0) ? 0 : ((v > 255) ? 255 : v); - v = rint (*fsrc++ * 255.0); + v = rint (*fsrc++ * 255.0f); *dst++ = (v < 0) ? 0 : ((v > 255) ? 255 : v); } } diff --git a/extensions/grey.c b/extensions/grey.c index 416e3dc..c4e1a67 100644 --- a/extensions/grey.c +++ b/extensions/grey.c @@ -48,7 +48,7 @@ conv_rgbaF_linear_y8_linear (const Babl *conversion, value += *s++ * RGB_LUMINANCE_BLUE_FLOAT; s++; - v = rint (value * 255.0); + v = rint (value * 255.0f); *dst++ = (v < 0) ? 0 : ((v > 255) ? 255 : v); } } -- 2.30.2