diff options
author | Sebastian Geerken <devnull@localhost> | 2013-05-28 23:54:19 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-05-28 23:54:19 +0200 |
commit | 12e396c3f0d738a914bc406c3a1bb49b01361153 (patch) | |
tree | b0a741704a4c98f357ea11328c7e936204f0a35a | |
parent | d293f3d2a7285effd21c036ff66d7b4cb8af066c (diff) |
Debugging messages.
-rw-r--r-- | dw/outofflowmgr.cc | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc index 343a8b0f..7d92d957 100644 --- a/dw/outofflowmgr.cc +++ b/dw/outofflowmgr.cc @@ -188,29 +188,34 @@ int OutOfFlowMgr::SortedFloatsVector::findFloatIndex (Textblock *lastGB, Float::CompareGBAndExtIndex cmp (oofm); int i = bsearch (&key, false, &cmp); - //printf ("[%p] findFloatIndex (%p, %d) => i = %d (of %d)\n", - // oofm->containingBlock, lastGB, lastExtIndex, i, size ()); - - //for (int i = 0; i < size (); i++) { - // Float *f = get(i); - // TBInfo *t = oofm->getTextblock(f->generatingBlock); - // printf (" %d: (%p [%d, %p], %d)\n", i, f->generatingBlock, - // t->index, t->parent ? t->parent->textblock : NULL, - // get(i)->externalIndex); - //} - // At position i is the next larger element, so element i should // not included, but i - 1 returned; except if the exact element is // found: then include it and so return i. + int r; if (i == size()) - return i - 1; + r = i - 1; else { Float *f = get (i); if (cmp.compare (f, &key) == 0) - return i; + r = i; else - return i - 1; + r = i - 1; } + + //printf ("[%p] findFloatIndex (%p, %d) => i = %d, r = %d (size = %d); " + // "in %s list %p on the %s side\n", + // oofm->containingBlock, lastGB, lastExtIndex, i, r, size (), + // type == GB ? "GB" : "CB", this, side == LEFT ? "left" : "right"); + + //for (int i = 0; i < size (); i++) { + // Float *f = get(i); + // TBInfo *t = oofm->getTextblock(f->generatingBlock); + // printf (" %d: (%p [%d, %p], %d)\n", i, f->generatingBlock, + // t->index, t->parent ? t->parent->textblock : NULL, + // get(i)->externalIndex); + //} + + return r; } int OutOfFlowMgr::SortedFloatsVector::find (Textblock *textblock, int y, |