From 12a97e8ad7138981e204b73a756f2854b8811186 Mon Sep 17 00:00:00 2001 From: Laurent Desnogues Date: Sun, 8 Sep 2024 09:47:03 +0200 Subject: [PATCH] Make mi64_div_y32 source array const. --- src/mi64.c | 4 ++-- src/mi64.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mi64.c b/src/mi64.c index 59a71698..40fe0570 100755 --- a/src/mi64.c +++ b/src/mi64.c @@ -8072,7 +8072,7 @@ In other words, these kinds of compiler warnings are expected: #ifdef __CUDA_ARCH__ __device__ #endif -uint32 mi64_div_y32(uint64 x[], uint32 y, uint64 q[], uint32 len) +uint32 mi64_div_y32(const uint64 x[], uint32 y, uint64 q[], uint32 len) { int i; uint64 cy, rem, xlomody, tsum; @@ -8109,7 +8109,7 @@ uint32 mi64_div_y32(uint64 x[], uint32 y, uint64 q[], uint32 len) rem = tsum%y; } if(rem == 0 && x != q) { // If overwrote input with quotient in above loop, skip this - ASSERT(mi64_is_div_by_scalar32((uint32 *)x, y, len), "Results of mi64_div_y32 and mi64_is_div_by_scalar32 differ!"); + ASSERT(mi64_is_div_by_scalar32((const uint32 *)x, y, len), "Results of mi64_div_y32 and mi64_is_div_by_scalar32 differ!"); return 0; } return (uint32)rem; diff --git a/src/mi64.h b/src/mi64.h index 5e2a1777..f3d8e6f0 100755 --- a/src/mi64.h +++ b/src/mi64.h @@ -324,7 +324,7 @@ DEV int mi64_is_div_by_scalar64 (const uint64 x[], uint64 a, uint32 len); DEV int mi64_is_div_by_scalar64_x4(const uint64 x[], uint64 q0, uint64 q1, uint64 q2, uint64 q3, uint32 len); DEV int mi64_is_div_by_scalar64_u2 (const uint64 x[], uint64 a, uint32 len); // 2-way interleaved-|| loop DEV int mi64_is_div_by_scalar64_u4 (const uint64 x[], uint64 a, uint32 len); // 4-way interleaved-|| loop -DEV uint32 mi64_div_y32 (uint64 x[], uint32 y, uint64 q[], uint32 len); +DEV uint32 mi64_div_y32 (const uint64 x[], uint32 y, uint64 q[], uint32 len); /* Basic I/O routines: */ /* This is an arbitrary-string-length core routine which can be called directly, requires caller to supply allocated-length of input string: */