From 7468e8b15f66fd340ece373a9bacf6802a5ddd46 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 6 Jan 2023 20:33:42 +0000 Subject: [PATCH] C++ compilation --- tools/grib_get_data.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/grib_get_data.c b/tools/grib_get_data.c index 76d2ac0f6..689d66c54 100644 --- a/tools/grib_get_data.c +++ b/tools/grib_get_data.c @@ -159,8 +159,8 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) num_bytes = (numberOfPoints + 1) * sizeof(double); data_values = (double*)calloc(numberOfPoints + 1, sizeof(double)); if (!data_values) { - fprintf(stderr, "ERROR: Failed to allocate %ld bytes for data values (number of points=%ld)\n", - (long)num_bytes, numberOfPoints); + fprintf(stderr, "ERROR: Failed to allocate %zu bytes for data values (number of points=%ld)\n", + num_bytes, numberOfPoints); exit(GRIB_OUT_OF_MEMORY); } @@ -183,7 +183,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) } if (size != (size_t)numberOfPoints) { if (!grib_options_on("q")) - fprintf(stderr, "ERROR: Wrong number of points %d\n", (int)numberOfPoints); + fprintf(stderr, "ERROR: Wrong number of points %ld\n", numberOfPoints); if (grib_options_on("f")) exit(1); }