[GRASS-SVN] r71256 - grass/trunk/imagery/i.rectify

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 10 14:42:06 PDT 2017


Author: mmetz
Date: 2017-07-10 14:42:06 -0700 (Mon, 10 Jul 2017)
New Revision: 71256

Modified:
   grass/trunk/imagery/i.rectify/exec.c
   grass/trunk/imagery/i.rectify/global.h
   grass/trunk/imagery/i.rectify/report.c
Log:
i.rectify: fix arg type for time() fn

Modified: grass/trunk/imagery/i.rectify/exec.c
===================================================================
--- grass/trunk/imagery/i.rectify/exec.c	2017-07-10 21:32:27 UTC (rev 71255)
+++ grass/trunk/imagery/i.rectify/exec.c	2017-07-10 21:42:06 UTC (rev 71256)
@@ -32,7 +32,7 @@
     struct Categories cats;
     struct History hist;
     int colr_ok, cats_ok;
-    long start_time, rectify_time;
+    time_t start_time, rectify_time;
 
     Rast_set_output_window(&target_window);
     G_message("-----------------------------------------------");
@@ -81,7 +81,7 @@
 		report(rectify_time - start_time, 1);
 	    }
 	    else
-		report((long)0, 0);
+		report((time_t)0, 0);
 
 	    G_free(result);
 	}

Modified: grass/trunk/imagery/i.rectify/global.h
===================================================================
--- grass/trunk/imagery/i.rectify/global.h	2017-07-10 21:32:27 UTC (rev 71255)
+++ grass/trunk/imagery/i.rectify/global.h	2017-07-10 21:42:06 UTC (rev 71256)
@@ -4,6 +4,7 @@
  * mind that although you think the i/o will decrease, system paging
  * (which goes on behind the scenes) may actual increase the i/o.
  */
+#include <time.h>
 #include <grass/gis.h>
 #include <grass/imagery.h>
 
@@ -87,7 +88,7 @@
 #define CPTR(c,y,x) (&(*BLOCK((c),HI((y)),HI((x))))[LO((y))][LO((x))])
 
 /* report.c */
-int report(long, int);
+int report(time_t, int);
 
 /* target.c */
 int get_target(char *);

Modified: grass/trunk/imagery/i.rectify/report.c
===================================================================
--- grass/trunk/imagery/i.rectify/report.c	2017-07-10 21:32:27 UTC (rev 71255)
+++ grass/trunk/imagery/i.rectify/report.c	2017-07-10 21:42:06 UTC (rev 71256)
@@ -1,10 +1,11 @@
+#include <time.h>
 #include <grass/glocale.h>
 #include "global.h"
 
-int report(long rectify, int ok)
+int report(time_t rectify, int ok)
 {
     int minutes, hours;
-    long seconds;
+    time_t seconds;
     long ncells;
 
     G_message("%s", ok ? _("complete") : _("failed"));
@@ -20,9 +21,9 @@
     G_verbose_message(_("%d rows, %d cols (%ld cells) completed in"),
 			target_window.rows, target_window.cols, ncells);
     if (hours)
-	G_verbose_message(_("%d:%02d:%02ld hours"), hours, minutes, seconds % 60);
+	G_verbose_message(_("%d:%02d:%02d hours"), hours, minutes, (int)(seconds % 60));
     else
-	G_verbose_message(_("%d:%02ld minutes"), minutes, seconds % 60);
+	G_verbose_message(_("%d:%02d minutes"), minutes, (int)(seconds % 60));
     if (seconds)
 	G_verbose_message(_("%.1f cells per minute"),
 			  (60.0 * ncells) / ((double)seconds));



More information about the grass-commit mailing list