[gnumeric] Bessel function: drop translation for error strings.



commit 5c2b855b2543c99fee6256c8b779abc677d4758e
Author: Morten Welinder <terra gnome org>
Date:   Wed Aug 28 20:25:18 2013 -0400

    Bessel function: drop translation for error strings.
    
    They are clearly not meant for users.  Also remove references to the
    old yn[l].

 ChangeLog      |    2 ++
 configure.ac   |   16 ----------------
 src/mathfunc.c |   48 ++++++++++++++++--------------------------------
 src/numbers.h  |    9 ---------
 4 files changed, 18 insertions(+), 57 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1d6c5ce..9b2ddcc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
        * src/mathfunc.c (gnm_gamma): Improve precision for large
        arguments.
+       (gnm_yn): Not needed anymore.
+       (bessel_i): Don't mark error strings for translation.
 
 2013-08-27  Morten Welinder <terra gnome org>
 
diff --git a/configure.ac b/configure.ac
index 50245ae..a235e9a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -638,22 +638,6 @@ AC_ARG_WITH(long_double,
                                ,
                                AC_MSG_ERROR([Long doubles require the $ldfunc function.]))
 
-               AC_MSG_CHECKING([checking for working ynl])
-               AC_RUN_IFELSE(
-                       [AC_LANG_PROGRAM([[
-                               #include <math.h>
-                               #ifdef HAVE_SUNMATH_H
-                               #include <sunmath.h>
-                               #endif]],
-                               [[
-                                       long double l = ynl (2, 4.0L);
-                                       return !(l >= 0.21 && l <= 0.22);
-                               ]])],
-                       [AC_DEFINE(HAVE_YNL)
-                       AC_MSG_RESULT(yes)],
-                       AC_MSG_RESULT(no),
-                       [AC_CHECK_FUNCS(ynl)])
-
                AC_MSG_CHECKING([checking for working erfl and erfcl])
                AC_RUN_IFELSE(
                        [AC_LANG_PROGRAM([[
diff --git a/src/mathfunc.c b/src/mathfunc.c
index 68c8d1a..42e7cbe 100644
--- a/src/mathfunc.c
+++ b/src/mathfunc.c
@@ -3893,7 +3893,7 @@ static gnm_float bessel_i(gnm_float x, gnm_float alpha, gnm_float expo)
     alpha -= (nb-1);
 #ifdef MATHLIB_STANDALONE
     bi = (gnm_float *) calloc(nb, sizeof(gnm_float));
-    if (!bi) MATHLIB_ERROR("%s", _("bessel_i allocation error"));
+    if (!bi) MATHLIB_ERROR("%s", ("bessel_i allocation error"));
 #else
     vmax = vmaxget();
     bi = (gnm_float *) R_alloc(nb, sizeof(gnm_float));
@@ -3901,10 +3901,10 @@ static gnm_float bessel_i(gnm_float x, gnm_float alpha, gnm_float expo)
     I_bessel(&x, &alpha, &nb, &ize, bi, &ncalc);
     if(ncalc != nb) {/* error input */
        if(ncalc < 0)
-           MATHLIB_WARNING4(_("bessel_i(%" GNM_FORMAT_g "): ncalc (=%ld) != nb (=%ld); alpha=%" GNM_FORMAT_g 
". Arg. out of range?\n"),
+           MATHLIB_WARNING4(("bessel_i(%" GNM_FORMAT_g "): ncalc (=%ld) != nb (=%ld); alpha=%" GNM_FORMAT_g 
". Arg. out of range?\n"),
                             x, ncalc, nb, alpha);
        else
-           MATHLIB_WARNING2(_("bessel_i(%" GNM_FORMAT_g ",nu=%" GNM_FORMAT_g "): precision lost in 
result\n"),
+           MATHLIB_WARNING2(("bessel_i(%" GNM_FORMAT_g ",nu=%" GNM_FORMAT_g "): precision lost in result\n"),
                             x, alpha+nb-1);
     }
     x = bi[nb-1];
@@ -4370,7 +4370,7 @@ static gnm_float bessel_j(gnm_float x, gnm_float alpha)
     alpha -= (gnm_float)(nb-1);
 #ifdef MATHLIB_STANDALONE
     bj = (gnm_float *) calloc(nb, sizeof(gnm_float));
-    if (!bj) MATHLIB_ERROR("%s", _("bessel_j allocation error"));
+    if (!bj) MATHLIB_ERROR("%s", ("bessel_j allocation error"));
 #else
     vmax = vmaxget();
     bj = (gnm_float *) R_alloc((size_t) nb, sizeof(gnm_float));
@@ -4378,10 +4378,10 @@ static gnm_float bessel_j(gnm_float x, gnm_float alpha)
     J_bessel(&x, &alpha, &nb, bj, &ncalc);
     if(ncalc != nb) {/* error input */
       if(ncalc < 0)
-       MATHLIB_WARNING4(_("bessel_j(%" GNM_FORMAT_g "): ncalc (=%ld) != nb (=%ld); alpha=%" GNM_FORMAT_g ". 
Arg. out of range?\n"),
+       MATHLIB_WARNING4(("bessel_j(%" GNM_FORMAT_g "): ncalc (=%ld) != nb (=%ld); alpha=%" GNM_FORMAT_g ". 
Arg. out of range?\n"),
                         x, ncalc, nb, alpha);
       else
-       MATHLIB_WARNING2(_("bessel_j(%" GNM_FORMAT_g ",nu=%" GNM_FORMAT_g "): precision lost in result\n"),
+       MATHLIB_WARNING2(("bessel_j(%" GNM_FORMAT_g ",nu=%" GNM_FORMAT_g "): precision lost in result\n"),
                         x, alpha+(gnm_float)nb-1);
     }
     x = bj[nb-1];
@@ -4421,10 +4421,10 @@ static gnm_float bessel_j_ex(gnm_float x, gnm_float alpha, gnm_float *bj)
     J_bessel(&x, &alpha, &nb, bj, &ncalc);
     if(ncalc != nb) {/* error input */
       if(ncalc < 0)
-       MATHLIB_WARNING4(_("bessel_j(%" GNM_FORMAT_g "): ncalc (=%ld) != nb (=%ld); alpha=%" GNM_FORMAT_g ". 
Arg. out of range?\n"),
+       MATHLIB_WARNING4(("bessel_j(%" GNM_FORMAT_g "): ncalc (=%ld) != nb (=%ld); alpha=%" GNM_FORMAT_g ". 
Arg. out of range?\n"),
                         x, ncalc, nb, alpha);
       else
-       MATHLIB_WARNING2(_("bessel_j(%" GNM_FORMAT_g ",nu=%" GNM_FORMAT_g "): precision lost in result\n"),
+       MATHLIB_WARNING2(("bessel_j(%" GNM_FORMAT_g ",nu=%" GNM_FORMAT_g "): precision lost in result\n"),
                         x, alpha+(gnm_float)nb-1);
     }
     x = bj[nb-1];
@@ -4938,7 +4938,7 @@ static gnm_float bessel_k(gnm_float x, gnm_float alpha, gnm_float expo)
     alpha -= (nb-1);
 #ifdef MATHLIB_STANDALONE
     bk = (gnm_float *) calloc(nb, sizeof(gnm_float));
-    if (!bk) MATHLIB_ERROR("%s", _("bessel_k allocation error"));
+    if (!bk) MATHLIB_ERROR("%s", ("bessel_k allocation error"));
 #else
     vmax = vmaxget();
     bk = (gnm_float *) R_alloc(nb, sizeof(gnm_float));
@@ -4946,10 +4946,10 @@ static gnm_float bessel_k(gnm_float x, gnm_float alpha, gnm_float expo)
     K_bessel(&x, &alpha, &nb, &ize, bk, &ncalc);
     if(ncalc != nb) {/* error input */
       if(ncalc < 0)
-       MATHLIB_WARNING4(_("bessel_k(%" GNM_FORMAT_g "): ncalc (=%ld) != nb (=%ld); alpha=%" GNM_FORMAT_g ". 
Arg. out of range?\n"),
+       MATHLIB_WARNING4(("bessel_k(%" GNM_FORMAT_g "): ncalc (=%ld) != nb (=%ld); alpha=%" GNM_FORMAT_g ". 
Arg. out of range?\n"),
                         x, ncalc, nb, alpha);
       else
-       MATHLIB_WARNING2(_("bessel_k(%" GNM_FORMAT_g ",nu=%" GNM_FORMAT_g "): precision lost in result\n"),
+       MATHLIB_WARNING2(("bessel_k(%" GNM_FORMAT_g ",nu=%" GNM_FORMAT_g "): precision lost in result\n"),
                         x, alpha+nb-1);
     }
     x = bk[nb-1];
@@ -5470,7 +5470,7 @@ static gnm_float bessel_y(gnm_float x, gnm_float alpha)
     alpha -= (gnm_float)(nb-1);
 #ifdef MATHLIB_STANDALONE
     by = (gnm_float *) calloc(nb, sizeof(gnm_float));
-    if (!by) MATHLIB_ERROR("%s", _("bessel_y allocation error"));
+    if (!by) MATHLIB_ERROR("%s", ("bessel_y allocation error"));
 #else
     vmax = vmaxget();
     by = (gnm_float *) R_alloc((size_t) nb, sizeof(gnm_float));
@@ -5480,10 +5480,10 @@ static gnm_float bessel_y(gnm_float x, gnm_float alpha)
        if(ncalc == -1)
            return gnm_pinf;
        else if(ncalc < -1)
-           MATHLIB_WARNING4(_("bessel_y(%" GNM_FORMAT_g "): ncalc (=%ld) != nb (=%ld); alpha=%" GNM_FORMAT_g 
". Arg. out of range?\n"),
+           MATHLIB_WARNING4(("bessel_y(%" GNM_FORMAT_g "): ncalc (=%ld) != nb (=%ld); alpha=%" GNM_FORMAT_g 
". Arg. out of range?\n"),
                             x, ncalc, nb, alpha);
        else /* ncalc >= 0 */
-           MATHLIB_WARNING2(_("bessel_y(%" GNM_FORMAT_g ",nu=%" GNM_FORMAT_g "): precision lost in 
result\n"),
+           MATHLIB_WARNING2(("bessel_y(%" GNM_FORMAT_g ",nu=%" GNM_FORMAT_g "): precision lost in result\n"),
                             x, alpha+(gnm_float)nb-1);
     }
     x = by[nb-1];
@@ -5525,10 +5525,10 @@ static gnm_float bessel_y_ex(gnm_float x, gnm_float alpha, gnm_float *by)
        if(ncalc == -1)
            return gnm_pinf;
        else if(ncalc < -1)
-           MATHLIB_WARNING4(_("bessel_y(%" GNM_FORMAT_g "): ncalc (=%ld) != nb (=%ld); alpha=%" GNM_FORMAT_g 
". Arg. out of range?\n"),
+           MATHLIB_WARNING4(("bessel_y(%" GNM_FORMAT_g "): ncalc (=%ld) != nb (=%ld); alpha=%" GNM_FORMAT_g 
". Arg. out of range?\n"),
                             x, ncalc, nb, alpha);
        else /* ncalc >= 0 */
-           MATHLIB_WARNING2(_("bessel_y(%" GNM_FORMAT_g ",nu=%" GNM_FORMAT_g "): precision lost in 
result\n"),
+           MATHLIB_WARNING2(("bessel_y(%" GNM_FORMAT_g ",nu=%" GNM_FORMAT_g "): precision lost in result\n"),
                             x, alpha+(gnm_float)nb-1);
     }
     x = by[nb-1];
@@ -8456,22 +8456,6 @@ gnm_erfc (gnm_float x)
 
 /* ------------------------------------------------------------------------- */
 
-#ifdef NEED_FAKE_YNGNUM
-gnm_float
-gnm_yn (int n, gnm_float x)
-{
-       static gboolean warned = FALSE;
-       if (!warned) {
-               warned = TRUE;
-               g_warning (_("This version of Gnumeric has been compiled with inadequate precision in 
gnm_yn."));
-       }
-
-       return (gnm_float)yn (n, (double)x);
-}
-#endif
-
-/* ------------------------------------------------------------------------- */
-
 #ifndef HAVE_LGAMMA
 /* Avoid using this.  It may be missing in system libraries.  */
 int signgam;
diff --git a/src/numbers.h b/src/numbers.h
index 5fd7bb5..c8bd365 100644
--- a/src/numbers.h
+++ b/src/numbers.h
@@ -49,14 +49,6 @@ gnm_float gnm_erf (gnm_float x);
 gnm_float gnm_erfc (gnm_float x);
 #endif
 
-#ifdef HAVE_YNL
-#define gnm_yn ynl
-#else
-#define NEED_FAKE_YNGNUM
-/* Defined in mathfunc.c  */
-gnm_float gnm_yn (int n, gnm_float x);
-#endif
-
 #define gnm_abs fabsl
 #define gnm_acos acosl
 #define gnm_acosh acoshl
@@ -191,7 +183,6 @@ typedef double gnm_float;
 #define gnm_sub_epsilon go_sub_epsilon
 #define gnm_tan tan
 #define gnm_tanh tanh
-#define gnm_yn yn
 
 #define GNM_FORMAT_e   "e"
 #define GNM_FORMAT_E   "E"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]