aboutsummaryrefslogtreecommitdiffstats
path: root/libgamma_internal_translate_from_64.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libgamma_internal_translate_from_64.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libgamma_internal_translate_from_64.c b/libgamma_internal_translate_from_64.c
index b8adbfe..e7203a3 100644
--- a/libgamma_internal_translate_from_64.c
+++ b/libgamma_internal_translate_from_64.c
@@ -23,19 +23,19 @@
* @param in Input array, may be modified
*/
void
-libgamma_internal_translate_from_64(signed depth, size_t n, gamma_ramps_any_t out, uint64_t *restrict in)
+libgamma_internal_translate_from_64(signed depth, size_t n, gamma_ramps_any_t *restrict out, const uint64_t *restrict in)
{
size_t i;
switch (depth) {
/* Translate integer */
- case 8: __translate(out.bits8. ALL[i] = (uint8_t)(in[i] / 0x0101010101010101ULL));
- case 16: __translate(out.bits16.ALL[i] = (uint16_t)(in[i] / 0x0001000100010001ULL));
- case 32: __translate(out.bits32.ALL[i] = (uint32_t)(in[i] / 0x0000000100000001ULL));
+ case 8: __translate(out->bits8. ALL[i] = (uint8_t)(in[i] / UINT64_C(0x0101010101010101)));
+ case 16: __translate(out->bits16.ALL[i] = (uint16_t)(in[i] / UINT64_C(0x0001000100010001)));
+ case 32: __translate(out->bits32.ALL[i] = (uint32_t)(in[i] / UINT64_C(0x0000000100000001)));
/* Identity translation */
- case 64: __translate(out.bits64.ALL[i] = in[i]);
+ case 64: __translate(out->bits64.ALL[i] = in[i]);
/* Translate floating point */
- case -1: __translate(out.float_single.ALL[i] = (float)(in[i]) / (float)UINT64_MAX);
- case -2: __translate(out.float_double.ALL[i] = (double)(in[i]) / (double)UINT64_MAX);
+ case -1: __translate(out->float_single.ALL[i] = (float)in[i] / (float)UINT64_MAX);
+ case -2: __translate(out->float_double.ALL[i] = (double)in[i] / (double)UINT64_MAX);
default:
/* This is not possible */
abort();