Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lm/filter/arpa_io.cc6
-rw-r--r--lm/filter/arpa_io.hh6
-rw-r--r--util/stream/sort.hh4
3 files changed, 8 insertions, 8 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) {
diff --git a/util/stream/sort.hh b/util/stream/sort.hh
index be6c11eaf..f25993129 100644
--- a/util/stream/sort.hh
+++ b/util/stream/sort.hh
@@ -325,8 +325,8 @@ template <class Compare, class Combine> class MergingReader {
private:
Offsets *out_offsets_;
- std::size_t buffer_size_;
- std::size_t total_memory_;
+ uint64_t buffer_size_;
+ uint64_t total_memory_;
};
// The lazy step owns the remaining files. This keeps track of them.