Skip to content

Commit

Permalink
v.kriging: fix compilation warnings (#934)
Browse files Browse the repository at this point in the history
* v.kriging: fix compilation warnings

- passing argument 3 of ‘submatrix’ from incompatible pointer type
- expected ‘struct write *’ but argument is of type ‘struct write **
- initialization of ‘double *’ from incompatible pointer type ‘int *
- initialization of ‘struct write *’ from incompatible pointer type ‘struct write **

* Fix Clang format error

---------

Co-authored-by: Edouard Choinière <[email protected]>
  • Loading branch information
tmszi and echoix authored Oct 18, 2024
1 parent 147ebe7 commit b24bf40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/vector/v.kriging/utils_kriging.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ void crossvalidation(struct int_par *xD, struct points *pnts,
correct_indices(direction, list, r, pnts, var_par);

GM_sub = submatrix(list, GM,
&xD->report); // create submatrix using indices
xD->report); // create submatrix using indices
GM_Inv = G_matrix_inverse(GM_sub); // inverse matrix
G_matrix_free(GM_sub);

Expand Down Expand Up @@ -834,8 +834,8 @@ int compare_NN(struct ilist *list, struct ilist *list_new, int modified)
{
// local variables
int n = list->n_values, n_new = list_new->n_values;
double *list_value = list->value;
double *list_new_value = list_new->value;
int *list_value = list->value;
int *list_new_value = list_new->value;

int i, next = 0; // the samples are different

Expand All @@ -859,7 +859,7 @@ void make_subsamples(struct int_par *xD, struct ilist *list, double *r0,
// Local variables
int i3 = xD->i3;
double *vals = pnts->invals;
struct write *report = &xD->report;
struct write *report = xD->report;

int direction;
mat_struct *GM_sub;
Expand Down
4 changes: 2 additions & 2 deletions src/vector/v.kriging/utils_raster.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* open raster layer */
void open_layer(struct int_par *xD, struct reg_par *reg, struct output *out)
{
struct write *report = &xD->report;
struct write *report = xD->report;

/* 2D Raster layer */
if (xD->i3 == FALSE) {
Expand Down Expand Up @@ -34,7 +34,7 @@ void write2layer(struct int_par *xD, struct reg_par *reg, struct output *out,
// Local variables
int i3 = xD->i3;
int ndeps = reg->ndeps, nrows = reg->nrows, ncols = reg->ncols;
struct write *report = &xD->report;
struct write *report = xD->report;

int col, row, dep;
int pass = 0; /* Number of processed cells */
Expand Down

0 comments on commit b24bf40

Please sign in to comment.