[GRASS-SVN] r34457 - grass-addons/raster/r.sun_horizon/r.sun2

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Nov 23 18:02:21 EST 2008


Author: neteler
Date: 2008-11-23 18:02:21 -0500 (Sun, 23 Nov 2008)
New Revision: 34457

Modified:
   grass-addons/raster/r.sun_horizon/r.sun2/main.c
Log:
(hopefully) fix overflow with large DEMs

Modified: grass-addons/raster/r.sun_horizon/r.sun2/main.c
===================================================================
--- grass-addons/raster/r.sun_horizon/r.sun2/main.c	2008-11-23 21:12:40 UTC (rev 34456)
+++ grass-addons/raster/r.sun_horizon/r.sun2/main.c	2008-11-23 23:02:21 UTC (rev 34457)
@@ -122,7 +122,7 @@
 int n, m, ip, jp;
 int d, day;
 int saveMemory, numPartitions = 1;
-int shadowoffset = 0;
+long int shadowoffset = 0;
 int varCount_global = 0;
 int bitCount_global = 0;
 int arrayNumInt = 1;
@@ -960,7 +960,7 @@
 		row_rev = m - row - 1;
 		rowrevoffset = row_rev - offset;
 		G_get_f_raster_row(fd_shad[i], horizonbuf[i], row);
-		horizonpointer = horizonarray + arrayNumInt * n * rowrevoffset;
+		horizonpointer = horizonarray + (ssize_t) arrayNumInt * n * rowrevoffset;
 		for (j = 0; j < n; j++) {
 
 		    horizonpointer[i] = (char)(rint(SCALING_FACTOR *



More information about the grass-commit mailing list