mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Fix new LGTM errors
This commit is contained in:
parent
092c395c76
commit
150e19cf87
@ -1508,7 +1508,8 @@ memset(plugin,0,sizeof(NCZ_Plugin));
|
||||
static int
|
||||
pluginnamecheck(const char* name)
|
||||
{
|
||||
size_t i,count,len;
|
||||
size_t count,len;
|
||||
long i;
|
||||
const char* p;
|
||||
if(name == NULL) return 0;
|
||||
/* get basename */
|
||||
@ -1516,7 +1517,7 @@ pluginnamecheck(const char* name)
|
||||
if(p != NULL) name = (p+1);
|
||||
len = strlen(name);
|
||||
if(len == 0) return 0;
|
||||
i = len-1;
|
||||
i = (long)(len-1);
|
||||
count = 1;
|
||||
p = name+i;
|
||||
for(;i>=0;i--,count++,p--) {
|
||||
|
@ -89,7 +89,7 @@ getformat(const char* sformat)
|
||||
|
||||
|
||||
static int
|
||||
makeurl(struct Options* faoptions)
|
||||
makeurl(struct Options* faopt)
|
||||
{
|
||||
int stat = NC_NOERR;
|
||||
int format;
|
||||
@ -101,7 +101,7 @@ makeurl(struct Options* faoptions)
|
||||
#else
|
||||
pid = (int)getpid();
|
||||
#endif
|
||||
switch (format = getformat(faoptions->format)) {
|
||||
switch (format = getformat(faopt->format)) {
|
||||
case NC_FORMATX_NC4:
|
||||
snprintf(url,sizeof(url),"tmp_%d.nc",pid);
|
||||
break;
|
||||
@ -110,23 +110,23 @@ makeurl(struct Options* faoptions)
|
||||
break;
|
||||
default: stat = NC_EINVAL; break;
|
||||
}
|
||||
if(stat == NC_NOERR) faoptions->url = strdup(url);
|
||||
if(stat == NC_NOERR) faopt->url = strdup(url);
|
||||
return stat;
|
||||
}
|
||||
|
||||
static int
|
||||
makefilterid(struct Options* faoptions)
|
||||
makefilterid(struct Options* faopt)
|
||||
{
|
||||
int stat = NC_NOERR;
|
||||
const struct Filter* f = NULL;
|
||||
for(f=known_filters;f->name;f++) {
|
||||
if(strcmp(f->name,faoptions->filtername)==0) {
|
||||
faoptions->filterid = f->id;
|
||||
if(strcmp(f->name,faopt->filtername)==0) {
|
||||
faopt->filterid = f->id;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
/* See if it is a number */
|
||||
if(1!=sscanf(faoptions->filtername,"%u",&faoptions->filterid))
|
||||
if(1!=sscanf(faopt->filtername,"%u",&faopt->filterid))
|
||||
{stat = NC_EINVAL; goto done;}
|
||||
done:
|
||||
return stat;
|
||||
|
@ -469,7 +469,7 @@ NCZ_blosc_modify_parameters(int ncid, int varid, size_t* vnparamsp, unsigned** v
|
||||
{stat = NC_EFILTER; goto done;}
|
||||
nparams = 7;
|
||||
|
||||
if(vnparams > 0 && vparams == NULL)
|
||||
if(vparams == NULL)
|
||||
{stat = NC_EFILTER; goto done;}
|
||||
|
||||
if(wnparamsp == NULL || wparamsp == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user