[GRASS-SVN] r52042 - in grass/trunk: include include/defs lib/bitmap

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jun 12 04:46:00 PDT 2012


Author: mmetz
Date: 2012-06-12 04:45:59 -0700 (Tue, 12 Jun 2012)
New Revision: 52042

Modified:
   grass/trunk/include/bitmap.h
   grass/trunk/include/defs/bitmap.h
   grass/trunk/lib/bitmap/bitmap.c
   grass/trunk/lib/bitmap/sparse.c
Log:
size_t: update bitmap lib

Modified: grass/trunk/include/bitmap.h
===================================================================
--- grass/trunk/include/bitmap.h	2012-06-12 10:03:51 UTC (rev 52041)
+++ grass/trunk/include/bitmap.h	2012-06-12 11:45:59 UTC (rev 52042)
@@ -18,7 +18,7 @@
 {
     int rows;
     int cols;
-    int bytes;
+    size_t bytes;
     unsigned char *data;
     int sparse;
     /* char *token; */

Modified: grass/trunk/include/defs/bitmap.h
===================================================================
--- grass/trunk/include/defs/bitmap.h	2012-06-12 10:03:51 UTC (rev 52041)
+++ grass/trunk/include/defs/bitmap.h	2012-06-12 11:45:59 UTC (rev 52042)
@@ -7,7 +7,7 @@
 int BM_set_mode(int, int);
 int BM_set(struct BM *, int, int, int);
 int BM_get(struct BM *, int, int);
-int BM_get_map_size(struct BM *);
+size_t BM_get_map_size(struct BM *);
 int BM_file_write(FILE *, struct BM *);
 struct BM *BM_file_read(FILE *);
 
@@ -16,7 +16,7 @@
 int BM_destroy_sparse(struct BM *);
 int BM_set_sparse(struct BM *, int, int, int);
 int BM_get_sparse(struct BM *, int, int);
-int BM_get_map_size_sparse(struct BM *);
+size_t BM_get_map_size_sparse(struct BM *);
 int BM_dump_map_sparse(struct BM *);
 int BM_dump_map_row_sparse(struct BM *, int);
 int BM_file_write_sparse(FILE *, struct BM *);

Modified: grass/trunk/lib/bitmap/bitmap.c
===================================================================
--- grass/trunk/lib/bitmap/bitmap.c	2012-06-12 10:03:51 UTC (rev 52041)
+++ grass/trunk/lib/bitmap/bitmap.c	2012-06-12 11:45:59 UTC (rev 52042)
@@ -242,12 +242,12 @@
  *  \return int
  */
 
-int BM_get_map_size(struct BM *map)
+size_t BM_get_map_size(struct BM *map)
 {
     if (map->sparse)
 	return BM_get_map_size_sparse(map);
 
-    return map->bytes * map->rows;
+    return (size_t) map->bytes * map->rows;
 }
 
 

Modified: grass/trunk/lib/bitmap/sparse.c
===================================================================
--- grass/trunk/lib/bitmap/sparse.c	2012-06-12 10:03:51 UTC (rev 52041)
+++ grass/trunk/lib/bitmap/sparse.c	2012-06-12 11:45:59 UTC (rev 52042)
@@ -269,13 +269,13 @@
  *  \return int
  */
 
-int BM_get_map_size_sparse(struct BM *map)
+size_t BM_get_map_size_sparse(struct BM *map)
 {
     int i;
-    int size;
+    size_t size;
     struct BMlink *p;
 
-    size = map->rows * sizeof(struct BMlink *);
+    size = (size_t) map->rows * sizeof(struct BMlink *);
     for (i = 0; i < map->rows; i++) {
 	p = ((struct BMlink **)(map->data))[i];
 	while (p != NULL) {



More information about the grass-commit mailing list