pivot_table: Constness
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 16 Jul 2019 19:31:45 +0000 (21:31 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Mon, 22 Jul 2019 11:18:45 +0000 (13:18 +0200)
src/output/pivot-table.c
src/output/pivot-table.h

index dc15285b48b130d0eb94b9b5ca2e2d6c557cfb6b..bc57dd070f2e4e0a3cdf588fb34a2318aafcc0c4 100644 (file)
@@ -2062,7 +2062,7 @@ pivot_value_new_variable (const struct variable *variable)
 /* Attaches a reference to FOOTNOTE to V. */
 void
 pivot_value_add_footnote (struct pivot_value *v,
-                          struct pivot_footnote *footnote)
+                          const struct pivot_footnote *footnote)
 {
   v->footnotes = xrealloc (v->footnotes,
                            (v->n_footnotes + 1) * sizeof *v->footnotes);
@@ -2072,7 +2072,7 @@ pivot_value_add_footnote (struct pivot_value *v,
 /* If VALUE is a numeric value, and RC is a result class such as
    PIVOT_RC_COUNT, changes VALUE's format to the result class's. */
 void
-pivot_value_set_rc (struct pivot_table *table, struct pivot_value *value,
+pivot_value_set_rc (const struct pivot_table *table, struct pivot_value *value,
                     const char *rc)
 {
   if (value->type == PIVOT_VALUE_NUMERIC)
index 8ea20644059b87eb20b797cbcd7e0747c337f0ee..44fa757bc63f7dda8daa9064ddc231971ebd8878 100644 (file)
@@ -419,7 +419,7 @@ struct pivot_table
     time_t date;                /* May be 0 if unknown. */
 
     /* Footnotes. */
-    struct pivot_footnote **footnotes;
+    const struct pivot_footnote **footnotes;
     size_t n_footnotes, allocated_footnotes;
 
     /* Titles. */
@@ -590,7 +590,7 @@ struct pivot_value
     char *subscript;
     char *superscript;
 
-    struct pivot_footnote **footnotes;
+    const struct pivot_footnote **footnotes;
     size_t n_footnotes;
 
     enum pivot_value_type type;
@@ -671,10 +671,10 @@ struct pivot_value *pivot_value_new_user_text (const char *, size_t length);
 struct pivot_value *pivot_value_new_user_text_nocopy (char *);
 
 /* Footnotes. */
-void pivot_value_add_footnote (struct pivot_value *, struct pivot_footnote *);
+void pivot_value_add_footnote (struct pivot_value *, const struct pivot_footnote *);
 
 /* Numeric formats. */
-void pivot_value_set_rc (struct pivot_table *, struct pivot_value *,
+void pivot_value_set_rc (const struct pivot_table *, struct pivot_value *,
                          const char *rc);
 
 /* Converting a pivot_value to a string for display. */