[GRASS-SVN] r33676 - grass-addons/imagery/i.landsat.toar

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 5 04:46:44 EDT 2008


Author: neteler
Date: 2008-10-05 04:46:44 -0400 (Sun, 05 Oct 2008)
New Revision: 33676

Modified:
   grass-addons/imagery/i.landsat.toar/landsat.c
   grass-addons/imagery/i.landsat.toar/main.c
Log:
GRASS 7 compatibility

Modified: grass-addons/imagery/i.landsat.toar/landsat.c
===================================================================
--- grass-addons/imagery/i.landsat.toar/landsat.c	2008-10-05 08:45:01 UTC (rev 33675)
+++ grass-addons/imagery/i.landsat.toar/landsat.c	2008-10-05 08:46:44 UTC (rev 33676)
@@ -1,6 +1,7 @@
-#include<stdio.h>
-#include<stdlib.h>
-#include<math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <grass/gis.h>
 
 #include "landsat.h"
 

Modified: grass-addons/imagery/i.landsat.toar/main.c
===================================================================
--- grass-addons/imagery/i.landsat.toar/main.c	2008-10-05 08:45:01 UTC (rev 33675)
+++ grass-addons/imagery/i.landsat.toar/main.c	2008-10-05 08:46:44 UTC (rev 33676)
@@ -203,14 +203,14 @@
 	name = input->answer;
 
 	if (adate->answer != NULL) {
-		G_strncpy(lsat.date, adate->answer, 11);
+		strncpy(lsat.date, adate->answer, 11);
 		lsat.date[10] = '\0';
 	}
 	else
 		lsat.date[0] = '\0';
 
 	if (pdate->answer != NULL) {
-		G_strncpy(lsat.creation, pdate->answer, 11);
+		strncpy(lsat.creation, pdate->answer, 11);
 		lsat.creation[10] = '\0';
 	}
 	else
@@ -367,7 +367,7 @@
 					dn_mode[i] = j;
 				}
 			}
-			G_message("... DN = %.2d [%d] : mode %.2d [%d]",
+			G_message("... DN = %.2d [%d] : mode %.2d [%d] %s",
 						dn_dark[i], hist[dn_dark[i]],
 						dn_mode[i], hist[dn_mode[i]],
 						hist[255] > hist[dn_mode[i]] ? ", excluding DN > 241" : "");
@@ -560,7 +560,7 @@
 			sprintf(history.edhist[9], " Reflectance = Radiance divided by ..... %.5lf", lsat.band[i].K2);
 	        history.edlinecnt = 10;
 			if (method > DOS) {
-				sprintf(history.edhist[10], "");
+				sprintf(history.edhist[10], " ");
 				sprintf(history.edhist[11], " Dark object (%4d pixels) DN = ........ %d", pixel, dn_dark[i]);
 				sprintf(history.edhist[12], " Mode in reflectance histogram ......... %.5lf", ref_mode);
 				history.edlinecnt = 13;



More information about the grass-commit mailing list