Skip to content

Commit

Permalink
fix -Wgnu-pointer-arith compiler warnings (#2875)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilason committed Mar 18, 2023
1 parent 29609fa commit 9e5ce91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions lib/raster3d/mask.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static float RASTER3D_MASKNUMmaskValue;

/*--------------------------------------------------------------------------*/

int Rast3d_mask_close()
int Rast3d_mask_close(void)
{
/* No Idea if this is correct return value */
if (!Rast3d_maskMapExistsVar)
Expand Down Expand Up @@ -304,12 +304,12 @@ void Rast3d_mask_tile(RASTER3D_Map *map, int tileIndex, void *tile, int type)
for (dy = y; dy < rows; dy++) {
for (dx = x; dx < cols; dx++) {
RASTER3D_MASKNUM(map, dx, dy, dz, tile, type);
tile += length;
tile = (char *)tile + length;
}

tile += xLength;
tile = (char *)tile + xLength;
}
tile += yLength;
tile = (char *)tile + yLength;
}
}

Expand Down
12 changes: 6 additions & 6 deletions raster/r.fill.stats/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ void print_weights_matrix(long int rows, long int cols)
void *get_input_row(unsigned long row_idx)
{
unsigned long i;
void *my_cell = NULL;
char *my_cell = NULL;

my_cell = CELL_INPUT_HANDLES[row_idx];

for (i = 0; i < PADDING_WIDTH; i++)
my_cell += CELL_IN_SIZE;

return (my_cell);
return (void *)my_cell;
}

/* NEIGHBORHOOD STATISTICS
Expand Down Expand Up @@ -331,7 +331,7 @@ void read_neighborhood(unsigned long row_index, unsigned long col, double min,
double max, int preserve, stats_struct *stats)
{
unsigned long i, j;
void *cell;
char *cell;
double cell_value;

stats->overwrite = 0;
Expand Down Expand Up @@ -511,7 +511,7 @@ void init_handles(void)
void advance_one_row(int file_desc, long current_row)
{
unsigned long i, j;
void *cell_input;
char *cell_input;
static unsigned long replace_row =
0; /* points to the row which will be replaced next */
unsigned long replace_pos = 0;
Expand Down Expand Up @@ -556,7 +556,7 @@ void interpolate_row(unsigned long row_index, unsigned long cols, double min,
stats_struct *stats, int write_err)
{
unsigned long j;
void *cell_output;
char *cell_output;
FCELL *err_output;

cell_output = CELL_OUTPUT;
Expand Down Expand Up @@ -744,7 +744,7 @@ int main(int argc, char *argv[])
int write_error;

/* file handlers */
void *cell_input;
char *cell_input;
int in_fd;
int out_fd;
int err_fd;
Expand Down
2 changes: 1 addition & 1 deletion raster/r.in.xyz/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int main(int argc, char *argv[])
RASTER_MAP_TYPE rtype;
struct History history;
char title[64];
void *n_array, *min_array, *max_array, *sum_array, *sumsq_array,
char *n_array, *min_array, *max_array, *sum_array, *sumsq_array,
*index_array;
void *raster_row, *ptr;
struct Cell_head region;
Expand Down

0 comments on commit 9e5ce91

Please sign in to comment.