diff options
author | heafield <heafield@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-06-28 01:28:22 +0400 |
---|---|---|
committer | heafield <heafield@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-06-28 01:28:22 +0400 |
commit | 025ab3f7f0b06749b4be965e72b9b6369d35b8c1 (patch) | |
tree | 52bff2bfe909301d4e8ed5a70140e2c49e6d4cda /kenlm | |
parent | 3616cf09fb7240a6f0ec93656fc753e3ee0d9315 (diff) |
Sorry I used a GCC-only dynamically sized array
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@4041 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'kenlm')
-rw-r--r-- | kenlm/lm/search_trie.cc | 2 | ||||
-rw-r--r-- | kenlm/util/sorted_uniform.hh | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/kenlm/lm/search_trie.cc b/kenlm/lm/search_trie.cc index 71688be58..91f87f1c8 100644 --- a/kenlm/lm/search_trie.cc +++ b/kenlm/lm/search_trie.cc @@ -916,7 +916,7 @@ template <class Quant> uint8_t *TrieSearch<Quant>::SetupMemory(uint8_t *start, c FreeMiddles(); middle_begin_ = static_cast<Middle*>(malloc(sizeof(Middle) * (counts.size() - 2))); middle_end_ = middle_begin_ + (counts.size() - 2); - uint8_t *middle_starts[counts.size() - 2]; + std::vector<uint8_t*> middle_starts(counts.size() - 2); for (unsigned char i = 2; i < counts.size(); ++i) { middle_starts[i-2] = start; start += Middle::Size(Quant::MiddleBits(config), counts[i-1], counts[0], counts[i]); diff --git a/kenlm/util/sorted_uniform.hh b/kenlm/util/sorted_uniform.hh index 9d5f678a5..84d7aa024 100644 --- a/kenlm/util/sorted_uniform.hh +++ b/kenlm/util/sorted_uniform.hh @@ -67,7 +67,7 @@ template <class Iterator, class Accessor, class Pivot> bool BoundedSortedUniform Iterator before_it, typename Accessor::Key before_v, Iterator after_it, typename Accessor::Key after_v, const typename Accessor::Key key, Iterator &out) { - while (after_it > before_it + 1) { + while (after_it - before_it > 1) { Iterator pivot(before_it + (1 + Pivot::Calc(key - before_v, after_v - before_v, after_it - before_it - 1))); typename Accessor::Key mid(accessor(pivot)); if (mid < key) { |