diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-28 04:54:54 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-28 04:54:54 -0400 |
commit | 38122c22241cb8fe64f0d17cd3b084418f49edaa (patch) | |
tree | 9383f2082602f2d71dde5328fa8bcf3f6609a5b7 /src/error.cc | |
parent | fb129fa7a1b293d3a04513aee3ca4a489f094754 (diff) | |
download | fork-ledger-38122c22241cb8fe64f0d17cd3b084418f49edaa.tar.gz fork-ledger-38122c22241cb8fe64f0d17cd3b084418f49edaa.tar.bz2 fork-ledger-38122c22241cb8fe64f0d17cd3b084418f49edaa.zip |
Corrected warnings g++-4.3.3 was complaining about
Diffstat (limited to 'src/error.cc')
-rw-r--r-- | src/error.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/error.cc b/src/error.cc index 653980b4..8f78334a 100644 --- a/src/error.cc +++ b/src/error.cc @@ -77,12 +77,12 @@ string line_context(const string& line, return buf.str(); } -string source_context(const path& file, - std::size_t pos, - std::size_t end_pos, - const string& prefix) +string source_context(const path& file, + istream_pos_type pos, + istream_pos_type end_pos, + const string& prefix) { - std::size_t len = end_pos - pos; + std::streamoff len = end_pos - pos; if (! len || file == path("/dev/stdin")) return _("<no source context>"); @@ -95,9 +95,9 @@ string source_context(const path& file, in.seekg(pos, std::ios::beg); scoped_array<char> buf(new char[len + 1]); - in.read(buf.get(), len); + in.read(buf.get(), static_cast<int>(len)); assert(static_cast<std::size_t>(in.gcount()) == len); - buf[len] = '\0'; + buf[static_cast<int>(len)] = '\0'; bool first = true; for (char * p = std::strtok(buf.get(), "\n"); |