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 committed Oct 18, 2024
1 parent 9a77166 commit 130be7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/vector/v.kriging/utils_kriging.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,9 @@ void crossvalidation(struct int_par *xD, struct points *pnts,
if (n_vals > 0) { // if positive:
correct_indices(direction, list, r, pnts, var_par);

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

// calculate cell
Expand Down Expand Up @@ -801,8 +802,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 @@ -826,7 +827,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 @@ -31,7 +31,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 130be7b

Please sign in to comment.