Change how checking for missing values works.
[pspp] / src / output / charts / piechart.c
index 0467c8338fcc3b37be8c34fae15fcbfc6d934db6..ad3b2eafd7926e88dfa56f3ba16362f92ea0d60d 100644 (file)
@@ -23,7 +23,7 @@
 #include "libpspp/cast.h"
 #include "libpspp/str.h"
 #include "data/variable.h"
-#include "output/chart-item-provider.h"
+#include "output/chart-provider.h"
 
 #include "gl/xalloc.h"
 
 
 /* Creates and returns a chart that will render a piechart with
    the of VAR and the N_SLICES described in SLICES. */
-struct chart_item *
+struct chart *
 piechart_create (const struct variable *var, const struct freq *slices, int n_slices)
 {
   struct piechart *pie;
   int i;
 
   pie = xmalloc (sizeof *pie);
-  chart_item_init (&pie->chart_item, &piechart_class, var_to_string (var));
+  chart_init (&pie->chart, &piechart_class, var_to_string (var));
   pie->slices = xnmalloc (n_slices, sizeof *pie->slices);
   for (i = 0; i < n_slices; i++)
     {
@@ -50,7 +50,7 @@ piechart_create (const struct variable *var, const struct freq *slices, int n_sl
 
       ds_init_empty (&dst->label);
 
-      if ( var_is_value_missing (var, &src->values[0], MV_ANY))
+      if (var_is_value_missing (var, &src->values[0]))
        ds_assign_cstr (&dst->label, _("*MISSING*"));
       else
        var_append_value_name (var, &src->values[0], &dst->label);
@@ -63,13 +63,13 @@ piechart_create (const struct variable *var, const struct freq *slices, int n_sl
       dst->magnitude = src->count;
     }
   pie->n_slices = n_slices;
-  return &pie->chart_item;
+  return &pie->chart;
 }
 
 static void
-piechart_destroy (struct chart_item *chart_item)
+piechart_destroy (struct chart *chart)
 {
-  struct piechart *pie = to_piechart (chart_item);
+  struct piechart *pie = to_piechart (chart);
   int i;
 
   for (i = 0; i < pie->n_slices; i++)
@@ -81,7 +81,7 @@ piechart_destroy (struct chart_item *chart_item)
   free (pie);
 }
 
-const struct chart_item_class piechart_class =
+const struct chart_class piechart_class =
   {
     piechart_destroy
   };