diff --git a/src/SourceLocation.cc b/src/SourceLocation.cc index 076e66a..a788be9 100644 --- a/src/SourceLocation.cc +++ b/src/SourceLocation.cc @@ -20,9 +20,9 @@ std::string clangmm::SourceLocation::get_path() { return path; } clangmm::Offset clangmm::SourceLocation::get_offset() { - unsigned line, index, offset; - get_data(nullptr, &line, &index, &offset); - return {line, index, offset}; + unsigned line, index; + get_data(nullptr, &line, &index, nullptr); + return {line, index}; } void clangmm::SourceLocation::get_data(std::string* path, unsigned *line, unsigned *column, unsigned *offset) { diff --git a/src/SourceLocation.h b/src/SourceLocation.h index a46e366..930d930 100644 --- a/src/SourceLocation.h +++ b/src/SourceLocation.h @@ -6,11 +6,10 @@ namespace clangmm { class Offset { public: - bool operator==(const clangmm::Offset &o) {return offset==o.offset;} + bool operator==(const clangmm::Offset &o) {return line==o.line && index==o.index;} bool operator!=(const clangmm::Offset &o) {return !(*this==o);} unsigned line; unsigned index; //byte index in line (not char number) - unsigned offset; }; class SourceLocation {