src/output/table.h: Rename class -> klass 20130811030503/pspp
authorJohn Darrington <john@darrington.wattle.id.au>
Wed, 7 Aug 2013 17:07:25 +0000 (19:07 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 11 Aug 2013 07:13:07 +0000 (09:13 +0200)
This makes it possible to include this file in C++ compiled programs.

src/output/tab.c
src/output/table-casereader.c
src/output/table-paste.c
src/output/table-select.c
src/output/table-transpose.c
src/output/table.c
src/output/table.h

index bc4ac534d0a30bb8d9ece455c79d1c5f414a063c..6f2a0051bb7c7bdcb4da666820d2237a8cd3780c 100644 (file)
@@ -767,6 +767,6 @@ static const struct table_class tab_table_class =
 struct tab_table *
 tab_cast (const struct table *table)
 {
-  assert (table->class == &tab_table_class);
+  assert (table->klass == &tab_table_class);
   return UP_CAST (table, struct tab_table, table);
 }
index 672dd87f49bc74200400fff3d4a978547af3f3b1..5d5154ef40c691eb871ef548b91e6bcef2572d7f 100644 (file)
@@ -38,7 +38,7 @@ static const struct table_class table_casereader_class;
 static struct table_casereader *
 table_casereader_cast (const struct table *table)
 {
-  assert (table->class == &table_casereader_class);
+  assert (table->klass == &table_casereader_class);
   return UP_CAST (table, struct table_casereader, table);
 }
 
index 5f6d3f83e0e9a0e4f5e5ab39e97e27954c6ad31b..ad32de7276e52d606339d46ba5ef5d8925967b7a 100644 (file)
@@ -47,14 +47,14 @@ static const struct table_class table_paste_class;
 static struct table_paste *
 table_paste_cast (const struct table *table)
 {
-  assert (table->class == &table_paste_class);
+  assert (table->klass == &table_paste_class);
   return UP_CAST (table, struct table_paste, table);
 }
 
 static bool
 is_table_paste (const struct table *table, int orientation)
 {
-  return (table->class == &table_paste_class
+  return (table->klass == &table_paste_class
           && table_paste_cast (table)->orientation == orientation);
 }
 
@@ -151,15 +151,15 @@ table_paste (struct table *a, struct table *b, enum table_axis orientation)
   /* Handle tables that know how to paste themselves. */
   if (!table_is_shared (a) && !table_is_shared (b) && a != b)
     {
-      if (a->class->paste != NULL)
+      if (a->klass->paste != NULL)
         {
-          struct table *new = a->class->paste (a, b, orientation);
+          struct table *new = a->klass->paste (a, b, orientation);
           if (new != NULL)
             return new;
         }
-      if (b->class->paste != NULL && a->class != b->class)
+      if (b->klass->paste != NULL && a->klass != b->klass)
         {
-          struct table *new = b->class->paste (a, b, orientation);
+          struct table *new = b->klass->paste (a, b, orientation);
           if (new != NULL)
             return new;
         }
index dcc6b7de2af8c8a4ead62190a532fd96d8d83c56..00d0ee99318434ff1d357577105e0199541fadc9 100644 (file)
@@ -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;
     }
index 3dd862026274e3185dc18e4ab27e2a44d9e264be..f2db939f5a012246ec9424ec71417e0a462aeebf 100644 (file)
@@ -34,7 +34,7 @@ static const struct table_class table_transpose_class;
 static struct table_transpose *
 table_transpose_cast (const struct table *table)
 {
-  assert (table->class == &table_transpose_class);
+  assert (table->klass == &table_transpose_class);
   return UP_CAST (table, struct table_transpose, table);
 }
 
@@ -46,7 +46,7 @@ table_transpose (struct table *subtable)
   if (subtable->n[TABLE_HORZ] == subtable->n[TABLE_VERT]
       && subtable->n[TABLE_HORZ] <= 1)
     return subtable;
-  else if (subtable->class == &table_transpose_class)
+  else if (subtable->klass == &table_transpose_class)
     {
       struct table_transpose *tt = table_transpose_cast (subtable);
       struct table *table = table_ref (tt->subtable);
index bd51f494033ad346d3377e3f25e00db9e536a559..e9abca85e34012c13f048ee08f688dcfcffe85f1 100644 (file)
@@ -47,7 +47,7 @@ table_unref (struct table *table)
     {
       assert (table->ref_cnt > 0);
       if (--table->ref_cnt == 0)
-        table->class->destroy (table);
+        table->klass->destroy (table);
     }
 }
 
@@ -104,7 +104,7 @@ table_set_hb (struct table *table, int hb)
 void
 table_init (struct table *table, const struct table_class *class)
 {
-  table->class = class;
+  table->klass = class;
   table->n[TABLE_HORZ] = table->n[TABLE_VERT] = 0;
   table->h[TABLE_HORZ][0] = table->h[TABLE_HORZ][1] = 0;
   table->h[TABLE_VERT][0] = table->h[TABLE_VERT][1] = 0;
@@ -138,7 +138,7 @@ table_get_cell (const struct table *table, int x, int y,
 {
   assert (x >= 0 && x < table->n[TABLE_HORZ]);
   assert (y >= 0 && y < table->n[TABLE_VERT]);
-  table->class->get_cell (table, x, y, cell);
+  table->klass->get_cell (table, x, y, cell);
 }
 
 /* Frees CELL, which should have been initialized by calling
@@ -192,7 +192,7 @@ table_get_rule (const struct table *table, enum table_axis axis, int x, int y)
 {
   assert (x >= 0 && x < table->n[TABLE_HORZ] + (axis == TABLE_HORZ));
   assert (y >= 0 && y < table->n[TABLE_VERT] + (axis == TABLE_VERT));
-  return table->class->get_rule (table, axis, x, y);
+  return table->klass->get_rule (table, axis, x, y);
 }
 \f
 struct table_unshared
@@ -233,7 +233,7 @@ table_unshare (struct table *table)
 static struct table_unshared *
 table_unshared_cast (const struct table *table)
 {
-  assert (table->class == &table_unshared_class);
+  assert (table->klass == &table_unshared_class);
   return UP_CAST (table, struct table_unshared, table);
 }
 
@@ -295,7 +295,7 @@ table_from_string (unsigned int options, const char *s)
 static struct table_string *
 table_string_cast (const struct table *table)
 {
-  assert (table->class == &table_string_class);
+  assert (table->klass == &table_string_class);
   return UP_CAST (table, struct table_string, table);
 }
 
index 06427ac32b75bac0d91670840c3a10c4307b8484..e245b72760facc0ff02798b09bff4095716dbfdb 100644 (file)
@@ -102,7 +102,7 @@ enum table_axis
 /* A table. */
 struct table
   {
-    const struct table_class *class;
+    const struct table_class *klass;
 
     /* Table size.