mirror of
https://github.com/biojppm/rapidyaml.git
synced 2026-01-18 21:41:18 +01:00
fix more clang-tidy problems
This commit is contained in:
@@ -23,6 +23,8 @@ namespace yml {
|
||||
struct LineCol
|
||||
{
|
||||
size_t offset, line, col;
|
||||
LineCol() : offset(), line(), col() {}
|
||||
LineCol(size_t o, size_t l, size_t c) : offset(o), line(o), col(c) {}
|
||||
};
|
||||
|
||||
struct Location : public LineCol
|
||||
@@ -30,17 +32,10 @@ struct Location : public LineCol
|
||||
const char *name;
|
||||
operator bool () const { return name != nullptr || line != 0 || offset != 0; }
|
||||
|
||||
Location() : LineCol{0, 0, 0}, name(nullptr) {}
|
||||
Location() : LineCol(), name(nullptr) {}
|
||||
Location(const char *n, size_t b, size_t l, size_t c) : LineCol{b, l, c}, name(n) {}
|
||||
};
|
||||
|
||||
struct Region
|
||||
{
|
||||
const char *name;
|
||||
LineCol begin;
|
||||
LineCol end;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -206,7 +206,7 @@ case YAML_ ## _ev ## _EVENT: \
|
||||
if(m_parser.context)
|
||||
{
|
||||
auto const& m = m_parser.context_mark;
|
||||
context_loc = Location(m_parser.problem, m.index, m.line+1, m.column+1);
|
||||
context_loc = Location(m_parser.context, m.index, m.line+1, m.column+1);
|
||||
}
|
||||
|
||||
switch(m_parser.error)
|
||||
|
||||
@@ -176,7 +176,7 @@ void print_path(NodeRef const& n)
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t pos = p.parent().child_pos(p);
|
||||
pos = p.parent().child_pos(p);
|
||||
size_t tl = snprintf(buf, 0, "/%zd", pos);
|
||||
pos -= snprintf(buf + pos - tl, tl, "/%zd", pos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user