diff options
author | Hieu Hoang <fishandfrolick@gmail.com> | 2013-01-20 15:52:18 +0400 |
---|---|---|
committer | Hieu Hoang <fishandfrolick@gmail.com> | 2013-01-20 15:52:18 +0400 |
commit | 8a3b93c72e7b24a6a1bf8a0fd409765539cbc507 (patch) | |
tree | 2b5872b17143965cde467b238dc3127c9b535b28 /lm | |
parent | b6fd7bf9947bcf738a7ffca7302b50502b211a69 (diff) |
compile error on mac
Diffstat (limited to 'lm')
-rw-r--r-- | lm/filter/arpa_io.cc | 6 | ||||
-rw-r--r-- | lm/filter/arpa_io.hh | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lm/filter/arpa_io.cc b/lm/filter/arpa_io.cc index caf8df953..51264f750 100644 --- a/lm/filter/arpa_io.cc +++ b/lm/filter/arpa_io.cc @@ -33,7 +33,7 @@ ARPAOutputException::ARPAOutputException(const char *message, const std::string const char *add = buf; if (!strerror_r(errno, buf, 1024)) { #else - const char *add = strerror_r(errno, buf, 1024); + int add = strerror_r(errno, buf, 1024); if (add) { #endif what_ += " :"; @@ -43,7 +43,7 @@ ARPAOutputException::ARPAOutputException(const char *message, const std::string } // Seeking is the responsibility of the caller. -void WriteCounts(std::ostream &out, const std::vector<size_t> &number) { +void WriteCounts(std::ostream &out, const std::vector<uint64_t> &number) { out << "\n\\data\\\n"; for (unsigned int i = 0; i < number.size(); ++i) { out << "ngram " << i+1 << "=" << number[i] << '\n'; @@ -51,7 +51,7 @@ void WriteCounts(std::ostream &out, const std::vector<size_t> &number) { out << '\n'; } -size_t SizeNeededForCounts(const std::vector<size_t> &number) { +size_t SizeNeededForCounts(const std::vector<uint64_t> &number) { std::ostringstream buf; WriteCounts(buf, number); return buf.tellp(); diff --git a/lm/filter/arpa_io.hh b/lm/filter/arpa_io.hh index 90f484473..2a9579cc5 100644 --- a/lm/filter/arpa_io.hh +++ b/lm/filter/arpa_io.hh @@ -48,7 +48,7 @@ class ARPAOutputException : public std::exception { }; // Handling for the counts of n-grams at the beginning of ARPA files. -size_t SizeNeededForCounts(const std::vector<size_t> &number); +size_t SizeNeededForCounts(const std::vector<uint64_t> &number); /* Writes an ARPA file. This has to be seekable so the counts can be written * at the end. Hence, I just have it own a std::fstream instead of accepting @@ -88,7 +88,7 @@ class ARPAOutput : boost::noncopyable { boost::scoped_array<char> buffer_; std::fstream file_; size_t fast_counter_; - std::vector<size_t> counts_; + std::vector<uint64_t> counts_; }; @@ -107,7 +107,7 @@ template <class Output> void ReadNGrams(util::FilePiece &in, unsigned int length } template <class Output> void ReadARPA(util::FilePiece &in_lm, Output &out) { - std::vector<size_t> number; + std::vector<uint64_t> number; ReadARPACounts(in_lm, number); out.ReserveForCounts(SizeNeededForCounts(number)); for (unsigned int i = 0; i < number.size(); ++i) { |