From d2a75c7bb4174423cc657ccf68539b233e22087d Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 13 Nov 2020 21:35:12 -0700 Subject: [PATCH] yaml-writer: constify --- libifupdown/yaml-writer.c | 8 ++++---- libifupdown/yaml-writer.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libifupdown/yaml-writer.c b/libifupdown/yaml-writer.c index 03a6cbd..6f6df94 100644 --- a/libifupdown/yaml-writer.c +++ b/libifupdown/yaml-writer.c @@ -22,9 +22,9 @@ static const size_t INDENT_WIDTH = 2; static void -lif_yaml_write_node(struct lif_yaml_node *node, FILE *f, size_t indent, bool type_annotations) +lif_yaml_write_node(const struct lif_yaml_node *node, FILE *f, size_t indent, bool type_annotations) { - struct lif_node *iter; + const struct lif_node *iter; if (node->name != NULL) fprintf(f, "%*s%s: ", (int) indent, "", node->name); @@ -50,7 +50,7 @@ lif_yaml_write_node(struct lif_yaml_node *node, FILE *f, size_t indent, bool typ LIF_LIST_FOREACH(iter, node->children.head) { - struct lif_yaml_node *iter_node = iter->data; + const struct lif_yaml_node *iter_node = iter->data; if (node->value_type == LIF_YAML_LIST) fprintf(f, "%*s-\n", (int) (child_indent - INDENT_WIDTH), ""); @@ -60,7 +60,7 @@ lif_yaml_write_node(struct lif_yaml_node *node, FILE *f, size_t indent, bool typ } void -lif_yaml_write(struct lif_yaml_node *doc, FILE *f, bool type_annotations) +lif_yaml_write(const struct lif_yaml_node *doc, FILE *f, bool type_annotations) { lif_yaml_write_node(doc, f, 0, type_annotations); } diff --git a/libifupdown/yaml-writer.h b/libifupdown/yaml-writer.h index 514809e..7772dc8 100644 --- a/libifupdown/yaml-writer.h +++ b/libifupdown/yaml-writer.h @@ -19,6 +19,6 @@ #include "libifupdown/libifupdown.h" #include "libifupdown/yaml-base.h" -extern void lif_yaml_write(struct lif_yaml_node *doc, FILE *f, bool type_annotations); +extern void lif_yaml_write(const struct lif_yaml_node *doc, FILE *f, bool type_annotations); #endif