[GRASS-SVN] r46219 - in grass-addons/raster: . r.pi/r.pi.export
r.pi/r.pi.import
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon May 9 09:24:41 EDT 2011
Author: neteler
Date: 2011-05-09 06:24:41 -0700 (Mon, 09 May 2011)
New Revision: 46219
Modified:
grass-addons/raster/Makefile
grass-addons/raster/r.pi/r.pi.export/local_proto.h
grass-addons/raster/r.pi/r.pi.export/main.c
grass-addons/raster/r.pi/r.pi.import/Makefile
grass-addons/raster/r.pi/r.pi.import/local_proto.h
grass-addons/raster/r.pi/r.pi.import/main.c
Log:
compilation fix
Modified: grass-addons/raster/Makefile
===================================================================
--- grass-addons/raster/Makefile 2011-05-09 12:44:59 UTC (rev 46218)
+++ grass-addons/raster/Makefile 2011-05-09 13:24:41 UTC (rev 46219)
@@ -1,5 +1,7 @@
MODULE_TOPDIR = ..
+# r.convert
+# r.roughness
SUBDIRS = \
LandDyn \
mcda \
@@ -8,8 +10,6 @@
r.burn.frict \
r.clim \
r.colors.quantiles \
- r.colors.tools \
- r.convert \
r.denoise \
r.game_of_life \
r.inund.fluv \
@@ -25,7 +25,6 @@
r.pi \
r.prominence \
r.rast4d \
- r.roughness \
r.soils.texture \
r.stream.basins \
r.stream.del \
Modified: grass-addons/raster/r.pi/r.pi.export/local_proto.h
===================================================================
--- grass-addons/raster/r.pi/r.pi.export/local_proto.h 2011-05-09 12:44:59 UTC (rev 46218)
+++ grass-addons/raster/r.pi/r.pi.export/local_proto.h 2011-05-09 13:24:41 UTC (rev 46219)
@@ -4,12 +4,18 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
+#include <math.h>
+#include <time.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include <grass/stats.h>
-#include <math.h>
-#include <time.h>
+#ifdef MAIN
+#define GLOBAL
+#else
+#define GLOBAL extern
+#endif
+
#define NOTHING 0
#define RESOLUTION 10000
@@ -17,72 +23,52 @@
#define MIN_DOUBLE -1000000
#define MAX_DOUBLE 1000000
-typedef struct
-{
- int x, y;
- int neighbors;
- DCELL value;
+typedef struct {
+ int x, y;
+ int neighbors;
+ DCELL value;
} Coords;
-typedef struct
-{
- int x, y;
+typedef struct {
+ int x, y;
} Point;
-typedef struct
-{
- int x, y;
- int patch;
+typedef struct {
+ int x, y;
+ int patch;
} PatchPoint;
-typedef DCELL(*f_statmethod) (DCELL *, int);
+typedef DCELL (*f_statmethod)(DCELL*, int);
/* helpers.c */
int Round(double d);
-
int Random(int max);
-
double Randomf();
-
void print_buffer(int *buffer, int sx, int sy);
-
-void print_d_buffer(DCELL * buffer, int sx, int sy);
-
+void print_d_buffer(DCELL *buffer, int sx, int sy);
void print_map(double *map, int size);
-
-void print_array(DCELL * buffer, int size);
-
+void print_array(DCELL *buffer, int size);
void print_fragments();
/* frag.c */
-void writeFragments(DCELL * flagbuf, int nrows, int ncols, int nbr_cnt);
+void writeFragments(DCELL *flagbuf, int nrows, int ncols, int nbr_cnt);
/* stat_method.c */
DCELL average(DCELL * vals, int count);
-
DCELL variance(DCELL * vals, int count);
-
DCELL std_deviat(DCELL * vals, int count);
-
DCELL median(DCELL * vals, int count);
-
DCELL min(DCELL * vals, int count);
-
DCELL max(DCELL * vals, int count);
/* global variables */
-int verbose;
+GLOBAL int verbose;
+GLOBAL Coords **fragments;
+GLOBAL Coords *cells;
+GLOBAL int fragcount;
+GLOBAL int sx, sy;
+GLOBAL int *id_map;
-Coords **fragments;
+GLOBAL int *adj_matrix;
-Coords *cells;
-
-int fragcount;
-
-int sx, sy;
-
-int *id_map;
-
-int *adj_matrix;
-
#endif /* LOCAL_PROTO_H */
Modified: grass-addons/raster/r.pi/r.pi.export/main.c
===================================================================
--- grass-addons/raster/r.pi/r.pi.export/main.c 2011-05-09 12:44:59 UTC (rev 46218)
+++ grass-addons/raster/r.pi/r.pi.export/main.c 2011-05-09 13:24:41 UTC (rev 46219)
@@ -1,3 +1,4 @@
+#define MAIN
#include "local_proto.h"
/*
Modified: grass-addons/raster/r.pi/r.pi.import/Makefile
===================================================================
--- grass-addons/raster/r.pi/r.pi.import/Makefile 2011-05-09 12:44:59 UTC (rev 46218)
+++ grass-addons/raster/r.pi/r.pi.import/Makefile 2011-05-09 13:24:41 UTC (rev 46219)
@@ -1,5 +1,10 @@
-MODULE_TOPDIR =.. /..PGM = r.pi.import LIBES = $(STATSLIB) $(GISLIB)
- DEPENDENCIES = $(STATSDEP) $(GISDEP)
+MODULE_TOPDIR = ../..
-include $(MODULE_TOPDIR) / include / Make / Module.make default:
-cmd
+PGM = r.pi.import
+
+LIBES = $(STATSLIB) $(GISLIB)
+DEPENDENCIES = $(STATSDEP) $(GISDEP)
+
+include $(MODULE_TOPDIR)/include/Make/Module.make
+
+default: cmd
Modified: grass-addons/raster/r.pi/r.pi.import/local_proto.h
===================================================================
--- grass-addons/raster/r.pi/r.pi.import/local_proto.h 2011-05-09 12:44:59 UTC (rev 46218)
+++ grass-addons/raster/r.pi/r.pi.import/local_proto.h 2011-05-09 13:24:41 UTC (rev 46219)
@@ -4,12 +4,18 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
+#include <math.h>
+#include <time.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include <grass/stats.h>
-#include <math.h>
-#include <time.h>
+#ifdef MAIN
+#define GLOBAL
+#else
+#define GLOBAL extern
+#endif
+
#define NOTHING 0
#define RESOLUTION 10000
@@ -27,19 +33,12 @@
/* helpers.c */
int Round(double d);
-
int Random(int max);
-
double Randomf();
-
void print_buffer(int *buffer, int sx, int sy);
-
void print_d_buffer(DCELL * buffer, int sx, int sy);
-
void print_map(double *map, int size);
-
void print_array(DCELL * buffer, int size);
-
void print_fragments();
/* frag.c */
@@ -49,16 +48,13 @@
void parse(DCELL * values, char *file_name, int id_col, int val_col);
/* global variables */
-int verbose;
+GLOBAL int verbose;
+GLOBAL Coords **fragments;
+GLOBAL Coords *cells;
+GLOBAL int fragcount;
+GLOBAL int sx, sy;
+GLOBAL int *id_map;
-Coords **fragments;
+GLOBAL int *adj_matrix;
-Coords *cells;
-
-int fragcount;
-
-int sx, sy;
-
-int *adj_matrix;
-
#endif /* LOCAL_PROTO_H */
Modified: grass-addons/raster/r.pi/r.pi.import/main.c
===================================================================
--- grass-addons/raster/r.pi/r.pi.import/main.c 2011-05-09 12:44:59 UTC (rev 46218)
+++ grass-addons/raster/r.pi/r.pi.import/main.c 2011-05-09 13:24:41 UTC (rev 46219)
@@ -1,3 +1,4 @@
+#define MAIN
#include "local_proto.h"
/*
More information about the grass-commit
mailing list