mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-03-19 17:30:27 +08:00
fix a bunch of uninitialized variables
This commit is contained in:
parent
d5209d808f
commit
88f7950d6f
2
cf
2
cf
@ -127,7 +127,7 @@ FLAGS="$FLAGS --disable-pnetcdf"
|
||||
#FLAGS="$FLAGS --with-udunits"
|
||||
#FLAGS="$FLAGS --with-libcf"
|
||||
#FLAGS="$FLAGS --enable-benchmarks"
|
||||
#FLAGS="$FLAGS --enable-extra-tests"
|
||||
FLAGS="$FLAGS --enable-extra-tests"
|
||||
#FLAGS="$FLAGS --enable-logging"
|
||||
|
||||
FLAGS="$FLAGS --disable-shared"
|
||||
|
@ -41,7 +41,7 @@ int
|
||||
nc_get_att(int ncid, int varid, const char *name, void *value)
|
||||
{
|
||||
NC* ncp;
|
||||
int stat;
|
||||
int stat = NC_NOERR;
|
||||
nc_type xtype;
|
||||
|
||||
if ((stat = NC_check_id(ncid, &ncp)))
|
||||
|
@ -212,7 +212,7 @@ that name does not already exist:
|
||||
@code
|
||||
#include <netcdf.h>
|
||||
...
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int ncid;
|
||||
...
|
||||
status = nc_create("foo.nc", NC_NOCLOBBER, &ncid);
|
||||
@ -225,7 +225,7 @@ be in the 64-bit offset format.
|
||||
@code
|
||||
#include <netcdf.h>
|
||||
...
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int ncid;
|
||||
...
|
||||
status = nc_create("foo_large.nc", NC_NOCLOBBER|NC_64BIT_OFFSET, &ncid);
|
||||
@ -238,7 +238,7 @@ be in the HDF5 format.
|
||||
@code
|
||||
#include <netcdf.h>
|
||||
...
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int ncid;
|
||||
...
|
||||
status = nc_create("foo_HDF5.nc", NC_NOCLOBBER|NC_NETCDF4, &ncid);
|
||||
@ -253,7 +253,7 @@ the classic netCDF-3 data model.
|
||||
@code
|
||||
#include <netcdf.h>
|
||||
...
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int ncid;
|
||||
...
|
||||
status = nc_create("foo_HDF5_classic.nc", NC_NOCLOBBER|NC_NETCDF4|NC_CLASSIC_MODEL, &ncid);
|
||||
@ -315,7 +315,7 @@ and initial size for the file.
|
||||
\code
|
||||
#include <netcdf.h>
|
||||
...
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int ncid;
|
||||
int intialsz = 2048;
|
||||
int *bufrsize;
|
||||
@ -417,7 +417,7 @@ named foo.nc for read-only, non-shared access:
|
||||
@code
|
||||
#include <netcdf.h>
|
||||
...
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int ncid;
|
||||
...
|
||||
status = nc_open("foo.nc", 0, &ncid);
|
||||
@ -576,7 +576,7 @@ named foo.nc and put it into define mode:
|
||||
\code
|
||||
#include <netcdf.h>
|
||||
...
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int ncid;
|
||||
...
|
||||
status = nc_open("foo.nc", NC_WRITE, &ncid);
|
||||
@ -638,7 +638,7 @@ netCDF dataset named foo.nc and put it into data mode:
|
||||
\code
|
||||
#include <netcdf.h>
|
||||
...
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int ncid;
|
||||
...
|
||||
status = nc_create("foo.nc", NC_NOCLOBBER, &ncid);
|
||||
@ -653,7 +653,7 @@ netCDF dataset named foo.nc and put it into data mode:
|
||||
int
|
||||
nc_enddef(int ncid)
|
||||
{
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
NC *ncp;
|
||||
status = NC_check_id(ncid, &ncp);
|
||||
if(status != NC_NOERR) return status;
|
||||
@ -907,7 +907,7 @@ netCDF dataset named foo.nc and release its netCDF ID:
|
||||
\code
|
||||
#include <netcdf.h>
|
||||
...
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int ncid;
|
||||
...
|
||||
status = nc_create("foo.nc", NC_NOCLOBBER, &ncid);
|
||||
|
@ -91,7 +91,7 @@ int
|
||||
nc_var_par_access(int ncid, int varid, int par_access)
|
||||
{
|
||||
NC* ncp;
|
||||
int stat;
|
||||
int stat = NC_NOERR;
|
||||
|
||||
if ((stat = NC_check_id(ncid, &ncp)))
|
||||
return stat;
|
||||
|
@ -85,7 +85,7 @@ typedef signed char schar;
|
||||
static int
|
||||
numrecvars(int ncid, int *nrecvarsp, int *recvarids)
|
||||
{
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int nvars = 0;
|
||||
int ndims = 0;
|
||||
int nrecvars = 0;
|
||||
@ -131,7 +131,7 @@ numrecvars(int ncid, int *nrecvarsp, int *recvarids)
|
||||
static int
|
||||
ncrecsize(int ncid, int varid, size_t *recsizep)
|
||||
{
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int recdimid;
|
||||
nc_type type;
|
||||
int ndims;
|
||||
@ -175,7 +175,7 @@ ncrecsize(int ncid, int varid, size_t *recsizep)
|
||||
static int
|
||||
dimsizes(int ncid, int varid, size_t *sizes)
|
||||
{
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int ndims;
|
||||
int id;
|
||||
int dimids[MAX_NC_DIMS];
|
||||
@ -211,7 +211,7 @@ nc_inq_rec(
|
||||
int *recvarids,
|
||||
size_t *recsizes)
|
||||
{
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int nvars = 0;
|
||||
int recdimid;
|
||||
int varid;
|
||||
@ -264,7 +264,7 @@ nc_put_rec(
|
||||
size_t recnum,
|
||||
void* const* datap)
|
||||
{
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int varid;
|
||||
int rvarids[MAX_NC_VARS];
|
||||
int nrvars;
|
||||
@ -310,7 +310,7 @@ nc_get_rec(
|
||||
size_t recnum,
|
||||
void **datap)
|
||||
{
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int varid;
|
||||
int rvarids[MAX_NC_VARS];
|
||||
int nrvars;
|
||||
@ -512,7 +512,7 @@ ncdimdef(
|
||||
)
|
||||
{
|
||||
int dimid;
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
if(length < 0) {
|
||||
status = NC_EDIMSIZE;
|
||||
nc_advise("ncdimdef", status, "ncid %d", ncid);
|
||||
|
@ -208,7 +208,7 @@ nc_def_var(int ncid, const char *name, nc_type xtype,
|
||||
int ndims, const int *dimidsp, int *varidp)
|
||||
{
|
||||
NC* ncp;
|
||||
int stat;
|
||||
int stat = NC_NOERR;
|
||||
|
||||
if ((stat = NC_check_id(ncid, &ncp)))
|
||||
return stat;
|
||||
@ -292,7 +292,7 @@ nc_rename_var(int ncid, int varid, const char *name)
|
||||
int
|
||||
NC_is_recvar(int ncid, int varid, size_t* nrecs)
|
||||
{
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
int unlimid;
|
||||
int ndims;
|
||||
int dimset[NC_MAX_VAR_DIMS];
|
||||
@ -427,7 +427,7 @@ NC_getshape(int ncid, int varid, int ndims, size_t* shape)
|
||||
{
|
||||
int dimids[NC_MAX_VAR_DIMS];
|
||||
int i;
|
||||
int status;
|
||||
int status = NC_NOERR;
|
||||
|
||||
if ((status = nc_inq_vardimid(ncid, varid, dimids)))
|
||||
return status;
|
||||
|
@ -83,8 +83,8 @@ NCDEFAULT_get_varm(int ncid, int varid, const size_t *start,
|
||||
const size_t *edges, const ptrdiff_t *stride,
|
||||
const ptrdiff_t *imapp, void *value0, nc_type memtype)
|
||||
{
|
||||
int status;
|
||||
nc_type vartype;
|
||||
int status = NC_NOERR;
|
||||
nc_type vartype = NC_NAT;
|
||||
int varndims,maxidim;
|
||||
NC* ncp;
|
||||
size_t memtypelen;
|
||||
@ -451,8 +451,8 @@ int
|
||||
nc_get_vara(int ncid, int varid, const size_t *startp,
|
||||
const size_t *countp, void *ip)
|
||||
{
|
||||
NC* ncp;
|
||||
nc_type xtype;
|
||||
NC* ncp = NULL;
|
||||
nc_type xtype = NC_NAT;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
stat = nc_inq_vartype(ncid, varid, &xtype);
|
||||
@ -1010,7 +1010,7 @@ nc_get_vars (int ncid, int varid, const size_t * startp,
|
||||
void *ip)
|
||||
{
|
||||
NC* ncp;
|
||||
int stat;
|
||||
int stat = NC_NOERR;
|
||||
|
||||
if ((stat = NC_check_id(ncid, &ncp)))
|
||||
return stat;
|
||||
@ -1245,7 +1245,7 @@ nc_get_varm(int ncid, int varid, const size_t * startp,
|
||||
const ptrdiff_t * imapp, void *ip)
|
||||
{
|
||||
NC* ncp;
|
||||
int stat;
|
||||
int stat = NC_NOERR;
|
||||
|
||||
if ((stat = NC_check_id(ncid, &ncp)))
|
||||
return stat;
|
||||
|
@ -83,9 +83,10 @@ NCDEFAULT_put_varm(
|
||||
const void *value0,
|
||||
nc_type memtype)
|
||||
{
|
||||
int status;
|
||||
nc_type vartype;
|
||||
int varndims,maxidim;
|
||||
int status = NC_NOERR;
|
||||
nc_type vartype = NC_NAT;
|
||||
int varndims = 0;
|
||||
int maxidim = 0;
|
||||
NC* ncp;
|
||||
size_t memtypelen;
|
||||
ptrdiff_t cvtmap[NC_MAX_VAR_DIMS];
|
||||
@ -930,7 +931,7 @@ nc_put_vars (int ncid, int varid, const size_t *startp,
|
||||
const void *op)
|
||||
{
|
||||
NC *ncp;
|
||||
int stat;
|
||||
int stat = NC_NOERR;
|
||||
|
||||
if ((stat = NC_check_id(ncid, &ncp)))
|
||||
return stat;
|
||||
@ -1160,7 +1161,7 @@ nc_put_varm (int ncid, int varid, const size_t *startp,
|
||||
const ptrdiff_t *imapp, const void *op)
|
||||
{
|
||||
NC *ncp;
|
||||
int stat;
|
||||
int stat = NC_NOERR;
|
||||
|
||||
if ((stat = NC_check_id(ncid, &ncp)))
|
||||
return stat;
|
||||
|
Loading…
x
Reference in New Issue
Block a user