[GRASS-SVN] r36824 - grass/trunk/raster/r.topidx

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Apr 20 20:42:17 EDT 2009


Author: hcho
Date: 2009-04-20 20:42:17 -0400 (Mon, 20 Apr 2009)
New Revision: 36824

Modified:
   grass/trunk/raster/r.topidx/file_io.c
   grass/trunk/raster/r.topidx/global.h
   grass/trunk/raster/r.topidx/main.c
   grass/trunk/raster/r.topidx/topidx.c
Log:
i18n; include cleanup; copyright

Modified: grass/trunk/raster/r.topidx/file_io.c
===================================================================
--- grass/trunk/raster/r.topidx/file_io.c	2009-04-21 00:26:32 UTC (rev 36823)
+++ grass/trunk/raster/r.topidx/file_io.c	2009-04-21 00:42:17 UTC (rev 36824)
@@ -1,4 +1,3 @@
-#include <stdlib.h>
 #include <string.h>
 #include <grass/gis.h>
 #include <grass/glocale.h>

Modified: grass/trunk/raster/r.topidx/global.h
===================================================================
--- grass/trunk/raster/r.topidx/global.h	2009-04-21 00:26:32 UTC (rev 36823)
+++ grass/trunk/raster/r.topidx/global.h	2009-04-21 00:42:17 UTC (rev 36824)
@@ -1,6 +1,3 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
 #include <grass/gis.h>
 
 #define	cv(i,j)		cell[i][j]
@@ -11,13 +8,18 @@
 
 #define	ZERO		0.0000001
 
+#ifdef _MAIN_C_
+#define GLOBAL
+#else
+#define GLOBAL extern
+#endif
 
+GLOBAL char *iname, *oname;
+GLOBAL struct Cell_head window;
+GLOBAL DCELL **cell;
+GLOBAL DCELL **atb, **a;
+
 void getcells(void);
 void putcells(void);
 void initialize(void);
 void atanb(void);
-
-extern char *iname, *oname;
-extern struct Cell_head window;
-extern DCELL **cell;
-extern DCELL **atb, **a;

Modified: grass/trunk/raster/r.topidx/main.c
===================================================================
--- grass/trunk/raster/r.topidx/main.c	2009-04-21 00:26:32 UTC (rev 36823)
+++ grass/trunk/raster/r.topidx/main.c	2009-04-21 00:42:17 UTC (rev 36824)
@@ -10,7 +10,7 @@
  * PURPOSE:      Creates topographic index map from elevation map.
  *               Based on GRIDATB.FOR.
  *
- * COPYRIGHT:    (C) 2000-2007 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2000-2009 by the GRASS Development Team
  *
  *               This program is free software under the GNU General Public
  *               License (>=v2). Read the file COPYING that comes with GRASS
@@ -18,14 +18,12 @@
  *
  *****************************************************************************/
 
+#define _MAIN_C_
+#include <stdlib.h>
+#include <grass/gis.h>
 #include <grass/glocale.h>
 #include "global.h"
 
-char *iname, *oname;
-struct Cell_head window;
-DCELL **cell;
-DCELL **atb, **a;
-
 int main(int argc, char **argv)
 {
     struct GModule *module;

Modified: grass/trunk/raster/r.topidx/topidx.c
===================================================================
--- grass/trunk/raster/r.topidx/topidx.c	2009-04-21 00:26:32 UTC (rev 36823)
+++ grass/trunk/raster/r.topidx/topidx.c	2009-04-21 00:42:17 UTC (rev 36824)
@@ -1,5 +1,7 @@
+#include <math.h>
+#include <grass/gis.h>
+#include <grass/glocale.h>
 #include "global.h"
-#include <grass/glocale.h>
 
 int natb;
 
@@ -36,7 +38,7 @@
     ncells = window.rows * window.cols;
     snatb = natb;
 
-    G_important_message("Calculating...");
+    G_important_message(_("Calculating..."));
 
     nsink = 0;
     for (iter = 1; natb < ncells; iter++) {
@@ -179,7 +181,7 @@
 		}
 
 		if (!nroute) {
-		    G_debug(1, "Sink or boundary node " "at %d, %d\n", i, j);
+		    G_debug(1, "Sink or boundary node at %d, %d\n", i, j);
 		    nsink++;
 		    sumtb = 0.0;
 		    nslp = 0;
@@ -272,5 +274,5 @@
 	}
     }
     G_percent(natb - snatb, ncells - snatb, 1);
-    G_important_message("Number of sinks or boundaries: %d", nsink);
+    G_important_message(_("Number of sinks or boundaries: %d"), nsink);
 }



More information about the grass-commit mailing list