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
This commit is contained in:
heafield 2011-06-27 21:28:22 +00:00
parent 3616cf09fb
commit 025ab3f7f0
2 changed files with 2 additions and 2 deletions

View File

@ -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]);

View File

@ -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) {