Use standard C99 isfinite, isnan, isinf in place of GSL substitutes.
[pspp-builds.git] / src / data / por-file-writer.c
index 3d62078e6942635d00b83b727b03176f4e4a7096..8a27f6b785ccc548d5a14436cfe221ee7476d3e6 100644 (file)
@@ -49,6 +49,7 @@
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
+#define N_(msgid) (msgid)
 
 /* Maximum width of a variable in a portable file. */
 #define MAX_POR_WIDTH 255
@@ -76,7 +77,7 @@ struct pfm_var
     int fv;                     /* Starting case index. */
   };
 
-static struct casewriter_class por_file_casewriter_class;
+static const struct casewriter_class por_file_casewriter_class;
 
 static bool close_writer (struct pfm_writer *);
 static void buf_write (struct pfm_writer *, const void *, size_t);
@@ -142,7 +143,9 @@ pfm_open_writer (struct file_handle *fh, struct dictionary *dict,
     }
 
   /* Lock file. */
-  w->lock = fh_lock (fh, FH_REF_FILE, "portable file", FH_ACC_WRITE, true);
+  /* TRANSLATORS: this fragment will be interpolated into
+     messages in fh_lock() that identify types of files. */
+  w->lock = fh_lock (fh, FH_REF_FILE, N_("portable file"), FH_ACC_WRITE, true);
   if (w->lock == NULL)
     goto error;
 
@@ -774,7 +777,7 @@ format_trig_double (long double value, int base_10_precision, char output[])
      0...30**6, an invariant of the loop below. */
   errno = 0;
   base_2_sig = frexp (value, &base_2_exp);
-  if (errno != 0 || !finite (base_2_sig))
+  if (errno != 0 || !isfinite (base_2_sig))
     goto missing_value;
   if (base_2_exp == 0 && base_2_sig == 0.)
     goto zero;
@@ -895,7 +898,7 @@ format_trig_double (long double value, int base_10_precision, char output[])
   return;
 }
 \f
-static struct casewriter_class por_file_casewriter_class =
+static const struct casewriter_class por_file_casewriter_class =
   {
     por_file_casewriter_write,
     por_file_casewriter_destroy,