Commit 5f943d88 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Fix gcc warnings.

parent b6346f08
......@@ -1616,16 +1616,16 @@ void cdiStreamSetupVlist_(stream_t *streamptr, int vlistID)
if (streamptr->filemode == 'w')
{
tstepsNewEntry(streamptr); // timestep 0
int vlistID = streamptr->vlistID;
int time_is_varying = vlistHasTime(vlistID);
int vlistIDw = streamptr->vlistID;
int time_is_varying = vlistHasTime(vlistIDw);
if ( time_is_varying )
{
int taxisID = vlistInqTaxis(vlistID);
int taxisID = vlistInqTaxis(vlistIDw);
if ( taxisID == CDI_UNDEFID )
{
Warning("taxisID undefined for fileID = %d! Using absolute time axis.", streamptr->self);
taxisID = taxisCreate(TAXIS_ABSOLUTE);
vlistDefTaxis(vlistID, taxisID);
vlistDefTaxis(vlistIDw, taxisID);
}
#ifdef HAVE_LIBNETCDF
......
......@@ -1540,7 +1540,6 @@ void cdfScanVarAttr(int nvars, ncvar_t *ncvars, int ndims, ncdim_t *ncdims, int
for ( int i = 0; i < max_check_vars; ++i ) if ( checked_vars[i] ) Free(checked_vars[i]);
}
static
void cdfVerifyVarAttr(int nvars, ncvar_t *ncvars, ncdim_t *ncdims)
{
......@@ -2474,10 +2473,10 @@ bool cdf_read_coordinates(struct cdfLazyGrid *restrict lazyGrid, ncvar_t *ncvar,
{
grid->size = size;
int dimid = ncvars[ncvar->rpvarid].dimids[0];
size_t ysize = ncdims[dimid].len;
grid->y.size = ysize;
grid->reducedPointsSize = ysize;
grid->reducedPoints = (int*) Malloc(ysize*sizeof(int));
size_t len = ncdims[dimid].len;
grid->y.size = len;
grid->reducedPointsSize = len;
grid->reducedPoints = (int*) Malloc(len*sizeof(int));
cdf_get_var_int(ncvar->ncid, ncvar->rpvarid, grid->reducedPoints);
grid->np = ncvar->numLPE;
......@@ -3388,7 +3387,7 @@ void cdf_copy_attflt(int fileID, int vlistID, nc_type xtype, size_t attlen, char
}
static
void cdf_scan_global_attr(int fileID, int vlistID, stream_t *streamptr, int ngatts, int *instID, int *modelID, bool *ucla_les, unsigned char *uuidOfHGrid, unsigned char *uuidOfVGrid, char *gridfile, int *number_of_grid_used)
void cdf_scan_global_attr(int fileID, int vlistID, int ngatts, int *instID, int *modelID, bool *ucla_les, unsigned char *uuidOfHGrid, unsigned char *uuidOfVGrid, char *gridfile, int *number_of_grid_used)
{
nc_type xtype;
size_t attlen;
......@@ -3896,7 +3895,7 @@ int cdfInqContents(stream_t *streamptr)
// scan global attributes
cdf_scan_global_attr(fileID, vlistID, streamptr, ngatts, &instID, &modelID, &ucla_les,
cdf_scan_global_attr(fileID, vlistID, ngatts, &instID, &modelID, &ucla_les,
uuidOfHGrid, uuidOfVGrid, gridfile, &number_of_grid_used);
// find time dim
......@@ -4229,7 +4228,7 @@ double get_timevalue(int fileID, int nctimevarid, int tsID, timecache_t *tcache)
if ( tcache )
{
if ( tcache->size == 0 || (tsID < tcache->startid || tsID > (tcache->startid+tcache->size-1)) )
if ( tcache->size == 0 || (tsID < (int)tcache->startid || tsID > (int)(tcache->startid+tcache->size-1)) )
{
size_t maxvals = MAX_TIMECACHE_SIZE;
if (maxvals > tcache->maxvals) maxvals = tcache->maxvals;
......
......@@ -466,7 +466,7 @@ cdfDefAxisCommon(stream_t *streamptr, int gridID, int gridindex, int ndims, bool
{
int ncvarid = CDI_UNDEFID, ncbvarid = CDI_UNDEFID;
char axisname[CDI_MAX_NAME];
int length = CDI_MAX_NAME;
length = CDI_MAX_NAME;
cdiInqKeyString(gridID, axisKey, CDI_KEY_NAME, axisname, &length);
if ( axisname[0] == 0 ) Error("axis name undefined!");
......@@ -1703,13 +1703,13 @@ void cdfDefCharacter(stream_t *streamptr, int gridID, int gridindex, int xory, i
int ncaxisid;
if ( xory == 0 )
{
int length = CDI_MAX_NAME;
length = CDI_MAX_NAME;
cdiInqKeyString(gridID, CDI_XAXIS, CDI_KEY_NAME, axisname, &length);
gridInqXCvals(gridID, cvals);
}
else
{
int length = CDI_MAX_NAME;
length = CDI_MAX_NAME;
cdiInqKeyString(gridID, CDI_YAXIS, CDI_KEY_NAME, axisname, &length);
gridInqXCvals(gridID, cvals);
}
......
......@@ -2091,7 +2091,7 @@ void gribapiDefGridLCC(grib_handle *gh, int editionNumber, int gridID, int uvRel
}
static
void gribapiDefGridSTERE(grib_handle *gh, int editionNumber, int gridID)
void gribapiDefGridSTERE(grib_handle *gh, int gridID)
{
const long xsize = (long) gridInqXsize(gridID);
const long ysize = (long) gridInqYsize(gridID);
......@@ -2193,9 +2193,9 @@ void gribapiDefGridSpectral(grib_handle *gh, int gridID)
if ( gridInqComplexPacking(gridID) )
{
static const char truncAttNames[numTruncAtt][3] = { "JS", "KS", "MS" };
static const char truncAttNames2[numTruncAtt][3] = { "JS", "KS", "MS" };
for (size_t i = 0; i < numTruncAtt; ++i)
GRIB_CHECK(my_grib_set_long(gh, truncAttNames[i], 20), 0);
GRIB_CHECK(my_grib_set_long(gh, truncAttNames2[i], 20), 0);
}
}
......@@ -2296,7 +2296,7 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
}
case CDI_PROJ_STERE:
{
gribapiDefGridSTERE(gh, editionNumber, gridID);
gribapiDefGridSTERE(gh, gridID);
break;
}
case GRID_SPECTRAL:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment