diff options
author | Igor Gnatenko | 2016-09-21 08:30:48 +0200 |
---|---|---|
committer | Igor Gnatenko | 2016-09-21 08:36:00 +0200 |
commit | f7a9ea28eff5c71b6fd07b49b16d14bdecaeb4f0 (patch) | |
tree | 888103c32f6ea3749b1cb2e74f204e4ab02b13e5 /libsmartcols/src/line.c | |
parent | debug: use const void * for ul_debugobj() (diff) | |
download | kernel-qcow2-util-linux-f7a9ea28eff5c71b6fd07b49b16d14bdecaeb4f0.tar.gz kernel-qcow2-util-linux-f7a9ea28eff5c71b6fd07b49b16d14bdecaeb4f0.tar.xz kernel-qcow2-util-linux-f7a9ea28eff5c71b6fd07b49b16d14bdecaeb4f0.zip |
libsmartcols: use const qualifier where it's possible
Closes: https://github.com/karelzak/util-linux/issues/355
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Diffstat (limited to 'libsmartcols/src/line.c')
-rw-r--r-- | libsmartcols/src/line.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libsmartcols/src/line.c b/libsmartcols/src/line.c index f3abb1401..59ea0d1e0 100644 --- a/libsmartcols/src/line.c +++ b/libsmartcols/src/line.c @@ -71,7 +71,6 @@ void scols_ref_line(struct libscols_line *ln) */ void scols_unref_line(struct libscols_line *ln) { - if (ln && --ln->refcount <= 0) { DBG(CELL, ul_debugobj(ln, "dealloc")); list_del(&ln->ln_lines); @@ -235,7 +234,7 @@ int scols_line_add_child(struct libscols_line *ln, struct libscols_line *child) * * Returns: a pointer to @ln's parent, NULL in case it has no parent or if there was an error. */ -struct libscols_line *scols_line_get_parent(struct libscols_line *ln) +struct libscols_line *scols_line_get_parent(const struct libscols_line *ln) { return ln ? ln->parent : NULL; } @@ -304,7 +303,7 @@ int scols_line_set_color(struct libscols_line *ln, const char *co) * * Returns: @ln's color string, NULL in case of an error. */ -const char *scols_line_get_color(struct libscols_line *ln) +const char *scols_line_get_color(const struct libscols_line *ln) { return ln->color; } @@ -315,7 +314,7 @@ const char *scols_line_get_color(struct libscols_line *ln) * * Returns: number of cells */ -size_t scols_line_get_ncells(struct libscols_line *ln) +size_t scols_line_get_ncells(const struct libscols_line *ln) { return ln->ncells; } @@ -432,7 +431,7 @@ int scols_line_refer_column_data(struct libscols_line *ln, * * Returns: A newly allocated copy of @ln, NULL in case of an error. */ -struct libscols_line *scols_copy_line(struct libscols_line *ln) +struct libscols_line *scols_copy_line(const struct libscols_line *ln) { struct libscols_line *ret; size_t i; |