ソースを参照

i18n; include cleanup; copyright

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@36824 15284696-431f-4ddb-bdfa-cd5b030d7da7
Huidae Cho 16 年 前
コミット
65e66fe7bd
4 ファイル変更20 行追加19 行削除
  1. 0 1
      raster/r.topidx/file_io.c
  2. 10 8
      raster/r.topidx/global.h
  3. 4 6
      raster/r.topidx/main.c
  4. 6 4
      raster/r.topidx/topidx.c

+ 0 - 1
raster/r.topidx/file_io.c

@@ -1,4 +1,3 @@
-#include <stdlib.h>
 #include <string.h>
 #include <grass/gis.h>
 #include <grass/glocale.h>

+ 10 - 8
raster/r.topidx/global.h

@@ -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;

+ 4 - 6
raster/r.topidx/main.c

@@ -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;

+ 6 - 4
raster/r.topidx/topidx.c

@@ -1,5 +1,7 @@
-#include "global.h"
+#include <math.h>
+#include <grass/gis.h>
 #include <grass/glocale.h>
+#include "global.h"
 
 int natb;
 
@@ -36,7 +38,7 @@ void atanb(void)
     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 @@ void atanb(void)
 		}
 
 		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 @@ void atanb(void)
 	}
     }
     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);
 }