X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Ftable-select.c;h=00d0ee99318434ff1d357577105e0199541fadc9;hb=8e98d2ec1b1620280d66820e323d82b00975374e;hp=1c2956a819bc8744149c028f69f6bce4181ad279;hpb=d0b91eae59319ab2756d0d43b9cb15eb9cd3c234;p=pspp diff --git a/src/output/table-select.c b/src/output/table-select.c index 1c2956a819..00d0ee9931 100644 --- a/src/output/table-select.c +++ b/src/output/table-select.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010, 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 @@ -16,9 +16,9 @@ #include -#include -#include -#include +#include "libpspp/assertion.h" +#include "libpspp/cast.h" +#include "output/table-provider.h" #include "gl/minmax.h" #include "gl/xalloc.h" @@ -35,7 +35,7 @@ static const struct table_class table_select_class; static struct table_select * table_select_cast (const struct table *table) { - assert (table->class == &table_select_class); + assert (table->klass == &table_select_class); return UP_CAST (table, struct table_select, table); } @@ -55,9 +55,9 @@ table_select (struct table *subtable, int rect[TABLE_N_AXES][2]) && rect[TABLE_VERT][1] == subtable->n[TABLE_VERT]) return subtable; - if (!table_is_shared (subtable) && subtable->class->select != NULL) + if (!table_is_shared (subtable) && subtable->klass->select != NULL) { - struct table *selected = subtable->class->select (subtable, rect); + struct table *selected = subtable->klass->select (subtable, rect); if (selected != NULL) return selected; } @@ -97,7 +97,8 @@ table_select_slice (struct table *subtable, enum table_axis axis, if (add_headers) { - if (z0 == subtable->h[axis][0] && z1 == subtable->h[axis][1]) + if (z0 == subtable->h[axis][0] + && z1 == subtable->n[axis] - subtable->h[axis][1]) return subtable; if (subtable->h[axis][0])