Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r.geomorphon: fix -Wextra compiler warning #2754

Merged
merged 1 commit into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions raster/r.geomorphon/geom.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,23 +219,23 @@ float variance(float *elevation, int pattern_size)
return variance / (float)pattern_size;
}

int radial2cartesian(PATTERN *pattern)
void radial2cartesian(PATTERN *pattern)
{
/* this function converts radial coordinates of geomorphon
* (assuming center as 0,0) to cartezian coordinates
* with the beginning in the central cell of geomorphon */
int i;

for (i = 0; i < NUM_DIRS; ++i)
if (pattern->distance > 0) {
for (i = 0; i < NUM_DIRS; ++i) {
if (pattern->distance[0] > 0.) {
pattern->x[i] = pattern->distance[i] * sins[i];
pattern->y[i] = pattern->distance[i] * coss[i];
}
else {
pattern->x[i] = 0;
pattern->y[i] = 0;
pattern->x[i] = 0.;
pattern->y[i] = 0.;
}
return 0;
}
}

/*
Expand Down
2 changes: 1 addition & 1 deletion raster/r.geomorphon/local_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ double octa_perimeter(const PATTERN *);
double octa_area(const PATTERN *);
double mesh_perimeter(const PATTERN *);
double mesh_area(const PATTERN *);
int radial2cartesian(PATTERN *);
void radial2cartesian(PATTERN *);

/* profile */
void prof_int(const char *, const int);
Expand Down