[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #EAM-622298]: Missing: "unsigned long"



Ed,

> > > We have noticed that netCDF4 does not support the "unsigned long" datatyp
> e.
> > >
> > > The netCDF api supports the following:
> > > int nc_put_var_text  (int ncid, int varid, const char *tp);
> > > int nc_put_var_uchar (int ncid, int varid, const unsigned char *up);
> > > int nc_put_var_schar (int ncid, int varid, const signed char *cp);
> > > int nc_put_var_short (int ncid, int varid, const short *sp);
> > > int nc_put_var_int   (int ncid, int varid, const int *ip);
> > > int nc_put_var_long  (int ncid, int varid, const long *lp);
> > > int nc_put_var_float (int ncid, int varid, const float *fp);
> > > int nc_put_var_double(int ncid, int varid, const double *dp);
> > > int nc_put_var_ubyte (int ncid, int varid, const unsigned char *op);
> > > int nc_put_var_ushort(int ncid, int varid, const unsigned short *op);
> > > int nc_put_var_uint  (int ncid, int varid, const unsigned int *op);
> > > int nc_put_var_longlong (int ncid, int varid, const long long *op);
> > > int nc_put_var_ulonglong(int ncid, int varid, const unsigned long
> > > long *op);
> > > int nc_put_var_string(int ncid, int varid, const char **op);
> > > int nc_put_var       (int ncid, int varid,  const void *op);
> > >
> > > This list excludes the "unsigned long" datatype.  Is there a reason for
> > > this?  We would like to know this reason.  We want to avoid using the
> > > int datatype since we have found int to be implementation-defined: int
> > > is either 16 or 32 bits depending on the platform.

Just to be super clear about this, the type in the funcion name, such as
"ushort", refers to the type of the final argument to the call, not to
the netCDF data type.  That's why all the "ubyte" functions were a
mistake.  There is no "byte" type in C, and all the "ubyte" functions in
the C interface are really just the same as the "ucahr" functions.
There should be "ulong" functions becasue there is a C "unsigned long"
type, not because of any netCDF type.

> > It looks like an oversight, and I'm surprised no one else has noticed it
> > or commented on it.  Thanks for pointing out this gap.  I'll see if it's
> > something we can fix in the C interface before the 4.1 release, but it may
> > be too late, in which case it will be in a subsequent dot release.

--Russ



Ticket Details
===================
Ticket ID: EAM-622298
Department: Support netCDF
Priority: Normal
Status: Open