fix more clang-tidy problems

This commit is contained in:
Joao Paulo Magalhaes
2018-02-09 19:28:45 +00:00
parent 62e33fe53b
commit f466314246
3 changed files with 5 additions and 10 deletions

View File

@@ -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;
};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@@ -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)

View File

@@ -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);
}