From baa6a1cf7979c095c1081daa2a2d1134c76d2f1b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 7 Mar 2021 22:51:21 +0100 Subject: misc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libgamma_internal_translate_to_64.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libgamma_internal_translate_to_64.c') diff --git a/libgamma_internal_translate_to_64.c b/libgamma_internal_translate_to_64.c index 2c4a316..24cb0ed 100644 --- a/libgamma_internal_translate_to_64.c +++ b/libgamma_internal_translate_to_64.c @@ -12,7 +12,7 @@ * Preform installation in an `for (i = 0; i < n; i++)` * loop and do a `break` afterwords */ -#define __translate(instruction) for (i = 0; i < n; i++) instruction; break +#define TRANSLATE(instruction) for (i = 0; i < n; i++) instruction; break /** @@ -158,19 +158,19 @@ double_to_64(double value) * @param in Input gamma ramps */ void -libgamma_internal_translate_to_64(signed depth, size_t n, uint64_t *restrict out, const gamma_ramps_any_t *restrict in) +libgamma_internal_translate_to_64(signed depth, size_t n, uint64_t *restrict out, const union gamma_ramps_any *restrict in) { size_t i; switch (depth) { /* Translate integer */ - case 8: __translate(out[i] = (uint64_t)in->bits8. ALL[i] * UINT64_C(0x0101010101010101)); - case 16: __translate(out[i] = (uint64_t)in->bits16.ALL[i] * UINT64_C(0x0001000100010001)); - case 32: __translate(out[i] = (uint64_t)in->bits32.ALL[i] * UINT64_C(0x0000000100000001)); + case 8: TRANSLATE(out[i] = (uint64_t)in->bits8. ALL[i] * UINT64_C(0x0101010101010101)); + case 16: TRANSLATE(out[i] = (uint64_t)in->bits16.ALL[i] * UINT64_C(0x0001000100010001)); + case 32: TRANSLATE(out[i] = (uint64_t)in->bits32.ALL[i] * UINT64_C(0x0000000100000001)); /* Identity translation */ - case 64: __translate(out[i] = in->bits64.ALL[i]); + case 64: TRANSLATE(out[i] = in->bits64.ALL[i]); /* Translate floating point */ - case -1: __translate(out[i] = float_to_64(in->float_single.ALL[i])); - case -2: __translate(out[i] = double_to_64(in->float_double.ALL[i])); + case -1: TRANSLATE(out[i] = float_to_64(in->float_single.ALL[i])); + case -2: TRANSLATE(out[i] = double_to_64(in->float_double.ALL[i])); default: /* This is not possible */ abort(); -- cgit v1.2.3-70-g09d2