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

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


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

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

Modified: grass-addons/raster/r.fuzzy/local_proto.h
===================================================================
--- grass-addons/raster/r.fuzzy/local_proto.h	2011-05-20 16:40:33 UTC (rev 46336)
+++ grass-addons/raster/r.fuzzy/local_proto.h	2011-05-20 16:40:36 UTC (rev 46337)
@@ -26,16 +26,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/raster/r.fuzzy/main.c
===================================================================
--- grass-addons/raster/r.fuzzy/main.c	2011-05-20 16:40:33 UTC (rev 46336)
+++ grass-addons/raster/r.fuzzy/main.c	2011-05-20 16:40:36 UTC (rev 46337)
@@ -12,18 +12,23 @@
  ****************************************************************************
  */
 
-#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;
     struct Option *par_input,
 	*par_output,
 	*par_points, *par_side, *par_type, *par_height, *par_shape;
 
+    struct GModule *module;
     struct Cell_head cellhd;
     struct History history;
 
@@ -39,6 +44,11 @@
 
     G_gisinit(argv[0]);
 
+    module = G_define_module();
+    module->keywords = _("raster, fuzzy logic");
+    module->description =
+        _("xxxx");
+
     par_input = G_define_standard_option(G_OPT_R_INPUT);
     par_input->description = _("Raster map to be fuzzified");
 
@@ -47,7 +57,7 @@
 
     par_points = G_define_option();
     par_points->key = "points";
-    par_points->type = "TYPE_STRING";
+    par_points->type = TYPE_STRING;
     par_points->answer = "a,b[,c,d]";
     par_points->multiple = YES;
     par_points->required = YES;
@@ -55,7 +65,7 @@
 
     par_side = G_define_option();
     par_side->key = "side";
-    par_side->type = "TYPE_STRING";
+    par_side->type = TYPE_STRING;
     par_side->options = "both,left,right";
     par_side->answer = "both";
     par_side->multiple = NO;
@@ -64,7 +74,7 @@
 
     par_type = G_define_option();
     par_type->key = "boundary";
-    par_type->type = "TYPE_STRING";
+    par_type->type = TYPE_STRING;
     par_type->options = "Linear,S-shaped,J-shaped,G-shaped";
     par_type->answer = "S-shaped";
     par_type->multiple = NO;
@@ -74,7 +84,7 @@
 
     par_shape = G_define_option();
     par_shape->key = "shape";
-    par_shape->type = "TYPE_FLOAT";
+    par_shape->type = TYPE_DOUBLE;
     par_shape->options = "-1 to 1";
     par_shape->answer = "0.";
     par_shape->multiple = NO;
@@ -84,7 +94,7 @@
 
     par_height = G_define_option();
     par_height->key = "height";
-    par_height->type = "TYPE_FLOAT";
+    par_height->type = TYPE_DOUBLE;
     par_height->options = "0 to 1";
     par_height->answer = "1";
     par_height->multiple = NO;

Modified: grass-addons/raster/r.fuzzy.logic/main.c
===================================================================
--- grass-addons/raster/r.fuzzy.logic/main.c	2011-05-20 16:40:33 UTC (rev 46336)
+++ grass-addons/raster/r.fuzzy.logic/main.c	2011-05-20 16:40:36 UTC (rev 46337)
@@ -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,6 @@
  ****************************************************************************
  */
 
-#define MAIN
 #include <grass/gis.h>
 #include <grass/glocale.h>
 #include "local_proto.h"
@@ -44,6 +43,11 @@
 
     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";
@@ -58,7 +62,7 @@
 
     par_operation = G_define_option();
     par_operation->key = "operator";
-    par_operation->type = "TYPE_STRING";
+    par_operation->type = TYPE_STRING;
     par_operation->options = "AND,OR,NOT,IMP";
     par_operation->answer = "AND";
     par_operation->multiple = NO;
@@ -67,7 +71,7 @@
 
     par_family = G_define_option();
     par_family->key = "family";
-    par_family->type = "TYPE_STRING";
+    par_family->type = TYPE_STRING;
     par_family->options = "Zadeh,product,drastic,Lukasiewicz,Fodor,Hamacher";
     par_family->answer = "Zadeh";
     par_family->multiple = NO;

Modified: grass-addons/raster/r.fuzzy.system/local_proto.h
===================================================================
--- grass-addons/raster/r.fuzzy.system/local_proto.h	2011-05-20 16:40:33 UTC (rev 46336)
+++ grass-addons/raster/r.fuzzy.system/local_proto.h	2011-05-20 16:40:36 UTC (rev 46337)
@@ -5,12 +5,6 @@
 #include <grass/gis.h>
 #include <grass/glocale.h>
 
-#ifdef MAIN
-#  define GLOBAL
-#else
-#  define GLOBAL extern
-#endif
-
 /*
    PI2= PI/2
    PI4= PI/4
@@ -143,24 +137,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/raster/r.fuzzy.system/main.c
===================================================================
--- grass-addons/raster/r.fuzzy.system/main.c	2011-05-20 16:40:33 UTC (rev 46336)
+++ grass-addons/raster/r.fuzzy.system/main.c	2011-05-20 16:40:36 UTC (rev 46337)
@@ -3,7 +3,7 @@
  * MODULE:       r.fuzzy.system
  * AUTHOR(S):    Jarek Jasiewicz <jarekj amu.edu.pl>
  * PURPOSE:      Full fuzzy logic standalone classification system with few fuzzy logic families 
- *                                                       implication and defuzzification and methods.
+ *                                                   implication and defuzzification and methods.
  * COPYRIGHT:    (C) 1999-2010 by the GRASS Development Team
  *
  *               This program is free software under the GNU General Public
@@ -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