mirror of https://github.com/ecmwf/eccodes.git
Compiler warnings: use '%zu' in the format string for size_t
This commit is contained in:
parent
0644fdc346
commit
8abfafdbb0
|
@ -74,7 +74,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
if (strlen(str_code) != NUM_DESCRIPTOR_DIGITS) {
|
||||
fprintf(stderr, "Error on line %zu: descriptor code '%s' (column 1) is not %lu digits.\n",
|
||||
fprintf(stderr, "Error on line %zu: descriptor code '%s' (column 1) is not %zu digits.\n",
|
||||
line_number, str_code, NUM_DESCRIPTOR_DIGITS);
|
||||
return 1;
|
||||
}
|
||||
|
@ -90,13 +90,13 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
if (strlen(str_key) >= maxlen_keyName) {
|
||||
fprintf(stderr, "Error on line %zu: descriptor key name '%s' (column 2) exceeds %lu characters.\n",
|
||||
fprintf(stderr, "Error on line %zu: descriptor key name '%s' (column 2) exceeds %zu characters.\n",
|
||||
line_number, str_key, maxlen_keyName);
|
||||
return 1;
|
||||
}
|
||||
str_units = list[4];
|
||||
if (strlen(str_units) >= maxlen_units) {
|
||||
fprintf(stderr, "Error on line %lu: descriptor units '%s' (column 5) exceeds %lu characters.\n",
|
||||
fprintf(stderr, "Error on line %zu: descriptor units '%s' (column 5) exceeds %zu characters.\n",
|
||||
line_number, str_units, maxlen_units);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -175,14 +175,14 @@ int main(int argc, char** argv)
|
|||
Assert(num_all_vals == numberOfDataPoints); /*Sanity check*/
|
||||
GRIB_CHECK(grib_set_long(h, "bitmapPresent", 1), 0);
|
||||
GRIB_CHECK(grib_set_double(h, "missingValue", missing), 0);
|
||||
printf("Fully specified: %ld values\n", num_all_vals);
|
||||
printf("Fully specified: %zu values\n", num_all_vals);
|
||||
GRIB_CHECK(grib_set_double_array(h, "values", values, num_all_vals), 0);
|
||||
}
|
||||
else {
|
||||
const size_t num_coded_vals = sizeof(codedValues) / sizeof(codedValues[0]);
|
||||
Assert(strcmp(mode, "coded_values") == 0);
|
||||
Assert(num_coded_vals < numberOfDataPoints); /*Sanity check*/
|
||||
printf("Partially specified: %ld values\n", num_coded_vals);
|
||||
printf("Partially specified: %zu values\n", num_coded_vals);
|
||||
GRIB_CHECK(grib_set_force_double_array(h, "codedValues", codedValues, num_coded_vals), 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue