Hi list,

digging through the code I noticed that some routines in the
ode-initval2/driver.c file always return GSL_SUCCESS, because they incorrectly
use the GSL_ERROR_NULL macro instead of GSL_ERROR on error.

Git patch attached if you want to apply it directly.

Regards,

  Matthias Sitte
From dd3045d53545334a64135dea937156fd792041cc Mon Sep 17 00:00:00 2001
From: Matthias Sitte <[email protected]>
Date: Mon, 6 Jul 2015 09:50:08 -0500
Subject: [PATCH] Fix error macros in ODE driver routines

---
 ode-initval2/driver.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ode-initval2/driver.c b/ode-initval2/driver.c
index d0db988..80b2256 100644
--- a/ode-initval2/driver.c
+++ b/ode-initval2/driver.c
@@ -108,7 +108,7 @@ gsl_odeiv2_driver_set_hmin (gsl_odeiv2_driver * d, const 
double hmin)
 
   if ((fabs (hmin) > fabs (d->h)) || (fabs (hmin) > d->hmax))
     {
-      GSL_ERROR_NULL ("hmin <= fabs(h) <= hmax required", GSL_EINVAL);
+      GSL_ERROR ("hmin <= fabs(h) <= hmax required", GSL_EINVAL);
     }
 
   d->hmin = fabs (hmin);
@@ -124,7 +124,7 @@ gsl_odeiv2_driver_set_hmax (gsl_odeiv2_driver * d, const 
double hmax)
 
   if ((fabs (hmax) < fabs (d->h)) || (fabs (hmax) < d->hmin))
     {
-      GSL_ERROR_NULL ("hmin <= fabs(h) <= hmax required", GSL_EINVAL);
+      GSL_ERROR ("hmin <= fabs(h) <= hmax required", GSL_EINVAL);
     }
 
   if (hmax > 0.0 || hmax < 0.0)
@@ -349,7 +349,7 @@ gsl_odeiv2_driver_apply (gsl_odeiv2_driver * d, double *t,
 
   if (sign * (t1 - *t) < 0.0)
     {
-      GSL_ERROR_NULL
+      GSL_ERROR
         ("integration limits and/or step direction not consistent",
          GSL_EINVAL);
     }
@@ -461,7 +461,7 @@ gsl_odeiv2_driver_reset_hstart (gsl_odeiv2_driver * d, 
const double hstart)
 
   if ((d->hmin > fabs (hstart)) || (fabs (hstart) > d->hmax))
     {
-      GSL_ERROR_NULL ("hmin <= fabs(h) <= hmax required", GSL_EINVAL);
+      GSL_ERROR ("hmin <= fabs(h) <= hmax required", GSL_EINVAL);
     }
 
   if (hstart > 0.0 || hstart < 0.0)
@@ -470,7 +470,7 @@ gsl_odeiv2_driver_reset_hstart (gsl_odeiv2_driver * d, 
const double hstart)
     }
   else
     {
-      GSL_ERROR_NULL ("invalid hstart", GSL_EINVAL);
+      GSL_ERROR ("invalid hstart", GSL_EINVAL);
     }
 
   return GSL_SUCCESS;
-- 
2.3.2 (Apple Git-55)

Reply via email to