[GRASS-SVN] r46336 - in grass-addons/grass7/raster/r.fuzzy: r.fuzzy.logic r.fuzzy.set r.fuzzy.system

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 20 12:40:34 EDT 2011


Author: neteler
Date: 2011-05-20 09:40:33 -0700 (Fri, 20 May 2011)
New Revision: 46336

Modified:
   grass-addons/grass7/raster/r.fuzzy/r.fuzzy.logic/main.c
   grass-addons/grass7/raster/r.fuzzy/r.fuzzy.set/local_proto.h
   grass-addons/grass7/raster/r.fuzzy/r.fuzzy.set/main.c
   grass-addons/grass7/raster/r.fuzzy/r.fuzzy.system/local_proto.h
   grass-addons/grass7/raster/r.fuzzy/r.fuzzy.system/main.c
Log:
fix compiler warnings

Modified: grass-addons/grass7/raster/r.fuzzy/r.fuzzy.logic/main.c
===================================================================
--- grass-addons/grass7/raster/r.fuzzy/r.fuzzy.logic/main.c	2011-05-20 16:08:31 UTC (rev 46335)
+++ grass-addons/grass7/raster/r.fuzzy/r.fuzzy.logic/main.c	2011-05-20 16:40:33 UTC (rev 46336)
@@ -2,8 +2,8 @@
  *
  * MODULE:       r.fuzzy.logic
  * AUTHOR(S):    Jarek Jasiewicz <jarekj amu.edu.pl>
- * PURPOSE:      Peroforms logical operatations on membership images created with 
- * 							 r.fuzzy or dofferent method. Use families for fuzzy logic
+ * PURPOSE:      Performs logical operations on membership images created with 
+ *                   r.fuzzy or different method. Use families for fuzzy logic
  * COPYRIGHT:    (C) 1999-2010 by the GRASS Development Team
  *
  *               This program is free software under the GNU General Public
@@ -13,7 +13,7 @@
  ****************************************************************************
  */
 
-#define MAIN
+#include <grass/gis.h>
 #include <grass/glocale.h>
 #include "local_proto.h"
 
@@ -46,16 +46,21 @@
 	
 	G_gisinit(argv[0]);
 	
+    module = G_define_module();
+    module->keywords = _("raster, fuzzy logic");
+    module->description =
+        _("xxxx");
+
 	par_inputx = G_define_standard_option(G_OPT_R_INPUT);
-  par_inputx->description = _("x operand (membership map)");
-  par_inputx->key = "xmap";
+    par_inputx->description = _("x operand (membership map)");
+    par_inputx->key = "xmap";
   
-  par_inputy = G_define_standard_option(G_OPT_R_INPUT);
-  par_inputy->description = _("y operand (membership map)");
-  par_inputy->key = "ymap";
-  par_inputy->required = NO;
+    par_inputy = G_define_standard_option(G_OPT_R_INPUT);
+    par_inputy->description = _("y operand (membership map)");
+    par_inputy->key = "ymap";
+    par_inputy->required = NO;
   
-  par_output = G_define_standard_option(G_OPT_R_OUTPUT);
+    par_output = G_define_standard_option(G_OPT_R_OUTPUT);
 	par_output->description = _("Resulting map");
 
 	par_operation=G_define_option();

Modified: grass-addons/grass7/raster/r.fuzzy/r.fuzzy.set/local_proto.h
===================================================================
--- grass-addons/grass7/raster/r.fuzzy/r.fuzzy.set/local_proto.h	2011-05-20 16:08:31 UTC (rev 46335)
+++ grass-addons/grass7/raster/r.fuzzy/r.fuzzy.set/local_proto.h	2011-05-20 16:40:33 UTC (rev 46336)
@@ -27,16 +27,10 @@
 #define LEFT 1
 #define RIGHT 2
 
-#ifdef MAIN
-#       define GLOBAL
-#else
-#       define GLOBAL extern
-#endif
+extern char *input, *output;
+extern float shape, height;
+extern int type, side;
+extern double p[4]; /* inflection points */
+extern int num_points;
 
-GLOBAL char *input, *output;
-GLOBAL float shape, height;
-GLOBAL int type, side;
-GLOBAL double p[4]; /* inflection points */
-GLOBAL int num_points;
-
 float fuzzy (FCELL cell);

Modified: grass-addons/grass7/raster/r.fuzzy/r.fuzzy.set/main.c
===================================================================
--- grass-addons/grass7/raster/r.fuzzy/r.fuzzy.set/main.c	2011-05-20 16:08:31 UTC (rev 46335)
+++ grass-addons/grass7/raster/r.fuzzy/r.fuzzy.set/main.c	2011-05-20 16:40:33 UTC (rev 46336)
@@ -13,9 +13,16 @@
  */
 
 #define MAIN
+#include <grass/gis.h>
 #include <grass/glocale.h>
 #include "local_proto.h"
 
+char *input, *output;
+float shape, height;
+int type, side;
+double p[4]; /* inflection points */
+int num_points;
+
 int main(int argc, char *argv[])
 {
 	struct GModule *module;

Modified: grass-addons/grass7/raster/r.fuzzy/r.fuzzy.system/local_proto.h
===================================================================
--- grass-addons/grass7/raster/r.fuzzy/r.fuzzy.system/local_proto.h	2011-05-20 16:08:31 UTC (rev 46335)
+++ grass-addons/grass7/raster/r.fuzzy/r.fuzzy.system/local_proto.h	2011-05-20 16:40:33 UTC (rev 46336)
@@ -6,12 +6,6 @@
 #include <grass/raster.h>
 #include <grass/glocale.h>
 
-#ifdef MAIN
-#  define GLOBAL
-#else
-#  define GLOBAL extern
-#endif
-
 /*
    PI2= PI/2
    PI4= PI/4
@@ -144,24 +138,24 @@
 } OUTPUTS;
 
 
-GLOBAL STRING var_name_file;
-GLOBAL STRING rule_name_file;
-GLOBAL STRING output;
-GLOBAL MAPS *s_maps;
-GLOBAL RULES *s_rules;
-GLOBAL OUTPUTS *m_outputs;
-GLOBAL float **visual_output;
-GLOBAL float *universe;
-GLOBAL float *antecedents;
-GLOBAL float *agregate;
-GLOBAL int nmaps, nrules, output_index, multiple, membership_only, coor_proc;
-GLOBAL int resolution;
-GLOBAL implications implication;
-GLOBAL defuzz defuzzyfication;
-GLOBAL logics family;
+extern STRING var_name_file;
+extern STRING rule_name_file;
+extern STRING output;
+extern MAPS *s_maps;
+extern RULES *s_rules;
+extern OUTPUTS *m_outputs;
+extern float **visual_output;
+extern float *universe;
+extern float *antecedents;
+extern float *agregate;
+extern int nmaps, nrules, output_index, multiple, membership_only, coor_proc;
+extern int resolution;
+extern implications implication;
+extern defuzz defuzzyfication;
+extern logics family;
 
-GLOBAL char **rules;
-GLOBAL int HERE;
+extern char **rules;
+extern int HERE;
 
 int char_strip(char *buf, char rem);
 int char_copy(const char *buf, char *res, int start, int stop);

Modified: grass-addons/grass7/raster/r.fuzzy/r.fuzzy.system/main.c
===================================================================
--- grass-addons/grass7/raster/r.fuzzy/r.fuzzy.system/main.c	2011-05-20 16:08:31 UTC (rev 46335)
+++ grass-addons/grass7/raster/r.fuzzy/r.fuzzy.system/main.c	2011-05-20 16:40:33 UTC (rev 46336)
@@ -12,9 +12,29 @@
  *
  *************************************************************************** */
 
-#define MAIN
+#include <grass/gis.h>
+#include <grass/glocale.h>
 #include "local_proto.h"
 
+STRING var_name_file;
+STRING rule_name_file;
+STRING output;
+MAPS *s_maps;
+RULES *s_rules;
+OUTPUTS *m_outputs;
+float **visual_output;
+float *universe;
+float *antecedents;
+float *agregate;
+int nmaps, nrules, output_index, multiple, membership_only, coor_proc;
+int resolution;
+implications implication;
+defuzz defuzzyfication;
+logics family;
+
+char **rules;
+int HERE;
+
 int main(int argc, char **argv)
 {
     struct Option *file_vars,
@@ -25,6 +45,7 @@
 
     struct History history;
 
+    struct GModule *module;
     struct Flag *out_multiple, *out_membership;
 
     int nrows, ncols;
@@ -37,6 +58,11 @@
 
     G_gisinit(argv[0]);
 
+    module = G_define_module();
+    module->keywords = _("raster, fuzzy logic");
+    module->description =
+        _("xxxx");
+
     file_vars = G_define_standard_option(G_OPT_F_INPUT);
     file_vars->key = "maps";
     file_vars->required = YES;



More information about the grass-commit mailing list