[GRASS-SVN] r58957 - in grass/branches/develbranch_6/raster/r.li: r.li.cwed r.li.daemon r.li.dominance r.li.edgedensity r.li.mpa r.li.mps r.li.padcv r.li.padrange r.li.padsd r.li.patchdensity r.li.patchnum r.li.pielou r.li.renyi r.li.richness r.li.shannon r.li.shape r.li.simpson
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Feb 8 17:47:52 PST 2014
Author: hamish
Date: 2014-02-08 17:47:52 -0800 (Sat, 08 Feb 2014)
New Revision: 58957
Modified:
grass/branches/develbranch_6/raster/r.li/r.li.cwed/cwed.c
grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c
grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.h
grass/branches/develbranch_6/raster/r.li/r.li.daemon/index.h
grass/branches/develbranch_6/raster/r.li/r.li.daemon/list.c
grass/branches/develbranch_6/raster/r.li/r.li.daemon/list.h
grass/branches/develbranch_6/raster/r.li/r.li.daemon/worker.c
grass/branches/develbranch_6/raster/r.li/r.li.dominance/dominance.c
grass/branches/develbranch_6/raster/r.li/r.li.edgedensity/edgedensity.c
grass/branches/develbranch_6/raster/r.li/r.li.mpa/mpa.c
grass/branches/develbranch_6/raster/r.li/r.li.mps/mps.c
grass/branches/develbranch_6/raster/r.li/r.li.padcv/padcv.c
grass/branches/develbranch_6/raster/r.li/r.li.padrange/padrange.c
grass/branches/develbranch_6/raster/r.li/r.li.padsd/padsd.c
grass/branches/develbranch_6/raster/r.li/r.li.patchdensity/main.c
grass/branches/develbranch_6/raster/r.li/r.li.patchnum/main.c
grass/branches/develbranch_6/raster/r.li/r.li.pielou/pielou.c
grass/branches/develbranch_6/raster/r.li/r.li.renyi/renyi.c
grass/branches/develbranch_6/raster/r.li/r.li.richness/richness.c
grass/branches/develbranch_6/raster/r.li/r.li.shannon/shannon.c
grass/branches/develbranch_6/raster/r.li/r.li.shape/main.c
grass/branches/develbranch_6/raster/r.li/r.li.simpson/simpson.c
Log:
mmetz: avoid bad typedef practice (merge r49886 from trunk)
Modified: grass/branches/develbranch_6/raster/r.li/r.li.cwed/cwed.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.cwed/cwed.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.cwed/cwed.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -25,11 +25,11 @@
#define _PRES 1
#define _ERR -1
-int calculate(int fd, area_des ad, Coppie * cc, long totCoppie,
+int calculate(int fd, struct area_entry *ad, Coppie * cc, long totCoppie,
double *result);
-int calculateD(int fd, area_des ad, Coppie * cc, long totCoppie,
+int calculateD(int fd, struct area_entry *ad, Coppie * cc, long totCoppie,
double *result);
-int calculateF(int fd, area_des ad, Coppie * cc, long totCoppie,
+int calculateF(int fd, struct area_entry *ad, Coppie * cc, long totCoppie,
double *result);
int main(int argc, char *argv[])
@@ -80,7 +80,7 @@
}
-int contrastWeightedEdgeDensity(int fd, char **par, area_des ad,
+int contrastWeightedEdgeDensity(int fd, char **par, struct area_entry *ad,
double *result)
{
double indice = 0; /* the result */
@@ -298,7 +298,7 @@
-int calculate(int fd, area_des ad, Coppie * cc, long totCoppie,
+int calculate(int fd, struct area_entry *ad, Coppie * cc, long totCoppie,
double *result)
{
@@ -440,7 +440,7 @@
}
-int calculateD(int fd, area_des ad, Coppie * cc, long totCoppie,
+int calculateD(int fd, struct area_entry *ad, Coppie * cc, long totCoppie,
double *result)
{
@@ -576,7 +576,7 @@
-int calculateF(int fd, area_des ad, Coppie * cc, long totCoppie,
+int calculateF(int fd, struct area_entry *ad, Coppie * cc, long totCoppie,
double *result)
{
Modified: grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -35,14 +35,14 @@
#include "daemon.h"
-int calculateIndex(char *file, int f(int, char **, area_des, double *),
+int calculateIndex(char *file, int f(int, char **, struct area_entry *, double *),
char **parameters, char *raster, char *output)
{
char pathSetup[GPATH_MAX], out[GPATH_MAX], parsed;
char *reportChannelName, *random_access_name;
struct History history;
- g_areas g;
+ struct g_area *g;
int receiveChannel;
int res;
int i, mypid, doneDir, withoutJob, mv_fd, random_access;
@@ -57,12 +57,12 @@
wd child[num_workers];
/* int mv_rows, mv_cols; */
- list l;
+ struct list *l;
msg m, doneJob;
- g = (g_areas) G_malloc(sizeof(struct generatore));
+ g = (struct g_area *) G_malloc(sizeof(struct g_area));
g->maskname = NULL;
- l = (list) G_malloc(sizeof(struct lista));
+ l = (struct list*) G_malloc(sizeof(struct list));
l->head = NULL;
l->tail = NULL;
l->size = 0;
@@ -313,7 +313,7 @@
}
-int parseSetup(char *path, list l, g_areas g, char *raster)
+int parseSetup(char *path, struct list *l, struct g_area *g, char *raster)
{
struct stat s;
struct Cell_head cellhd;
@@ -531,7 +531,7 @@
return ERROR;
}
-int disposeAreas(list l, g_areas g, char *def)
+int disposeAreas(struct list *l, struct g_area *g, char *def)
{
char *token;
@@ -670,7 +670,7 @@
}
-int next_Area(int parsed, list l, g_areas g, msg * m)
+int next_Area(int parsed, struct list *l, struct g_area *g, msg * m)
{
if (parsed == NORMAL) {
if (l->size == 0)
@@ -726,7 +726,7 @@
}
-int raster_Output(int fd, int aid, g_areas g, double res)
+int raster_Output(int fd, int aid, struct g_area *g, double res)
{
double toPut = res;
off_t offset = (off_t) aid * sizeof(double);
@@ -743,7 +743,7 @@
}
-int write_raster(int mv_fd, int random_access, g_areas g)
+int write_raster(int mv_fd, int random_access, struct g_area *g)
{
int i = 0, j = 0, letti = 0;
double *file_buf;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.h
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.h 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.h 2014-02-09 01:47:52 UTC (rev 58957)
@@ -120,11 +120,9 @@
char *mask_name;
};
-typedef struct area_entry *area_des;
-
/**
* \brief applies the f index once for every
* area defined in setup file
@@ -134,8 +132,7 @@
* \return 0 error occurs in calculating index
* \return 1 otherwise
*/
-
-int calculateIndex(char *file, int f(int, char **, area_des, double *),
+int calculateIndex(char *file, int f(int, char **, struct area_entry *, double *),
char **parameters, char *raster, char *output);
/**
@@ -151,7 +148,7 @@
* be written in normal way
* \return MVWIN if a new raster file had to be created
*/
-int parseSetup(char *path, list l, g_areas g, char *raster);
+int parseSetup(char *path, struct list *l, struct g_area *g, char *raster);
/**
* \description dispose sample areas if configuration file have
@@ -165,7 +162,7 @@
* be written in normal way
* \return MVWIN if a new raster file had to be created
*/
-int disposeAreas(list l, g_areas g, char *def);
+int disposeAreas(struct list *l, struct g_area *g, char *def);
/**
* \brief generate the next area to analyze
@@ -176,7 +173,7 @@
* \return 1 if the area is generated
* \return 0 if there isn't another area
*/
-int next_Area(int parsed, list l, g_areas g, msg * m);
+int next_Area(int parsed, struct list *l, struct g_area *g, msg * m);
/**
* \brief writes output in a file
@@ -204,9 +201,8 @@
* \param mychannel the channel where to receive the area messages
* \param result where to put the result of index computing
*/
-void worker(char *raster, int f(int, char **, area_des, double *),
+void worker(char *raster, int f(int, char **, struct area_entry *, double *),
char *server_channel, char *mychannel, char **parameters);
-
/**
* \brief adapts the mask at current raster file
* \param mask name of mask raster file
@@ -224,7 +220,7 @@
* \param res the result to be written
* \return 0 on error, 1 if done
*/
-int raster_Output(int fd, int aid, g_areas g, double res);
+int raster_Output(int fd, int aid, struct g_area *g, double res);
/**
* \brief calculates a simple index for code debugging
@@ -234,7 +230,7 @@
* \param result where to return result
* \return 0 on error, 1 otherwise
*/
-int simple_index(int fd, char **par, area_des ad, double *result);
+int simple_index(int fd, char **par, struct area_entry * ad, double *result);
/**
* \brief copy the content of regular file random access
@@ -244,7 +240,7 @@
* \param g the mv window generator
* \return 0 on error, 1 otherwise
*/
-int write_raster(int mv_fd, int random_access, g_areas g);
+int write_raster(int mv_fd, int random_access, struct g_area *g);
/**
* \brief get a cell raster row using the memory menager
@@ -252,7 +248,7 @@
* \param row identifier of row to get
* \param ad area descriptor of current sample area
*/
-CELL *RLI_get_cell_raster_row(int fd, int row, area_des ad);
+CELL *RLI_get_cell_raster_row(int fd, int row, struct area_entry * ad);
/**
* \brief get a dcell raster row using the memory menager
@@ -260,7 +256,7 @@
* \param row identifier of row to get
* \param ad area descriptor of current sample area
*/
-DCELL *RLI_get_dcell_raster_row(int fd, int row, area_des ad);
+DCELL *RLI_get_dcell_raster_row(int fd, int row, struct area_entry * ad);
/**
* \brief get a fcell raster row using the memory menager
@@ -268,6 +264,6 @@
* \param row identifier of row to get
* \param ad area descriptor of current sample area
*/
-FCELL *RLI_get_fcell_raster_row(int fd, int row, area_des ad);
+FCELL *RLI_get_fcell_raster_row(int fd, int row, struct area_entry * ad);
#include "index.h"
Modified: grass/branches/develbranch_6/raster/r.li/r.li.daemon/index.h
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.daemon/index.h 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.daemon/index.h 2014-02-09 01:47:52 UTC (rev 58957)
@@ -26,25 +26,25 @@
* \brief calculate patch density index on selected area
* the abstract function is patch_density= patch_number / area
*/
-int patch_density(int fd, char **par, area_des ad, double *result);
+int patch_density(int fd, char **par, struct area_entry *ad, double *result);
-int patch_number(int fd, char **par, area_des ad, double *result);
-int shape_index(int fd, char **par, area_des ad, double *result);
-int shannon(int fd, char **par, area_des ad, double *result);
+int patch_number(int fd, char **par, struct area_entry *ad, double *result);
+int shape_index(int fd, char **par, struct area_entry *ad, double *result);
+int shannon(int fd, char **par, struct area_entry *ad, double *result);
-int pielou(int fd, char **par, area_des ad, double *result);
-int renyi(int fd, char **par, area_des ad, double *result);
+int pielou(int fd, char **par, struct area_entry *ad, double *result);
+int renyi(int fd, char **par, struct area_entry *ad, double *result);
-int simpson(int fd, char **par, area_des ad, double *result);
-int meanPatchSize(int fd, char **par, area_des ad, double *result);
-int meanPixelAttribute(int fd, char **par, area_des ad, double *result);
-int contrastWeightedEdgeDensity(int fd, char **par, area_des ad,
+int simpson(int fd, char **par, struct area_entry *ad, double *result);
+int meanPatchSize(int fd, char **par, struct area_entry *ad, double *result);
+int meanPixelAttribute(int fd, char **par, struct area_entry *ad, double *result);
+int contrastWeightedEdgeDensity(int fd, char **par, struct area_entry *ad,
double *result);
-int edgedensity(int fd, char **valore, area_des ad, double *result);
-int patchAreaDistributionCV(int fd, char **par, area_des ad, double *result);
-int patchAreaDistributionMN(int fd, char **par, area_des ad, double *result);
-int patchAreaDistributionSD(int fd, char **par, area_des ad, double *result);
-int patchAreaDistributionRANGE(int fd, char **par, area_des ad,
+int edgedensity(int fd, char **valore, struct area_entry *ad, double *result);
+int patchAreaDistributionCV(int fd, char **par, struct area_entry *ad, double *result);
+int patchAreaDistributionMN(int fd, char **par, struct area_entry *ad, double *result);
+int patchAreaDistributionSD(int fd, char **par, struct area_entry *ad, double *result);
+int patchAreaDistributionRANGE(int fd, char **par, struct area_entry *ad,
double *result);
-int dominance(int fd, char **par, area_des ad, double *result);
-int richness(int fd, char **par, area_des ad, double *result);
+int dominance(int fd, char **par, struct area_entry *ad, double *result);
+int richness(int fd, char **par, struct area_entry *ad, double *result);
Modified: grass/branches/develbranch_6/raster/r.li/r.li.daemon/list.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.daemon/list.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.daemon/list.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -25,11 +25,11 @@
* \param l list where to insert
* \param mess the message to insert
*/
-void insertNode(list l, msg mess)
+void insertNode(struct list *l, msg mess)
{
- node new;
+ struct node *new;
- new = G_malloc(sizeof(struct nodoLista));
+ new = G_malloc(sizeof(struct node));
new->m = G_malloc(sizeof(msg));
if (new != NULL) {
@@ -56,20 +56,20 @@
*\brief remove a node from list
* \param list where to remove
*/
-void removeNode(list l)
+void removeNode(struct list *l)
{
if (l->head == NULL) {
return;
}
if (l->head->next == NULL) {
- node tmp = l->head;
+ struct node *tmp = l->head;
l->head = NULL;
free(tmp);
l->size--;
}
else {
- node tmp = l->head;
+ struct node *tmp = l->head;
l->head = l->head->next;
l->head->prev = NULL;
@@ -83,7 +83,7 @@
* \param gen area generator to use
* \param msg next area message
*/
-int next(g_areas gen, msg * toReturn)
+int next(struct g_area *gen, msg *toReturn)
{
if (gen->cl > gen->cols)
Modified: grass/branches/develbranch_6/raster/r.li/r.li.daemon/list.h
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.daemon/list.h 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.daemon/list.h 2014-02-09 01:47:52 UTC (rev 58957)
@@ -27,10 +27,10 @@
* \member next the next item in list
* \member m the content of list node
*/
-struct nodoLista
+struct node
{
- struct nodoLista *prev;
- struct nodoLista *next;
+ struct node *prev;
+ struct node *next;
msg *m;
};
@@ -42,29 +42,26 @@
* \member tail last item in list
* \member size number of items in list
*/
-struct lista
+struct list
{
- struct nodoLista *head;
- struct nodoLista *tail;
+ struct node *head;
+ struct node *tail;
int size;
};
-typedef struct nodoLista *node;
-typedef struct lista *list;
-
/**
* \brief insert a item in list
* \param l list where to put items
* \param mess the message to insert
*/
-void insertNode(list l, msg m);
+void insertNode(struct list *l, msg m);
/**
* \brief remove head item
* \param l list where to remove
*/
-void removeNode(list l);
+void removeNode(struct list *l);
/**
* \brief struct for runtime area generation
@@ -80,7 +77,7 @@
* \param sf_y y coordinate of sample frame
* \param maskname name of mask for the area
*/
-struct generatore
+struct g_area
{
int dist;
int add_row;
@@ -97,11 +94,9 @@
char *maskname;
};
-typedef struct generatore *g_areas;
-
/**
* \brief runtime area generation
* \param gen area generator to use
* \param msg next area message
*/
-int next(g_areas gen, msg * toReturn);
+int next(struct g_area *gen, msg *toReturn);
Modified: grass/branches/develbranch_6/raster/r.li/r.li.daemon/worker.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.daemon/worker.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.daemon/worker.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -37,7 +37,7 @@
#define CACHESIZE 4194304
-void worker(char *raster, int f(int, char **, area_des, double *),
+void worker(char *raster, int f(int, char **, struct area_entry *, double *),
char *server_channel, char *mychannel, char **parameters)
{
char *mapset;
@@ -45,7 +45,7 @@
int rec_ch, send_ch, erease_mask = 0, data_type = 0;
int cache_rows, used = 0;
msg toReceive, toSend;
- area_des ad;
+ static struct area_entry *ad;
double result;
int pid;
struct Cell_head hd;
@@ -279,7 +279,7 @@
return G_store(tmp_file);
}
-CELL *RLI_get_cell_raster_row(int fd, int row, area_des ad)
+CELL *RLI_get_cell_raster_row(int fd, int row, struct area_entry *ad)
{
int hash;
@@ -294,7 +294,7 @@
}
-DCELL *RLI_get_dcell_raster_row(int fd, int row, area_des ad)
+DCELL *RLI_get_dcell_raster_row(int fd, int row, struct area_entry *ad)
{
int hash;
@@ -309,7 +309,7 @@
}
-FCELL *RLI_get_fcell_raster_row(int fd, int row, area_des ad)
+FCELL *RLI_get_fcell_raster_row(int fd, int row, struct area_entry *ad)
{
int hash;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.dominance/dominance.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.dominance/dominance.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.dominance/dominance.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -21,9 +21,9 @@
#include "../r.li.daemon/avl.h"
#include "../r.li.daemon/daemon.h"
-int calculate(int fd, area_des ad, double *result);
-int calculateD(int fd, area_des ad, double *result);
-int calculateF(int fd, area_des ad, double *result);
+int calculate(int fd, struct area_entry *ad, double *result);
+int calculateD(int fd, struct area_entry *ad, double *result);
+int calculateF(int fd, struct area_entry *ad, double *result);
int main(int argc, char *argv[])
{
@@ -59,7 +59,7 @@
}
-int dominance(int fd, char **par, area_des ad, double *result)
+int dominance(int fd, char **par, struct area_entry *ad, double *result)
{
char *mapset;
@@ -110,7 +110,7 @@
}
-int calculate(int fd, area_des ad, double *result)
+int calculate(int fd, struct area_entry *ad, double *result)
{
CELL *buf;
@@ -322,7 +322,7 @@
-int calculateD(int fd, area_des ad, double *result)
+int calculateD(int fd, struct area_entry *ad, double *result)
{
DCELL *buf;
@@ -526,7 +526,7 @@
}
-int calculateF(int fd, area_des ad, double *result)
+int calculateF(int fd, struct area_entry *ad, double *result)
{
FCELL *buf;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.edgedensity/edgedensity.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.edgedensity/edgedensity.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.edgedensity/edgedensity.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -20,9 +20,9 @@
#include "../r.li.daemon/avl.h"
#include "../r.li.daemon/daemon.h"
-int calculate(int fd, area_des ad, char **valore, double *result);
-int calculateD(int fd, area_des ad, char **valore, double *result);
-int calculateF(int fd, area_des ad, char **valore, double *result);
+int calculate(int fd, struct area_entry *ad, char **valore, double *result);
+int calculateD(int fd, struct area_entry *ad, char **valore, double *result);
+int calculateF(int fd, struct area_entry *ad, char **valore, double *result);
int main(int argc, char *argv[])
{
@@ -73,7 +73,7 @@
}
-int edgedensity(int fd, char **valore, area_des ad, double *result)
+int edgedensity(int fd, char **valore, struct area_entry *ad, double *result)
{
struct Cell_head hd;
@@ -121,7 +121,7 @@
}
-int calculate(int fd, area_des ad, char **valore, double *result)
+int calculate(int fd, struct area_entry *ad, char **valore, double *result)
{
double indice = 0;
double e = 0;
@@ -372,7 +372,7 @@
}
-int calculateD(int fd, area_des ad, char **valore, double *result)
+int calculateD(int fd, struct area_entry *ad, char **valore, double *result)
{
double indice = 0;
double e = 0;
@@ -624,7 +624,7 @@
return RLI_OK;
}
-int calculateF(int fd, area_des ad, char **valore, double *result)
+int calculateF(int fd, struct area_entry *ad, char **valore, double *result)
{
double indice = 0;
double e = 0;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.mpa/mpa.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.mpa/mpa.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.mpa/mpa.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -22,9 +22,9 @@
#include "../r.li.daemon/daemon.h"
-int calculate(int fd, area_des ad, double *result);
-int calculateD(int fd, area_des ad, double *result);
-int calculateF(int fd, area_des ad, double *result);
+int calculate(int fd, struct area_entry *ad, double *result);
+int calculateD(int fd, struct area_entry *ad, double *result);
+int calculateF(int fd, struct area_entry *ad, double *result);
int main(int argc, char *argv[])
{
@@ -60,7 +60,7 @@
}
-int meanPixelAttribute(int fd, char **par, area_des ad, double *result)
+int meanPixelAttribute(int fd, char **par, struct area_entry *ad, double *result)
{
char *mapset;
@@ -110,7 +110,7 @@
-int calculate(int fd, area_des ad, double *result)
+int calculate(int fd, struct area_entry *ad, double *result)
{
CELL *buf;
@@ -174,7 +174,7 @@
return RLI_OK;
}
-int calculateD(int fd, area_des ad, double *result)
+int calculateD(int fd, struct area_entry *ad, double *result)
{
DCELL *buf;
@@ -239,7 +239,7 @@
return RLI_OK;
}
-int calculateF(int fd, area_des ad, double *result)
+int calculateF(int fd, struct area_entry *ad, double *result)
{
FCELL *buf;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.mps/mps.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.mps/mps.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.mps/mps.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -23,9 +23,9 @@
#include "../r.li.daemon/daemon.h"
-int calculate(int fd, area_des ad, struct Cell_head hd, double *result);
-int calculateD(int fd, area_des ad, struct Cell_head hd, double *result);
-int calculateF(int fd, area_des ad, struct Cell_head hd, double *result);
+int calculate(int fd, struct area_entry *ad, struct Cell_head hd, double *result);
+int calculateD(int fd, struct area_entry *ad, struct Cell_head hd, double *result);
+int calculateF(int fd, struct area_entry *ad, struct Cell_head hd, double *result);
int main(int argc, char *argv[])
@@ -61,7 +61,7 @@
-int meanPatchSize(int fd, char **par, area_des ad, double *result)
+int meanPatchSize(int fd, char **par, struct area_entry *ad, double *result)
{
char *mapset;
@@ -112,7 +112,7 @@
}
-int calculate(int fd, area_des ad, struct Cell_head hd, double *result)
+int calculate(int fd, struct area_entry *ad, struct Cell_head hd, double *result)
{
CELL *buf;
CELL *buf_sup;
@@ -484,7 +484,7 @@
}
-int calculateD(int fd, area_des ad, struct Cell_head hd, double *result)
+int calculateD(int fd, struct area_entry *ad, struct Cell_head hd, double *result)
{
DCELL *buf;
DCELL *buf_sup;
@@ -853,7 +853,7 @@
}
-int calculateF(int fd, area_des ad, struct Cell_head hd, double *result)
+int calculateF(int fd, struct area_entry *ad, struct Cell_head hd, double *result)
{
FCELL *buf;
FCELL *buf_sup;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.padcv/padcv.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.padcv/padcv.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.padcv/padcv.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -22,9 +22,9 @@
#include "../r.li.daemon/GenericCell.h"
#include "../r.li.daemon/daemon.h"
-int calculate(int fd, area_des ad, double *result);
-int calculateD(int fd, area_des ad, double *result);
-int calculateF(int fd, area_des ad, double *result);
+int calculate(int fd, struct area_entry *ad, double *result);
+int calculateD(int fd, struct area_entry *ad, double *result);
+int calculateF(int fd, struct area_entry *ad, double *result);
int main(int argc, char *argv[])
{
@@ -52,7 +52,7 @@
raster->answer, output->answer);
}
-int patchAreaDistributionCV(int fd, char **par, area_des ad, double *result)
+int patchAreaDistributionCV(int fd, char **par, struct area_entry *ad, double *result)
{
char *mapset;
double indice = 0;
@@ -96,7 +96,7 @@
return RLI_OK;
}
-int calculate(int fd, area_des ad, double *result)
+int calculate(int fd, struct area_entry *ad, double *result)
{
CELL *buf;
CELL *buf_sup;
@@ -494,7 +494,7 @@
return RLI_OK;
}
-int calculateD(int fd, area_des ad, double *result)
+int calculateD(int fd, struct area_entry *ad, double *result)
{
DCELL *buf;
DCELL *buf_sup;
@@ -888,7 +888,7 @@
return RLI_OK;
}
-int calculateF(int fd, area_des ad, double *result)
+int calculateF(int fd, struct area_entry *ad, double *result)
{
FCELL *buf;
FCELL *buf_sup;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.padrange/padrange.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.padrange/padrange.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.padrange/padrange.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -22,9 +22,9 @@
#include "../r.li.daemon/GenericCell.h"
#include "../r.li.daemon/daemon.h"
-int calculate(int fd, area_des ad, double *result);
-int calculateD(int fd, area_des ad, double *result);
-int calculateF(int fd, area_des ad, double *result);
+int calculate(int fd, struct area_entry *ad, double *result);
+int calculateD(int fd, struct area_entry *ad, double *result);
+int calculateF(int fd, struct area_entry *ad, double *result);
int main(int argc, char *argv[])
{
@@ -52,7 +52,7 @@
raster->answer, output->answer);
}
-int patchAreaDistributionRANGE(int fd, char **par, area_des ad,
+int patchAreaDistributionRANGE(int fd, char **par, struct area_entry *ad,
double *result)
{
char *mapset;
@@ -97,7 +97,7 @@
}
-int calculate(int fd, area_des ad, double *result)
+int calculate(int fd, struct area_entry *ad, double *result)
{
CELL *buf;
@@ -507,7 +507,7 @@
-int calculateD(int fd, area_des ad, double *result)
+int calculateD(int fd, struct area_entry *ad, double *result)
{
DCELL *buf;
DCELL *buf_sup;
@@ -890,7 +890,7 @@
-int calculateF(int fd, area_des ad, double *result)
+int calculateF(int fd, struct area_entry *ad, double *result)
{
FCELL *buf;
FCELL *buf_sup;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.padsd/padsd.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.padsd/padsd.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.padsd/padsd.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -21,9 +21,9 @@
#include "../r.li.daemon/avlID.h"
#include "../r.li.daemon/GenericCell.h"
#include "../r.li.daemon/daemon.h"
-int calculate(int fd, area_des ad, double *result);
-int calculateD(int fd, area_des ad, double *result);
-int calculateF(int fd, area_des ad, double *result);
+int calculate(int fd, struct area_entry *ad, double *result);
+int calculateD(int fd, struct area_entry *ad, double *result);
+int calculateF(int fd, struct area_entry *ad, double *result);
int main(int argc, char *argv[])
{
struct Option *raster, *conf, *output;
@@ -50,7 +50,7 @@
raster->answer, output->answer);
}
-int patchAreaDistributionSD(int fd, char **par, area_des ad, double *result)
+int patchAreaDistributionSD(int fd, char **par, struct area_entry *ad, double *result)
{
char *mapset;
double indice = 0;
@@ -94,7 +94,7 @@
return RLI_OK;
}
-int calculate(int fd, area_des ad, double *result)
+int calculate(int fd, struct area_entry *ad, double *result)
{
CELL *buf;
CELL *buf_sup;
@@ -493,7 +493,7 @@
-int calculateD(int fd, area_des ad, double *result)
+int calculateD(int fd, struct area_entry *ad, double *result)
{
DCELL *buf;
DCELL *buf_sup;
@@ -885,7 +885,7 @@
return RLI_OK;
}
-int calculateF(int fd, area_des ad, double *result)
+int calculateF(int fd, struct area_entry *ad, double *result)
{
FCELL *buf;
FCELL *buf_sup;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.patchdensity/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.patchdensity/main.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.patchdensity/main.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -56,7 +56,7 @@
}
-int patch_density(int fd, char **par, area_des ad, double *result)
+int patch_density(int fd, char **par, struct area_entry *ad, double *result)
{
CELL *buf, *sup;
int count = 0, i, j, connected = 0, complete_line = 1, other_above = 0;
@@ -196,7 +196,7 @@
area = (((EW_DIST1 + EW_DIST2) / 2) / hd.cols) *
(((NS_DIST1 + NS_DIST2) / 2) / hd.rows) *
- (ad->rl * ad->cl - null_count);
+ (ad->rl *ad->cl - null_count);
if (area != 0)
*result = (count / area) * 1000000;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.patchnum/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.patchnum/main.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.patchnum/main.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -56,7 +56,7 @@
}
-int patch_number(int fd, char **par, area_des ad, double *result)
+int patch_number(int fd, char **par, struct area_entry *ad, double *result)
{
CELL *buf, *sup;
int count = 0, i, j, connected = 0, complete_line = 1, other_above = 0;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.pielou/pielou.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.pielou/pielou.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.pielou/pielou.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -26,11 +26,11 @@
#include "../r.li.daemon/avl.h"
#include "../r.li.daemon/daemon.h"
-int calculate(int fd, area_des ad, double *result);
+int calculate(int fd, struct area_entry *ad, double *result);
-int calculateD(int fd, area_des ad, double *result);
+int calculateD(int fd, struct area_entry *ad, double *result);
-int calculateF(int fd, area_des ad, double *result);
+int calculateF(int fd, struct area_entry *ad, double *result);
/*This function is used to sort the values in the moving window */
static int cmp(const void *pa, const void *pb)
@@ -79,7 +79,7 @@
}
-int pielou(int fd, char **par, area_des ad, double *result)
+int pielou(int fd, char **par, struct area_entry *ad, double *result)
{
char *mapset;
@@ -127,7 +127,7 @@
}
-int calculate(int fd, area_des ad, double *result)
+int calculate(int fd, struct area_entry *ad, double *result)
{
CELL *buf;
@@ -357,7 +357,7 @@
-int calculateD(int fd, area_des ad, double *result)
+int calculateD(int fd, struct area_entry *ad, double *result)
{
DCELL *buf;
@@ -583,7 +583,7 @@
}
-int calculateF(int fd, area_des ad, double *result)
+int calculateF(int fd, struct area_entry *ad, double *result)
{
FCELL *buf;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.renyi/renyi.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.renyi/renyi.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.renyi/renyi.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -26,11 +26,11 @@
#include "../r.li.daemon/avl.h"
#include "../r.li.daemon/daemon.h"
-double calculate(area_des ad, int fd, char **par, double *result);
+double calculate(struct area_entry *ad, int fd, char **par, double *result);
-double calculateD(area_des ad, int fd, char **par, double *result);
+double calculateD(struct area_entry *ad, int fd, char **par, double *result);
-double calculateF(area_des ad, int fd, char **par, double *result);
+double calculateF(struct area_entry *ad, int fd, char **par, double *result);
int main(int argc, char *argv[])
{
@@ -86,7 +86,7 @@
}
-int renyi(int fd, char **par, area_des ad, double *result)
+int renyi(int fd, char **par, struct area_entry *ad, double *result)
{
char *mapset;
int ris = RLI_OK;
@@ -132,7 +132,7 @@
-double calculate(area_des ad, int fd, char **par, double *result)
+double calculate(struct area_entry *ad, int fd, char **par, double *result)
{
CELL *buf;
CELL corrCell;
@@ -324,7 +324,7 @@
}
-double calculateD(area_des ad, int fd, char **par, double *result)
+double calculateD(struct area_entry *ad, int fd, char **par, double *result)
{
DCELL *buf;
DCELL corrCell;
@@ -519,7 +519,7 @@
-double calculateF(area_des ad, int fd, char **par, double *result)
+double calculateF(struct area_entry *ad, int fd, char **par, double *result)
{
FCELL *buf;
FCELL corrCell;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.richness/richness.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.richness/richness.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.richness/richness.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -22,9 +22,9 @@
#include "../r.li.daemon/avl.h"
#include "../r.li.daemon/daemon.h"
-double calculate(area_des ad, int fd, double *result);
-double calculateD(area_des ad, int fd, double *result);
-double calculateF(area_des ad, int fd, double *result);
+double calculate(struct area_entry *ad, int fd, double *result);
+double calculateD(struct area_entry *ad, int fd, double *result);
+double calculateF(struct area_entry *ad, int fd, double *result);
int main(int argc, char *argv[])
{
@@ -59,7 +59,7 @@
}
-int dominance(int fd, char **par, area_des ad, double *result)
+int dominance(int fd, char **par, struct area_entry *ad, double *result)
{
char *mapset;
@@ -110,7 +110,7 @@
-double calculate(area_des ad, int fd, double *result)
+double calculate(struct area_entry *ad, int fd, double *result)
{
CELL *buf;
CELL corrCell;
@@ -269,7 +269,7 @@
}
-double calculateD(area_des ad, int fd, double *result)
+double calculateD(struct area_entry *ad, int fd, double *result)
{
DCELL *buf;
DCELL corrCell;
@@ -431,7 +431,7 @@
-double calculateF(area_des ad, int fd, double *result)
+double calculateF(struct area_entry *ad, int fd, double *result)
{
FCELL *buf;
FCELL corrCell;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.shannon/shannon.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.shannon/shannon.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.shannon/shannon.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -21,9 +21,9 @@
#include "../r.li.daemon/avl.h"
#include "../r.li.daemon/daemon.h"
-int calculate(int fd, area_des ad, double *result);
-int calculateD(int fd, area_des ad, double *result);
-int calculateF(int fd, area_des ad, double *result);
+int calculate(int fd, struct area_entry *ad, double *result);
+int calculateD(int fd, struct area_entry *ad, double *result);
+int calculateF(int fd, struct area_entry *ad, double *result);
int main(int argc, char *argv[])
{
@@ -59,7 +59,7 @@
}
-int shannon(int fd, char **par, area_des ad, double *result)
+int shannon(int fd, char **par, struct area_entry * ad, double *result)
{
char *mapset;
@@ -110,7 +110,7 @@
}
-int calculate(int fd, area_des ad, double *result)
+int calculate(int fd, struct area_entry *ad, double *result)
{
CELL *buf;
@@ -314,7 +314,7 @@
-int calculateD(int fd, area_des ad, double *result)
+int calculateD(int fd, struct area_entry *ad, double *result)
{
DCELL *buf;
@@ -517,7 +517,7 @@
}
-int calculateF(int fd, area_des ad, double *result)
+int calculateF(int fd, struct area_entry *ad, double *result)
{
FCELL *buf;
Modified: grass/branches/develbranch_6/raster/r.li/r.li.shape/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.shape/main.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.shape/main.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -55,7 +55,7 @@
}
-int shape_index(int fd, char **par, area_des ad, double *result)
+int shape_index(int fd, char **par, struct area_entry *ad, double *result)
{
@@ -89,6 +89,7 @@
}
}
}
+ /* todo? free(mask_buf); */
}
/* calculate distance */
Modified: grass/branches/develbranch_6/raster/r.li/r.li.simpson/simpson.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.simpson/simpson.c 2014-02-09 00:58:11 UTC (rev 58956)
+++ grass/branches/develbranch_6/raster/r.li/r.li.simpson/simpson.c 2014-02-09 01:47:52 UTC (rev 58957)
@@ -22,9 +22,9 @@
#include "../r.li.daemon/avl.h"
#include "../r.li.daemon/daemon.h"
-double calculate(area_des ad, int fd, double *result);
-double calculateD(area_des ad, int fd, double *result);
-double calculateF(area_des ad, int fd, double *result);
+double calculate(struct area_entry *ad, int fd, double *result);
+double calculateD(struct area_entry *ad, int fd, double *result);
+double calculateF(struct area_entry *ad, int fd, double *result);
int main(int argc, char *argv[])
{
@@ -59,7 +59,7 @@
}
-int simpson(int fd, char **par, area_des ad, double *result)
+int simpson(int fd, char **par, struct area_entry *ad, double *result)
{
char *mapset;
@@ -110,7 +110,7 @@
-double calculate(area_des ad, int fd, double *result)
+double calculate(struct area_entry *ad, int fd, double *result)
{
CELL *buf;
CELL corrCell;
@@ -300,7 +300,7 @@
}
-double calculateD(area_des ad, int fd, double *result)
+double calculateD(struct area_entry *ad, int fd, double *result)
{
DCELL *buf;
DCELL corrCell;
@@ -489,7 +489,7 @@
-double calculateF(area_des ad, int fd, double *result)
+double calculateF(struct area_entry *ad, int fd, double *result)
{
FCELL *buf;
FCELL corrCell;
More information about the grass-commit
mailing list