瀏覽代碼

Fix calculation of number of segments (round up instead of down)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32239 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 17 年之前
父節點
當前提交
5641e863c4
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      raster/r.cost/main.c

+ 1 - 1
raster/r.cost/main.c

@@ -339,7 +339,7 @@ int main(int argc, char *argv[])
     srows = scols = SEGCOLSIZE;
     if (maxmem > 0)
 	segments_in_memory =
-	    2 + maxmem * (nrows / SEGCOLSIZE) * (ncols / SEGCOLSIZE) / 100;
+	    2 + maxmem * (1 + nrows / SEGCOLSIZE) * (1 + ncols / SEGCOLSIZE) / 100;
     else
 	segments_in_memory = 4 * (nrows / SEGCOLSIZE + ncols / SEGCOLSIZE + 2);