C++ compilation

This commit is contained in:
Shahram Najm 2023-01-06 20:33:42 +00:00
parent bed7e91e6b
commit 7468e8b15f
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}