X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=graphics.cc;h=ae1659e97b69b4cae05e1043d5ff0198345bac3c;hb=6e671e517740cb5d1b08973cee0ec71cc104a3f6;hp=5fdfb25d6ba434675d85dd0222736a8093d0344f;hpb=1ddaa7bdf04344661fa4d9339ee85f49cbbf3ad9;p=moebius.git diff --git a/graphics.cc b/graphics.cc index 5fdfb25..ae1659e 100644 --- a/graphics.cc +++ b/graphics.cc @@ -23,7 +23,8 @@ static int checkneededline(Onscreen a, Onscreen b) { void Cell::display(Output& o) { int nn[4]; int totalnn= 0; - for (int i=0; i<4; i++) { + int i; + for (i=0; i<4; i++) { nn[i]= checkneededline(p[i],p[(i+1)&3]); totalnn+= nn[i]; } @@ -55,7 +56,8 @@ SortedCellList::Fragment* SortedCellList::insertfragment(int at) { void SortedCellList::insert(Cell *it) { double index= it->index(); - for (int fragment= used-1; + int fragment; + for (fragment= used-1; fragment >= 0 && index < fragments[fragment]->entries[0].index; fragment--); if (fragment < 0) { @@ -65,7 +67,8 @@ void SortedCellList::insert(Cell *it) { nf->entries[0].cell= it; return; } - for (int entry= 0; + int entry; + for (entry= 0; entry < fragments[fragment]->used && index > fragments[fragment]->entries[entry].index; entry++);