aboutsummaryrefslogtreecommitdiffstats
path: root/libgamma_internal_translate_to_64.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libgamma_internal_translate_to_64.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/libgamma_internal_translate_to_64.c b/libgamma_internal_translate_to_64.c
index 3733186..2c4a316 100644
--- a/libgamma_internal_translate_to_64.c
+++ b/libgamma_internal_translate_to_64.c
@@ -3,11 +3,6 @@
/**
- * Just an arbitrary version
- */
-#define ANY bits64
-
-/**
* Concatenation of all ramps
*/
#define ALL red
@@ -163,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, gamma_ramps_any_t in)
+libgamma_internal_translate_to_64(signed depth, size_t n, uint64_t *restrict out, const gamma_ramps_any_t *restrict in)
{
size_t i;
switch (depth) {
/* Translate integer */
- case 8: __translate(out[i] = (uint64_t)(in.bits8. ALL[i]) * 0x0101010101010101ULL);
- case 16: __translate(out[i] = (uint64_t)(in.bits16.ALL[i]) * 0x0001000100010001ULL);
- case 32: __translate(out[i] = (uint64_t)(in.bits32.ALL[i]) * 0x0000000100000001ULL);
+ 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();