X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Foutput%2Fcharts%2Fboxplot.h;h=cd6b0961c6f683cae6407114951f665763e26142;hb=507ebaea36737618ef8265a60cd3e9005d9f3457;hp=bd5a7a32379b3b029babb89718b53908851f13eb;hpb=d0b91eae59319ab2756d0d43b9cb15eb9cd3c234;p=pspp diff --git a/src/output/charts/boxplot.h b/src/output/charts/boxplot.h index bd5a7a3237..cd6b0961c6 100644 --- a/src/output/charts/boxplot.h +++ b/src/output/charts/boxplot.h @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2004, 2009 Free Software Foundation, Inc. + Copyright (C) 2004, 2009, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,12 +18,12 @@ #define OUTPUT_CHARTS_BOXPLOT_H 1 #include -#include +#include "output/chart.h" /* Box-whiskers plot. */ struct boxplot { - struct chart_item chart_item; + struct chart chart; /* Data. */ struct boxplot_box *boxes; @@ -45,17 +45,17 @@ struct boxplot *boxplot_create (double y_min, double y_max, const char *title); void boxplot_add_box (struct boxplot *, struct box_whisker *, const char *label); -/* This boilerplate for boxplot, a subclass of chart_item, was +/* This boilerplate for boxplot, a subclass of chart, was autogenerated by mk-class-boilerplate. */ #include -#include +#include "libpspp/cast.h" -extern const struct chart_item_class boxplot_class; +extern const struct chart_class boxplot_class; /* Returns true if SUPER is a boxplot, otherwise false. */ static inline bool -is_boxplot (const struct chart_item *super) +is_boxplot (const struct chart *super) { return super->class == &boxplot_class; } @@ -63,24 +63,24 @@ is_boxplot (const struct chart_item *super) /* Returns SUPER converted to boxplot. SUPER must be a boxplot, as reported by is_boxplot. */ static inline struct boxplot * -to_boxplot (const struct chart_item *super) +to_boxplot (const struct chart *super) { assert (is_boxplot (super)); - return UP_CAST (super, struct boxplot, chart_item); + return UP_CAST (super, struct boxplot, chart); } -/* Returns INSTANCE converted to chart_item. */ -static inline struct chart_item * +/* Returns INSTANCE converted to chart. */ +static inline struct chart * boxplot_super (const struct boxplot *instance) { - return CONST_CAST (struct chart_item *, &instance->chart_item); + return CONST_CAST (struct chart *, &instance->chart); } /* Increments INSTANCE's reference count and returns INSTANCE. */ static inline struct boxplot * boxplot_ref (const struct boxplot *instance) { - return to_boxplot (chart_item_ref (&instance->chart_item)); + return to_boxplot (chart_ref (&instance->chart)); } /* Decrements INSTANCE's reference count, then destroys INSTANCE if @@ -88,7 +88,7 @@ boxplot_ref (const struct boxplot *instance) static inline void boxplot_unref (struct boxplot *instance) { - chart_item_unref (&instance->chart_item); + chart_unref (&instance->chart); } /* Returns true if INSTANCE's reference count is greater than 1, @@ -96,13 +96,13 @@ boxplot_unref (struct boxplot *instance) static inline bool boxplot_is_shared (const struct boxplot *instance) { - return chart_item_is_shared (&instance->chart_item); + return chart_is_shared (&instance->chart); } static inline void boxplot_submit (struct boxplot *instance) { - chart_item_submit (&instance->chart_item); + chart_submit (&instance->chart); } #endif /* output/charts/boxplot.h */