Skip to content

Commit

Permalink
Use platform independent int64 format specifier (OSGeo#1316)
Browse files Browse the repository at this point in the history
Addresses -Wformat compiler warnings.
  • Loading branch information
nilason authored and marisn committed Mar 22, 2021
1 parent 892e7fa commit 898a532
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/vector/Vlib/build_nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <inttypes.h>
#include <grass/glocale.h>
#include <grass/vector.h>

Expand Down Expand Up @@ -116,7 +117,7 @@ int Vect_build_nat(struct Map_info *Map, int build)
G_progress(1, 1);

G_verbose_message(n_("One primitive registered", "%d primitives registered", plus->n_lines), plus->n_lines);
G_verbose_message(n_("One vertex registered", "%jd vertices registered", npoints), npoints);
G_verbose_message(n_("One vertex registered", "%" PRId64 " vertices registered", npoints), npoints);

plus->built = GV_BUILD_BASE;
}
Expand Down
5 changes: 3 additions & 2 deletions raster/r.info/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <inttypes.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/glocale.h>
Expand Down Expand Up @@ -445,7 +446,7 @@ int main(int argc, char **argv)
fprintf(out, "rows=%d\n", cellhd.rows);
fprintf(out, "cols=%d\n", cellhd.cols);

fprintf(out, "cells=%jd\n",
fprintf(out, "cells=%" PRId64 "\n",
(grass_int64)cellhd.rows * cellhd.cols);

fprintf(out, "datatype=%s\n",
Expand Down Expand Up @@ -497,7 +498,7 @@ int main(int argc, char **argv)

if (!gflag->answer) {
/* always report total number of cells */
fprintf(out, "cells=%jd\n",
fprintf(out, "cells=%" PRId64 "\n",
(grass_int64)cellhd.rows * cellhd.cols);
}

Expand Down

0 comments on commit 898a532

Please sign in to comment.