commit 7542ac561004749bfad51db1b9d83a6b0b171ee3
parent dbfa2759749944ec0871c2a3f2210629e4e6d144
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 8 Apr 2026 09:03:57 +0200
Rename the function sln_node_get_lines_count
Remove the "s" from "line", because it is not the word "line" that is
the subject of "count" but rather the quantity being counted.
Diffstat:
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/sln.h b/src/sln.h
@@ -309,7 +309,7 @@ sln_node_get_child
const unsigned ichild); /* 0 or 1 */
SLN_API size_t
-sln_node_get_lines_count
+sln_node_get_line_count
(const struct sln_node* node);
SLN_API res_T
diff --git a/src/sln_tree.c b/src/sln_tree.c
@@ -608,7 +608,7 @@ sln_node_get_child(const struct sln_node* node, const unsigned ichild)
}
size_t
-sln_node_get_lines_count(const struct sln_node* node)
+sln_node_get_line_count(const struct sln_node* node)
{
ASSERT(node);
return node->range[1] - node->range[0] + 1/*Both boundaries are inclusives*/;
@@ -621,7 +621,7 @@ sln_node_get_line
const size_t iline,
struct shtr_line* line)
{
- if(!tree || !node || iline > sln_node_get_lines_count(node))
+ if(!tree || !node || iline > sln_node_get_line_count(node))
return RES_BAD_ARG;
return shtr_line_list_at
diff --git a/src/test_sln_tree.c b/src/test_sln_tree.c
@@ -97,7 +97,7 @@ check_tree
node = sln_tree_get_root(tree);
while(node) {
if(!sln_node_is_leaf(node)) {
- CHK(sln_node_get_lines_count(node) > desc.max_nlines_per_leaf);
+ CHK(sln_node_get_line_count(node) > desc.max_nlines_per_leaf);
ASSERT(istack < STACK_SIZE);
stack[istack++] = sln_node_get_child(node, 1); /* Push the child 1 */
@@ -106,7 +106,7 @@ check_tree
} else {
size_t iline, nlines;
- nlines = sln_node_get_lines_count(node);
+ nlines = sln_node_get_line_count(node);
CHK(nlines <= desc.max_nlines_per_leaf);
FOR_EACH(iline, 0, nlines) {
struct shtr_line line = SHTR_LINE_NULL;
@@ -207,7 +207,7 @@ test_tree
node_desc = node_desc_next;
}
- CHK(sln_node_get_lines_count(node) <= desc.max_nlines_per_leaf);
+ CHK(sln_node_get_line_count(node) <= desc.max_nlines_per_leaf);
CHK(sln_node_get_line(NULL, node, 0, &line) == RES_BAD_ARG);
CHK(sln_node_get_line(tree, NULL, 0, &line) == RES_BAD_ARG);
CHK(sln_node_get_line(tree, node, desc.max_nlines_per_leaf+1, &line)
@@ -275,8 +275,8 @@ check_node_equality
CHK(node1 && node2);
CHK(sln_node_is_leaf(node1) == sln_node_is_leaf(node2));
- CHK(sln_node_get_lines_count(node1) == sln_node_get_lines_count(node2));
- nlines = sln_node_get_lines_count(node1);
+ CHK(sln_node_get_line_count(node1) == sln_node_get_line_count(node2));
+ nlines = sln_node_get_line_count(node1);
FOR_EACH(iline, 0, nlines) {
struct shtr_line line1 = SHTR_LINE_NULL;