Use macros from cast.h instead of literal casts
[pspp] / src / data / dictionary.c
index aa0fcd5654d82181c23895793a7c88459e1e2dae..5f86bbf518fc84822343ab60f45e7483653977dd 100644 (file)
@@ -297,7 +297,8 @@ dict_destroy (struct dictionary *d)
       dict_clear (d);
       hmap_destroy (&d->name_map);
       attrset_destroy (&d->attributes);
-      free (d->mrsets);
+      dict_clear_mrsets (d);
+      free (d->encoding);
       free (d);
     }
 }
@@ -329,7 +330,7 @@ void
 dict_get_vars (const struct dictionary *d, const struct variable ***vars,
                size_t *cnt, enum dict_class exclude)
 {
-  dict_get_vars_mutable (d, (struct variable ***) vars, cnt, exclude);
+  dict_get_vars_mutable (d, CONST_CAST (struct variable ***, vars), cnt, exclude);
 }
 
 /* Sets *VARS to an array of pointers to variables in D and *CNT