From 9bd8bde378997bf189e6aceffe3da5d321d0a837 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 16 Jul 2019 21:31:45 +0200 Subject: [PATCH] pivot_table: Constness --- src/output/pivot-table.c | 4 ++-- src/output/pivot-table.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/output/pivot-table.c b/src/output/pivot-table.c index dc15285b48..bc57dd070f 100644 --- a/src/output/pivot-table.c +++ b/src/output/pivot-table.c @@ -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) diff --git a/src/output/pivot-table.h b/src/output/pivot-table.h index 8ea2064405..44fa757bc6 100644 --- a/src/output/pivot-table.h +++ b/src/output/pivot-table.h @@ -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. */ -- 2.30.2