X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fpor-file-writer.c;h=a50563ab964275df30365263005dbd1ded5262c9;hb=46a7a7b189e2df740043496c16d9f7c665b7a828;hp=3d62078e6942635d00b83b727b03176f4e4a7096;hpb=707848060e414fe93458834446dd7cdbf800667f;p=pspp diff --git a/src/data/por-file-writer.c b/src/data/por-file-writer.c index 3d62078e69..a50563ab96 100644 --- a/src/data/por-file-writer.c +++ b/src/data/por-file-writer.c @@ -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; @@ -212,7 +215,8 @@ write_float (struct pfm_writer *w, double d) char buffer[64]; format_trig_double (d, floor (d) == d ? DBL_DIG : w->digits, buffer); buf_write (w, buffer, strlen (buffer)); - buf_write (w, "/", 1); + if (d != SYSMIS) + buf_write (w, "/", 1); } /* Write N to the portable file as an integer field. */ @@ -774,7 +778,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 +899,7 @@ format_trig_double (long double value, int base_10_precision, char output[]) return; } -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,