mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-30 16:10:44 +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
|
static int
|
||||||
pluginnamecheck(const char* name)
|
pluginnamecheck(const char* name)
|
||||||
{
|
{
|
||||||
size_t i,count,len;
|
size_t count,len;
|
||||||
|
long i;
|
||||||
const char* p;
|
const char* p;
|
||||||
if(name == NULL) return 0;
|
if(name == NULL) return 0;
|
||||||
/* get basename */
|
/* get basename */
|
||||||
@ -1516,7 +1517,7 @@ pluginnamecheck(const char* name)
|
|||||||
if(p != NULL) name = (p+1);
|
if(p != NULL) name = (p+1);
|
||||||
len = strlen(name);
|
len = strlen(name);
|
||||||
if(len == 0) return 0;
|
if(len == 0) return 0;
|
||||||
i = len-1;
|
i = (long)(len-1);
|
||||||
count = 1;
|
count = 1;
|
||||||
p = name+i;
|
p = name+i;
|
||||||
for(;i>=0;i--,count++,p--) {
|
for(;i>=0;i--,count++,p--) {
|
||||||
|
@ -89,7 +89,7 @@ getformat(const char* sformat)
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
makeurl(struct Options* faoptions)
|
makeurl(struct Options* faopt)
|
||||||
{
|
{
|
||||||
int stat = NC_NOERR;
|
int stat = NC_NOERR;
|
||||||
int format;
|
int format;
|
||||||
@ -101,7 +101,7 @@ makeurl(struct Options* faoptions)
|
|||||||
#else
|
#else
|
||||||
pid = (int)getpid();
|
pid = (int)getpid();
|
||||||
#endif
|
#endif
|
||||||
switch (format = getformat(faoptions->format)) {
|
switch (format = getformat(faopt->format)) {
|
||||||
case NC_FORMATX_NC4:
|
case NC_FORMATX_NC4:
|
||||||
snprintf(url,sizeof(url),"tmp_%d.nc",pid);
|
snprintf(url,sizeof(url),"tmp_%d.nc",pid);
|
||||||
break;
|
break;
|
||||||
@ -110,23 +110,23 @@ makeurl(struct Options* faoptions)
|
|||||||
break;
|
break;
|
||||||
default: stat = NC_EINVAL; break;
|
default: stat = NC_EINVAL; break;
|
||||||
}
|
}
|
||||||
if(stat == NC_NOERR) faoptions->url = strdup(url);
|
if(stat == NC_NOERR) faopt->url = strdup(url);
|
||||||
return stat;
|
return stat;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
makefilterid(struct Options* faoptions)
|
makefilterid(struct Options* faopt)
|
||||||
{
|
{
|
||||||
int stat = NC_NOERR;
|
int stat = NC_NOERR;
|
||||||
const struct Filter* f = NULL;
|
const struct Filter* f = NULL;
|
||||||
for(f=known_filters;f->name;f++) {
|
for(f=known_filters;f->name;f++) {
|
||||||
if(strcmp(f->name,faoptions->filtername)==0) {
|
if(strcmp(f->name,faopt->filtername)==0) {
|
||||||
faoptions->filterid = f->id;
|
faopt->filterid = f->id;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* See if it is a number */
|
/* 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;}
|
{stat = NC_EINVAL; goto done;}
|
||||||
done:
|
done:
|
||||||
return stat;
|
return stat;
|
||||||
|
@ -469,7 +469,7 @@ NCZ_blosc_modify_parameters(int ncid, int varid, size_t* vnparamsp, unsigned** v
|
|||||||
{stat = NC_EFILTER; goto done;}
|
{stat = NC_EFILTER; goto done;}
|
||||||
nparams = 7;
|
nparams = 7;
|
||||||
|
|
||||||
if(vnparams > 0 && vparams == NULL)
|
if(vparams == NULL)
|
||||||
{stat = NC_EFILTER; goto done;}
|
{stat = NC_EFILTER; goto done;}
|
||||||
|
|
||||||
if(wnparamsp == NULL || wparamsp == NULL)
|
if(wnparamsp == NULL || wparamsp == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user