Made case_{reader,writer}_class structures const.
[pspp-builds.git] / src / data / scratch-writer.c
index 70a65ce9b67760ec585c9a54878174f4abc300bf..ed88af6db4ee1a211443702de9545c251546abc7 100644 (file)
@@ -34,6 +34,8 @@
 
 #include "xalloc.h"
 
+#define N_(msgid) (msgid)
+
 /* A scratch file writer. */
 struct scratch_writer
   {
@@ -44,7 +46,7 @@ struct scratch_writer
     struct casewriter *subwriter;       /* Data output. */
   };
 
-static struct casewriter_class scratch_writer_casewriter_class;
+static const struct casewriter_class scratch_writer_casewriter_class;
 
 /* Opens FH, which must have referent type FH_REF_SCRATCH, and
    returns a scratch_writer for it, or a null pointer on
@@ -60,7 +62,9 @@ scratch_writer_open (struct file_handle *fh,
   size_t dict_value_cnt;
 
   /* Get exclusive write access to handle. */
-  lock = fh_lock (fh, FH_REF_SCRATCH, "scratch file", FH_ACC_WRITE, true);
+  /* TRANSLATORS: this fragment will be interpolated into
+     messages in fh_lock() that identify types of files. */
+  lock = fh_lock (fh, FH_REF_SCRATCH, N_("scratch file"), FH_ACC_WRITE, true);
   if (lock == NULL)
     return NULL;
 
@@ -139,7 +143,7 @@ scratch_writer_casewriter_destroy (struct casewriter *w UNUSED, void *writer_)
   free (writer);
 }
 
-static struct casewriter_class scratch_writer_casewriter_class =
+static const struct casewriter_class scratch_writer_casewriter_class =
   {
     scratch_writer_casewriter_write,
     scratch_writer_casewriter_destroy,