[GRASS-SVN] r61416 - in grass/trunk: imagery/i.ortho.photo/i.ortho.rectify imagery/i.rectify raster/r.proj

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jul 26 16:37:46 PDT 2014


Author: glynn
Date: 2014-07-26 16:37:46 -0700 (Sat, 26 Jul 2014)
New Revision: 61416

Modified:
   grass/trunk/imagery/i.ortho.photo/i.ortho.rectify/readcell.c
   grass/trunk/imagery/i.rectify/readcell.c
   grass/trunk/raster/r.proj/readcell.c
Log:
Use lib/gis PRNG for readcell()


Modified: grass/trunk/imagery/i.ortho.photo/i.ortho.rectify/readcell.c
===================================================================
--- grass/trunk/imagery/i.ortho.photo/i.ortho.rectify/readcell.c	2014-07-26 23:22:22 UTC (rev 61415)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.rectify/readcell.c	2014-07-26 23:37:46 UTC (rev 61416)
@@ -29,6 +29,8 @@
     else
 	select_current_env();
 
+    G_srand48(0);
+
     nrows = Rast_window_rows();
     ncols = Rast_window_cols();
 
@@ -119,7 +121,7 @@
 
 block *get_block(struct cache * c, int idx)
 {
-    int replace = rand() % c->nblocks;
+    int replace = G_lrand48() % c->nblocks;
     block *p = &c->blocks[replace];
     int ref = c->refs[replace];
     off_t offset = (off_t) idx * sizeof(DCELL) << L2BSIZE;

Modified: grass/trunk/imagery/i.rectify/readcell.c
===================================================================
--- grass/trunk/imagery/i.rectify/readcell.c	2014-07-26 23:22:22 UTC (rev 61415)
+++ grass/trunk/imagery/i.rectify/readcell.c	2014-07-26 23:37:46 UTC (rev 61416)
@@ -27,6 +27,8 @@
     int nblocks;
     int i;
 
+    G_srand48(0);
+
     nrows = Rast_input_window_rows();
     ncols = Rast_input_window_cols();
 
@@ -106,7 +108,7 @@
 
 block *get_block(struct cache * c, int idx)
 {
-    int replace = rand() % c->nblocks;
+    int replace = G_lrand48() % c->nblocks;
     block *p = &c->blocks[replace];
     int ref = c->refs[replace];
     off_t offset = (off_t) idx * sizeof(DCELL) << L2BSIZE;

Modified: grass/trunk/raster/r.proj/readcell.c
===================================================================
--- grass/trunk/raster/r.proj/readcell.c	2014-07-26 23:22:22 UTC (rev 61415)
+++ grass/trunk/raster/r.proj/readcell.c	2014-07-26 23:37:46 UTC (rev 61416)
@@ -26,6 +26,8 @@
     int nblocks;
     int i;
 
+    G_srand48(0);
+
     nrows = Rast_input_window_rows();
     ncols = Rast_input_window_cols();
 
@@ -114,7 +116,7 @@
 block *get_block(struct cache * c, int idx)
 {
     int fd;
-    int replace = rand() % c->nblocks;
+    int replace = G_lrand48() % c->nblocks;
     block *p = &c->blocks[replace];
     int ref = c->refs[replace];
     off_t offset = (off_t) idx * sizeof(FCELL) << L2BSIZE;



More information about the grass-commit mailing list