[GRASS-SVN] r39893 - grass/trunk/lib/segment

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 4 05:33:31 EST 2009


Author: mmetz
Date: 2009-12-04 05:33:30 -0500 (Fri, 04 Dec 2009)
New Revision: 39893

Modified:
   grass/trunk/lib/segment/setup.c
Log:
safety margin for rare rounding error

Modified: grass/trunk/lib/segment/setup.c
===================================================================
--- grass/trunk/lib/segment/setup.c	2009-12-04 09:07:21 UTC (rev 39892)
+++ grass/trunk/lib/segment/setup.c	2009-12-04 10:33:30 UTC (rev 39893)
@@ -59,8 +59,8 @@
     SEG->slow_adrs = 1;
     if (SEG->scols - pow(2, (log(SEG->scols) / log(2))) == 0) {
 	if (SEG->srows - pow(2, (log(SEG->srows) / log(2))) == 0) {
-	    SEG->scolbits = log(SEG->scols) / log(2);
-	    SEG->srowbits = log(SEG->srows) / log(2);
+	    SEG->scolbits = log(SEG->scols) / log(2) + 0.1;
+	    SEG->srowbits = log(SEG->srows) / log(2) + 0.1;
 	    SEG->segbits = SEG->srowbits + SEG->scolbits;
 	    SEG->slow_adrs = 0;
 	    G_debug(1, "segment lib: fast address activated");
@@ -70,7 +70,7 @@
     SEG->slow_seek = 1;
     if (SEG->slow_adrs == 0) {
 	if (SEG->len - pow(2, (log(SEG->len) / log(2))) == 0) {
-	    SEG->lenbits = log(SEG->len) / log(2);
+	    SEG->lenbits = log(SEG->len) / log(2) + 0.1;
 	    SEG->sizebits = SEG->segbits + SEG->lenbits;
 	    SEG->slow_seek = 0;
 	    G_debug(1, "segment lib: fast seek activated");



More information about the grass-commit mailing list