From: José Fonseca Date: Sun, 11 Sep 2011 20:09:08 +0000 (+0100) Subject: Drop m_supportsSeeking. X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=42b10e40c2e96a65af0e4953ef351e240d3e8002;p=apitrace Drop m_supportsSeeking. Was only used in an assert, which typically already exists inside the File implementation. --- diff --git a/trace_parser.cpp b/trace_parser.cpp index e19d31f..a7268af 100644 --- a/trace_parser.cpp +++ b/trace_parser.cpp @@ -43,7 +43,6 @@ Parser::Parser() { file = NULL; next_call_no = 0; version = 0; - m_supportsSeeking = false; } @@ -63,7 +62,6 @@ bool Parser::open(const char *filename) { if (!file->open(filename, File::Read)) { return false; } - m_supportsSeeking = file->supportsOffsets(); version = read_uint(); if (version > TRACE_VERSION) { @@ -107,6 +105,18 @@ void Parser::close(void) { } +void Parser::getBookmark(ParseBookmark &bookmark) { + bookmark.offset = file->currentOffset(); + bookmark.next_call_no = next_call_no; +} + + +void Parser::setBookmark(const ParseBookmark &bookmark) { + file->setCurrentOffset(bookmark.offset); + next_call_no = bookmark.next_call_no; +} + + Call *Parser::parse_call(void) { do { int c = read_byte(); @@ -132,7 +142,6 @@ Call *Parser::parse_call(void) { Call * Parser::scan_call() { - assert(m_supportsSeeking); do { int c = read_byte(); switch(c) { diff --git a/trace_parser.hpp b/trace_parser.hpp index d76ffb4..9677184 100644 --- a/trace_parser.hpp +++ b/trace_parser.hpp @@ -78,8 +78,6 @@ protected: EnumMap enums; BitmaskMap bitmasks; - bool m_supportsSeeking; - unsigned next_call_no; public: @@ -100,15 +98,9 @@ public: return file->supportsOffsets(); } - void getBookmark(ParseBookmark &bookmark) { - bookmark.offset = file->currentOffset(); - bookmark.next_call_no = next_call_no; - } + void getBookmark(ParseBookmark &bookmark); - void setBookmark(const ParseBookmark &bookmark) { - file->setCurrentOffset(bookmark.offset); - next_call_no = bookmark.next_call_no; - } + void setBookmark(const ParseBookmark &bookmark); int percentRead() {