Rename names that Flawfinder takes for the file function open()

The comparison cursors' open() is now enter(), and a test's open and
close strings are head and tail.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-22 13:27:54 +02:00
1 parent 3fb7d9c710
commit 89bd5d63e1
3 files changed
+15 -15

No files matched your search

+4 -4
View File
@@ -357,7 +357,7 @@ class view_side
}
/// start at the first element of this array
void open(cursor& c) const noexcept
void enter(cursor& c) const noexcept
{
c.pos = nav::first(*m_view.m_doc, m_view.m_node);
}
@@ -466,7 +466,7 @@ class json_side
return *m_json;
}
void open(cursor& c) const
void enter(cursor& c) const
{
c.it = m_json->cbegin();
}
@@ -967,8 +967,8 @@ bool equal(const A& a0, const B& b0)
{
f.array_a = a;
f.array_b = b;
a.open(f.cursor_a);
b.open(f.cursor_b);
a.enter(f.cursor_a);
b.enter(f.cursor_b);
f.count = a.size();
resume_array(path, a, b, f.cursor_a, f.cursor_b, f.next);
}
+4 -4
View File
@@ -3045,7 +3045,7 @@ class view_side
}
/// start at the first element of this array
void open(cursor& c) const noexcept
void enter(cursor& c) const noexcept
{
c.pos = nav::first(*m_view.m_doc, m_view.m_node);
}
@@ -3154,7 +3154,7 @@ class json_side
return *m_json;
}
void open(cursor& c) const
void enter(cursor& c) const
{
c.it = m_json->cbegin();
}
@@ -3655,8 +3655,8 @@ bool equal(const A& a0, const B& b0)
{
f.array_a = a;
f.array_b = b;
a.open(f.cursor_a);
b.open(f.cursor_b);
a.enter(f.cursor_a);
b.enter(f.cursor_b);
f.count = a.size();
resume_array(path, a, b, f.cursor_a, f.cursor_b, f.next);
}
+7 -7
View File
@@ -421,17 +421,17 @@ TEST_CASE("json_view comparison")
})
{
CAPTURE(depth)
std::string open;
std::string close;
std::string head;
std::string tail;
for (int i = 0; i < depth; ++i)
{
open += i % 2 == 0 ? R"({"k":[1,"s",{"x":true},)" : R"([null,2.5,{"y":)";
close = (i % 2 == 0 ? "]}" : "}]") + close;
head += i % 2 == 0 ? R"({"k":[1,"s",{"x":true},)" : R"([null,2.5,{"y":)";
tail = (i % 2 == 0 ? "]}" : "}]") + tail;
}
// the same text, one number changed, and one number written differently
const std::string text = open + "7" + close;
const std::string changed = open + "8" + close;
const std::string spelled = open + "7.0" + close;
const std::string text = head + "7" + tail;
const std::string changed = head + "8" + tail;
const std::string spelled = head + "7.0" + tail;
const json_document a = json_document::parse(text);
const json_document b = json_document::parse(text);
const json_document c = json_document::parse(changed);