Fix warnings in examples

This commit is contained in:
Peter Hill 2024-03-11 17:58:45 +00:00
parent 3e70c8133f
commit 662afedb90
No known key found for this signature in database
GPG Key ID: 0C6B9742E72848EE
2 changed files with 4 additions and 4 deletions

View File

@ -79,7 +79,7 @@ main()
float lats[NLAT], lons[NLON];
/* Loop indexes. */
int lvl, lat, lon, rec, i = 0;
int lvl, lat, lon, i = 0;
/* Error handling. */
int retval;
@ -128,7 +128,7 @@ main()
start[3] = 0;
/* Read and check one record at a time. */
for (rec = 0; rec < NREC; rec++)
for (size_t rec = 0; rec < NREC; rec++)
{
start[0] = rec;
if ((retval = nc_get_vara_float(ncid, pres_varid, start,

View File

@ -78,7 +78,7 @@ main()
float lats[NLAT], lons[NLON];
/* Loop indexes. */
int lvl, lat, lon, rec, i = 0;
int lvl, lat, lon, i = 0;
/* Error handling. */
int retval;
@ -188,7 +188,7 @@ main()
surface temperature data. The arrays only hold one timestep worth
of data. We will just rewrite the same data for each timestep. In
a real application, the data would change between timesteps. */
for (rec = 0; rec < NREC; rec++)
for (size_t rec = 0; rec < NREC; rec++)
{
start[0] = rec;
if ((retval = nc_put_vara_float(ncid, pres_varid, start, count,