[GRASS-SVN] r52045 - grass/trunk/lib/gmath

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jun 12 05:12:38 PDT 2012


Author: mmetz
Date: 2012-06-12 05:12:35 -0700 (Tue, 12 Jun 2012)
New Revision: 52045

Modified:
   grass/trunk/lib/gmath/dalloc.c
   grass/trunk/lib/gmath/ialloc.c
Log:
size_t: update gmath lib

Modified: grass/trunk/lib/gmath/dalloc.c
===================================================================
--- grass/trunk/lib/gmath/dalloc.c	2012-06-12 12:08:33 UTC (rev 52044)
+++ grass/trunk/lib/gmath/dalloc.c	2012-06-12 12:12:35 UTC (rev 52045)
@@ -63,7 +63,7 @@
     int i;
 
     m = (double **)G_calloc(rows, sizeof(double *));
-    m[0] = (double *)G_calloc(rows * cols, sizeof(double));
+    m[0] = (double *)G_calloc((size_t) rows * cols, sizeof(double));
     for (i = 1; i < rows; i++)
 	m[i] = m[i - 1] + cols;
 
@@ -107,7 +107,7 @@
     int i;
 
     m = (float **)G_calloc(rows, sizeof(float *));
-    m[0] = (float *)G_calloc(rows * cols, sizeof(float));
+    m[0] = (float *)G_calloc((size_t) rows * cols, sizeof(float));
     for (i = 1; i < rows; i++)
 	m[i] = m[i - 1] + cols;
 

Modified: grass/trunk/lib/gmath/ialloc.c
===================================================================
--- grass/trunk/lib/gmath/ialloc.c	2012-06-12 12:08:33 UTC (rev 52044)
+++ grass/trunk/lib/gmath/ialloc.c	2012-06-12 12:12:35 UTC (rev 52045)
@@ -61,7 +61,7 @@
     int i;
 
     m = (int **)G_calloc(rows, sizeof(int *));
-    m[0] = (int *)G_calloc(rows * cols, sizeof(int));
+    m[0] = (int *)G_calloc((size_t) rows * cols, sizeof(int));
     for (i = 1; i < rows; i++)
 	m[i] = m[i - 1] + cols;
 



More information about the grass-commit mailing list