Addressed a number of minor bugs reported by Clang.

This commit is contained in:
Ward Fisher 2013-11-20 13:37:21 -07:00
parent cc95bd3d47
commit 1d007eb101
4 changed files with 11 additions and 9 deletions

View File

@ -32,7 +32,7 @@ PROJECT_NAME = netCDF-C
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 4.3.1-RC3
PROJECT_NUMBER = 4.3.1-RC5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer

View File

@ -162,8 +162,9 @@ nullfree(s);
if(nclistlength(allvars) == nclistlength(vars)) flags |= NCF_PREFETCH_ALL;
ncstat = buildcachenode34(nccomm,newconstraint,vars,&cache,flags);
newconstraint = NULL; /* buildcachenode34 takes control of newconstraint */
if(ncstat) goto done;
cache->wholevariable = 1; /* All prefetches are whole variable */
if(ncstat || cache == NULL) goto done;
else
cache->wholevariable = 1; /* All prefetches are whole variable */
/* Make cache node be the prefetch node */
nccomm->cdf.cache->prefetch = cache;
if(SHOWFETCH) {
@ -190,7 +191,7 @@ ncbytesfree(buf);
done:
nclistfree(vars);
dcefree((DCEnode*)newconstraint);
if(ncstat) freenccachenode(nccomm,cache);
if(ncstat && cache != NULL) freenccachenode(nccomm,cache);
return THROW(ncstat);
}

View File

@ -151,7 +151,7 @@ defrecorddim3(NCDAPCOMMON* dapcomm)
NCerror
defseqdims(NCDAPCOMMON* dapcomm)
{
unsigned int i;
unsigned int i = 0;
NCerror ncstat = NC_NOERR;
int seqdims = 1; /* default is to compute seq dims counts */
@ -169,7 +169,7 @@ defseqdims(NCDAPCOMMON* dapcomm)
for(i=0;i<nclistlength(dapcomm->cdf.ddsroot->tree->seqnodes);i++) {
CDFnode* seq = (CDFnode*)nclistget(dapcomm->cdf.ddsroot->tree->seqnodes,i);
size_t seqsize;
size_t seqsize = 0;
CDFnode* sqdim = NULL;
CDFnode* container;
/* Does this sequence match the requirements for use ? */
@ -214,7 +214,7 @@ getseqdimsize(NCDAPCOMMON* dapcomm, CDFnode* seq, size_t* sizep)
CDFnode* dxdroot;
CDFnode* xseq;
NCbytes* seqcountconstraints = ncbytesnew();
size_t seqsize;
size_t seqsize = 0;
/* Read the minimal amount of data in order to get the count */
/* If the url is unconstrainable, then get the whole thing */

View File

@ -387,8 +387,9 @@ createtempfile(OCstate* state, OCtree* tree)
return stat;
fail:
if(name != NULL) free(name);
oclog(OCLOGERR,"oc_open: attempt to create tmp file failed: %s",name);
oclog(OCLOGERR,"oc_open: attempt to create tmp file failed: %s",name == NULL ? "[NULL]" : name);
if(name != NULL) {free(name);name=NULL;}
return stat;
}