SasView / sasmodels

Package for calculation of small angle scattering models using OpenCL.
BSD 3-Clause "New" or "Revised" License
15 stars 27 forks source link

Compiler error on macos: assigning to constant. #482

Closed pkienzle closed 2 years ago

pkienzle commented 2 years ago

c compiler on macos complaining about assigning a value to const double.

Fix follows:

diff --git a/sasmodels/kernel_iq.c b/sasmodels/kernel_iq.c
index ebb0c57..617c75b 100644
--- a/sasmodels/kernel_iq.c
+++ b/sasmodels/kernel_iq.c
@@ -85,7 +85,7 @@ static double clip(double value, double low, double high)
 static void set_spin_weights(double in_spin, double out_spin, double weight[6])
 {

-  const double norm;
+  double norm;
   in_spin = clip(in_spin, 0.0, 1.0);
   out_spin = clip(out_spin, 0.0, 1.0);
   // Previous version of this function took the square root of the weights,
pkienzle commented 2 years ago

This was fixed in superball, which was eventually merged into master.