cleanup
[pspp] / src / data / ods-reader.c
index b014a748d7bda81df41ddfd421c8172406133542..c95272364580179316c34c076ec43a4e5c90cc60 100644 (file)
@@ -129,7 +129,7 @@ struct cache_datum
 {
   struct hmap_node node;
 
-  /* The the number of the sheet.  */
+  /* The number of the sheet.  */
   int sheet;
 
   /* The cell's row.  */
@@ -661,8 +661,8 @@ convert_xml_to_value (struct ccase *c, const struct variable *var,
     value_copy_str_rpad (v, var_get_width (var), xmv->text, ' ');
   else
     {
-      const struct fmt_spec *fmt = var_get_write_format (var);
-      enum fmt_category fc  = fmt_get_category (fmt->type);
+      const struct fmt_spec fmt = var_get_write_format (var);
+      enum fmt_category fc  = fmt_get_category (fmt.type);
 
       assert (fc != FMT_CAT_STRING);
 
@@ -675,7 +675,7 @@ convert_xml_to_value (struct ccase *c, const struct variable *var,
          const char *text = xmv->value ?
            CHAR_CAST (const char *, xmv->value) : CHAR_CAST (const char *, xmv->text);
 
-         char *m = data_in (ss_cstr (text), "UTF-8", fmt->type,
+         char *m = data_in (ss_cstr (text), "UTF-8", fmt.type,
                              settings_get_fmt_settings (), v,
                              var_get_width (var), "UTF-8");
 
@@ -954,7 +954,7 @@ ods_make_reader (struct spreadsheet *spreadsheet,
       else
        fmt = fmt_default_for_width (width);
 
-      var_set_both_formats (var, &fmt);
+      var_set_both_formats (var, fmt);
     }
 
   if (n_var_specs ==  0)
@@ -1079,7 +1079,7 @@ ods_file_casereader_read (struct casereader *reader UNUSED, void *r_)
           r->rsd.node_type == XML_READER_TYPE_TEXT)
        {
          int col;
-         struct xml_value *xmv = xzalloc (sizeof *xmv);
+         struct xml_value *xmv = XZALLOC (struct xml_value);
          xmv->text = xmlTextReaderValue (r->rsd.xtr);
          xmv->value = val_string;
          val_string = NULL;
@@ -1094,7 +1094,7 @@ ods_file_casereader_read (struct casereader *reader UNUSED, void *r_)
                continue;
              if (r->spreadsheet.stop_col != -1 && idx > r->spreadsheet.stop_col - r->spreadsheet.start_col)
                break;
-             if (idx >= dict_get_var_cnt (r->spreadsheet.dict))
+             if (idx >= dict_get_n_vars (r->spreadsheet.dict))
                break;
 
               var = dict_get_var (r->spreadsheet.dict, idx);
@@ -1163,7 +1163,7 @@ init_reader (struct ods_reader *r, bool report_errors,
 struct spreadsheet *
 ods_probe (const char *filename, bool report_errors)
 {
-  struct ods_reader *r = xzalloc (sizeof *r);
+  struct ods_reader *r = XZALLOC (struct ods_reader);
 
   struct zip_reader *zr;
   char *error = zip_reader_create (filename, &zr);