Adopt use of gnulib for portability.
[pspp-builds.git] / src / moments.c
index c4f3fe18db76573a38c5a8869540f64a0a6aa19a..00e0ac800358a3479b73e69fadeeaffcd7e4441f 100644 (file)
@@ -14,8 +14,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA. */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA. */
 
 #include <config.h>
 #include "moments.h"
@@ -25,6 +25,9 @@
 #include "alloc.h"
 #include "misc.h"
 #include "val.h"
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
 \f
 /* Calculates variance, skewness, and kurtosis into *VARIANCE,
    *SKEWNESS, and *KURTOSIS if they are non-null and not greater
@@ -501,14 +504,14 @@ read_values (double **values, double **weights, size_t *cnt)
   *values = NULL;
   *weights = NULL;
   *cnt = 0;
-  while (token == T_NUM) 
+  while (lex_is_number ())
     {
       double value = tokval;
       double weight = 1.;
       lex_get ();
       if (lex_match ('*'))
         {
-          if (token != T_NUM) 
+          if (!lex_is_number ())
             {
               lex_error (_("expecting weight value"));
               return 0;