Skip to content

Commit

Permalink
fix -Wformat-pedantic compiler warnings (#2872)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilason committed Mar 8, 2023
1 parent 94afb5d commit 22b69f8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/gmath/sparse_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int G_math_add_spvector(G_math_spvector **Asp, G_math_spvector *spvector,
G_debug(5,
"Add sparse vector %p to the sparse linear equation system at "
"row %i\n",
spvector, row);
(void *)spvector, row);
Asp[row] = spvector;
}
else {
Expand Down
10 changes: 5 additions & 5 deletions lib/gpde/n_arrays.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,9 @@ void N_print_array_2d_info(N_array_2d *data)
fprintf(stdout, "Offset: %i\n", data->offset);
fprintf(stdout, "Internal cols: %i\n", data->cols_intern);
fprintf(stdout, "Internal rows: %i\n", data->rows_intern);
fprintf(stdout, "CELL array pointer: %p\n", data->cell_array);
fprintf(stdout, "FCELL array pointer: %p\n", data->fcell_array);
fprintf(stdout, "DCELL array pointer: %p\n", data->dcell_array);
fprintf(stdout, "CELL array pointer: %p\n", (void *)data->cell_array);
fprintf(stdout, "FCELL array pointer: %p\n", (void *)data->fcell_array);
fprintf(stdout, "DCELL array pointer: %p\n", (void *)data->dcell_array);

return;
}
Expand Down Expand Up @@ -1179,8 +1179,8 @@ void N_print_array_3d_info(N_array_3d *data)
fprintf(stdout, "Internal cols: %i\n", data->cols_intern);
fprintf(stdout, "Internal rows: %i\n", data->rows_intern);
fprintf(stdout, "Internal depths: %i\n", data->depths_intern);
fprintf(stdout, "FCELL array pointer: %p\n", data->fcell_array);
fprintf(stdout, "DCELL array pointer: %p\n", data->dcell_array);
fprintf(stdout, "FCELL array pointer: %p\n", (void *)data->fcell_array);
fprintf(stdout, "DCELL array pointer: %p\n", (void *)data->dcell_array);

return;
}
Expand Down
10 changes: 5 additions & 5 deletions lib/gpde/n_gradient.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,8 @@ void N_print_gradient_field_2d_info(N_gradient_field_2d *field)
fprintf(stdout, "N_gradient_field_2d \n");
fprintf(stdout, "Cols %i\n", field->cols);
fprintf(stdout, "Rows: %i\n", field->rows);
fprintf(stdout, "X array pointer: %p\n", field->x_array);
fprintf(stdout, "Y array pointer: %p\n", field->y_array);
fprintf(stdout, "X array pointer: %p\n", (void *)field->x_array);
fprintf(stdout, "Y array pointer: %p\n", (void *)field->y_array);
fprintf(stdout, "Min %g\n", field->min);
fprintf(stdout, "Max %g\n", field->max);
fprintf(stdout, "Sum %g\n", field->sum);
Expand Down Expand Up @@ -1066,9 +1066,9 @@ void N_print_gradient_field_3d_info(N_gradient_field_3d *field)
fprintf(stdout, "Cols %i\n", field->cols);
fprintf(stdout, "Rows: %i\n", field->rows);
fprintf(stdout, "Depths %i\n", field->depths);
fprintf(stdout, "X array pointer: %p\n", field->x_array);
fprintf(stdout, "Y array pointer: %p\n", field->y_array);
fprintf(stdout, "Z array pointer: %p\n", field->z_array);
fprintf(stdout, "X array pointer: %p\n", (void *)field->x_array);
fprintf(stdout, "Y array pointer: %p\n", (void *)field->y_array);
fprintf(stdout, "Z array pointer: %p\n", (void *)field->z_array);
fprintf(stdout, "Min %g\n", field->min);
fprintf(stdout, "Max %g\n", field->max);
fprintf(stdout, "Sum %g\n", field->sum);
Expand Down
4 changes: 2 additions & 2 deletions lib/vector/Vlib/read_pg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ int Vect__open_cursor_next_line_pg(struct Format_info_pg *pg_info,

/* set cursor name */
G_asprintf(&(pg_info->cursor_name), "%s_%s_%p", pg_info->schema_name,
pg_info->table_name, pg_info->conn);
pg_info->table_name, (void *)pg_info->conn);

if (!pg_info->toposchema_name) {
/* simple feature access (geom, fid) */
Expand Down Expand Up @@ -1387,7 +1387,7 @@ int Vect__open_cursor_line_pg(struct Format_info_pg *pg_info, int fid, int type)

pg_info->cursor_fid = fid;
G_asprintf(&(pg_info->cursor_name), "%s_%s_%d_%p", pg_info->schema_name,
pg_info->table_name, fid, pg_info->conn);
pg_info->table_name, fid, (void *)pg_info->conn);

if (!pg_info->toposchema_name) {
/* simple feature access (geom) */
Expand Down
3 changes: 2 additions & 1 deletion raster/r.resamp.filter/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@ static void filter(void)
}

for (i = num_rows; i < rows; i++) {
G_debug(5, "read: %p = %d", bufs[t_id][i], row0 + i);
G_debug(5, "read: %p = %d", (void *)bufs[t_id][i],
row0 + i);
/* enlarging the source window to the North and South is
* not possible for global maps in ll */
if (row0 + i >= 0 && row0 + i < src_w.rows)
Expand Down
2 changes: 1 addition & 1 deletion vector/v.label.sa/labels.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ label_t *labels_init(struct params *p, int *n_labels)
G_debug(1, "Need to allocate %lu bytes of memory",
sizeof(label_t) * label_sz);
labels = (label_t *)G_malloc(sizeof(label_t) * label_sz);
G_debug(1, "labels=%p", labels);
G_debug(1, "labels=%p", (void *)labels);

if (labels == NULL)
G_fatal_error(_("Cannot allocate %lu bytes of memory"),
Expand Down

0 comments on commit 22b69f8

Please sign in to comment.