diff --git a/mfhdf/fortran/jackets.c.in b/mfhdf/fortran/jackets.c.in index 8272dd1392..f03c23c448 100644 --- a/mfhdf/fortran/jackets.c.in +++ b/mfhdf/fortran/jackets.c.in @@ -18,15 +18,7 @@ #include #include #include -#ifdef HDF #include "local_nc.h" -#else /* HDF */ -#include "netcdf.h" -#endif /* HDF */ - - - - #if !NC_OLD_FILLVALUES @@ -874,9 +866,7 @@ nncvpt1(cdfid, varid, indices, value, rcode) int datatype, ndims, natts, i; long nindices[MAX_VAR_DIMS]; int dimid[MAX_VAR_DIMS]; -#ifdef HDF NC *handle=NC_check_id(*cdfid); -#endif /* HDF */ if (ncvarinq (*cdfid, *varid - 1, (char *) 0, (nc_type *) & datatype, &ndims, dimid, &natts) == -1) { @@ -907,7 +897,6 @@ nncvpt1(cdfid, varid, indices, value, rcode) } /* else */ #endif /* FORTRAN_HAS_NO_SHORT */ #ifdef H4_HAVE_LP64 -#ifdef HDF if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) { long longs = *(int *)value; if (ncvarput1(*cdfid, *varid - 1, nindices, (ncvoid *) &longs) == -1) { @@ -915,15 +904,6 @@ nncvpt1(cdfid, varid, indices, value, rcode) } return; } /* else */ -#else /* HDF */ - if ((nc_type) datatype == NC_LONG) { - long longs = *(int *)value; - if (ncvarput1(*cdfid, *varid - 1, nindices, (ncvoid *) &longs) == -1) { - *rcode = ncerr; - } - return; - } /* else */ -#endif /* HDF */ #endif if (ncvarput1 (*cdfid, *varid - 1, nindices, value) == -1) { *rcode = ncerr; @@ -973,9 +953,7 @@ nncvpt(cdfid, varid, start, count, value, rcode) { long ncount[MAX_VAR_DIMS], nstart[MAX_VAR_DIMS], i; int ndims, datatype, dimarray[MAX_VAR_DIMS], natts; -#ifdef HDF NC *handle=NC_check_id(*cdfid); -#endif /* HDF */ if (ncvarinq (*cdfid, *varid - 1, (char *) 0, (nc_type *) & datatype, &ndims, dimarray, &natts) == -1) { @@ -1021,7 +999,6 @@ nncvpt(cdfid, varid, start, count, value, rcode) } /* else */ #endif /* FORTRAN_HAS_NO_SHORT */ #ifdef H4_HAVE_LP64 -#ifdef HDF if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) { long *longs = itol (value, ncount, ndims); if (longs == NULL) { @@ -1035,21 +1012,6 @@ nncvpt(cdfid, varid, start, count, value, rcode) free (longs); return; } /* else */ -#else /* HDF */ - if ((nc_type) datatype == NC_LONG) { - long *longs = itol (value, ncount, ndims); - if (longs == NULL) { - *rcode = NC_SYSERR; - return; - } - if (ncvarput (*cdfid, *varid - 1, nstart, ncount, - (ncvoid *) longs) == -1) { - *rcode = ncerr; - } - free (longs); - return; - } /* else */ -#endif /* HDF */ #endif if (ncvarput (*cdfid, *varid - 1, nstart, ncount, value) == -1) { *rcode = ncerr; @@ -1112,9 +1074,7 @@ nncvptg(cdfid, varid, start, count, stride, basis, value, rcode) long nstride[MAX_VAR_DIMS], nbasis[MAX_VAR_DIMS]; long tmpbasis; int ndims, datatype, dimarray[MAX_VAR_DIMS], natts; -#ifdef HDF NC *handle=NC_check_id(*cdfid); -#endif /* HDF */ if (ncvarinq (*cdfid, *varid - 1, (char *) 0, (nc_type *) & datatype, &ndims, dimarray, &natts) == -1) { @@ -1189,7 +1149,6 @@ nncvptg(cdfid, varid, start, count, stride, basis, value, rcode) } /* else */ #endif /* FORTRAN_HAS_NO_SHORT */ #ifdef H4_HAVE_LP64 -#ifdef HDF if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) { long *longs = itolg (value, ncount, nbasis, ndims); if (longs == NULL) { @@ -1203,21 +1162,6 @@ nncvptg(cdfid, varid, start, count, stride, basis, value, rcode) free (longs); return; } /* else */ -#else /* HDF */ - if ((nc_type) datatype == NC_LONG) { - long *longs = itolg (value, ncount, nbasis, ndims); - if (longs == NULL) { - *rcode = NC_SYSERR; - return; - } - if (ncvarputg (*cdfid, *varid - 1, nstart, ncount, nstride, - (long*)NULL, (ncvoid *) longs) == -1) { - *rcode = ncerr; - } - free (longs); - return; - } /* else */ -#endif /* HDF */ #endif if (ncvarputg (*cdfid, *varid - 1, nstart, ncount, nstride, nbasis, value) == -1) { @@ -1282,9 +1226,7 @@ nncvgt1(cdfid, varid, indices, value, rcode) { long nindices[MAX_VAR_DIMS], i; int datatype, ndims, dimarray[MAX_VAR_DIMS], natts; -#ifdef HDF NC *handle=NC_check_id(*cdfid); -#endif /* HDF */ if (ncvarinq (*cdfid, *varid - 1, (char *) 0, (nc_type *) & datatype, &ndims, dimarray, &natts) == -1) { @@ -1325,7 +1267,6 @@ nncvgt1(cdfid, varid, indices, value, rcode) } /* else */ #endif /* FORTRAN_HAS_NO_SHORT */ #ifdef H4_HAVE_LP64 -#ifdef HDF if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) { long longs; int *ip = (int *) value; @@ -1337,19 +1278,6 @@ nncvgt1(cdfid, varid, indices, value, rcode) *ip = longs; return; } /* else */ -#else /* HDF */ - if ((nc_type) datatype == NC_LONG) { - long longs; - int *ip = (int *) value; - - if (ncvarget1(*cdfid, *varid - 1, nindices, (ncvoid *) &longs) == -1) { - *rcode = ncerr; - return; - } - *ip = longs; - return; - } /* else */ -#endif /* HDF */ #endif if (ncvarget1 (*cdfid, *varid - 1, nindices, value) == -1) { *rcode = ncerr; @@ -1403,9 +1331,7 @@ nncvgt(cdfid, varid, start, count, value, rcode) { long ncount[MAX_VAR_DIMS], nstart[MAX_VAR_DIMS]; int i, ndims, datatype, dimarray[MAX_VAR_DIMS], natts; -#ifdef HDF NC *handle=NC_check_id(*cdfid); -#endif /* HDF */ if (ncvarinq (*cdfid, *varid - 1, (char *) 0, (nc_type *) & datatype, &ndims, dimarray, &natts) == -1) { @@ -1467,7 +1393,6 @@ nncvgt(cdfid, varid, start, count, value, rcode) } /* else */ #endif /* FORTRAN_HAS_NO_SHORT */ #ifdef H4_HAVE_LP64 -#ifdef HDF if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) { long iocount = dimprod (ncount, ndims); /* product of dimensions */ /* EIP We need int buffer to read data in on the platforms where long is 8 bytes @@ -1494,29 +1419,6 @@ nncvgt(cdfid, varid, start, count, value, rcode) free (longs); return; } /* else */ -#else /* HDF */ - if ((nc_type) datatype == NC_LONG) { - long iocount = dimprod (ncount, ndims); /* product of dimensions */ - long *longs = (long *) malloc (iocount * sizeof (long)); - int *ip; - long *lp = longs; - - if (longs == NULL) { - *rcode = NC_SYSERR; - return; - } - if (ncvarget (*cdfid, *varid - 1, nstart, ncount, - (ncvoid *) longs) == -1) { - *rcode = ncerr; - free (longs); - return; - } - for (ip = (int *) value; iocount > 0; iocount--) - *ip++ = *lp++; - free (longs); - return; - } /* else */ -#endif /* HDF */ #endif if (ncvarget (*cdfid, *varid - 1, nstart, ncount, value) == -1) { *rcode = ncerr; @@ -1585,9 +1487,7 @@ nncvgtg(cdfid, varid, start, count, stride, basis, value, rcode) long nstride[MAX_VAR_DIMS], nbasis[MAX_VAR_DIMS]; long tmpbasis; int i, ndims, datatype, dimarray[MAX_VAR_DIMS], natts; -#ifdef HDF NC *handle=NC_check_id(*cdfid); -#endif /* HDF */ if (ncvarinq (*cdfid, *varid - 1, (char *) 0, (nc_type *) & datatype, &ndims, dimarray, &natts) == -1) { @@ -1676,7 +1576,6 @@ nncvgtg(cdfid, varid, start, count, stride, basis, value, rcode) } /* else */ #endif /* FORTRAN_HAS_NO_SHORT */ #ifdef H4_HAVE_LP64 -#ifdef HDF if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) { long iocount = dimprod (ncount, ndims); /* product of dimensions */ long *longs = (long *) malloc (iocount * sizeof (long)); @@ -1695,26 +1594,6 @@ nncvgtg(cdfid, varid, start, count, stride, basis, value, rcode) free (longs); return; } /* else */ -#else /* HDF */ - if ((nc_type) datatype == NC_LONG) { - long iocount = dimprod (ncount, ndims); /* product of dimensions */ - long *longs = (long *) malloc (iocount * sizeof (long)); - - if (longs == NULL) { - *rcode = NC_SYSERR; - return; - } - if (ncvargetg (*cdfid, *varid - 1, nstart, ncount, nstride, - (long*)NULL, (ncvoid *) longs) == -1) { - *rcode = ncerr; - free (longs); - return; - } - ltoig(longs, (int*)value, ncount, nbasis, ndims); - free (longs); - return; - } /* else */ -#endif /* HDF */ #endif if (ncvargetg (*cdfid, *varid - 1, nstart, ncount, nstride, nbasis, value) == -1) { @@ -1802,9 +1681,7 @@ nncapt(cdfid, varid, attname, datatype, attlen, value, rcode, attnamelen) int *rcode; { char name[MAX_NC_NAME + 1]; -#ifdef HDF NC *handle=NC_check_id(*cdfid); -#endif /* HDF */ nstrncpy (name, attname, attnamelen); @@ -1842,7 +1719,6 @@ nncapt(cdfid, varid, attname, datatype, attlen, value, rcode, attnamelen) } /* else */ #endif /* FORTRAN_HAS_NO_SHORT */ #ifdef H4_HAVE_LP64 -#ifdef HDF if ((nc_type) *datatype == NC_LONG && handle->file_type!=HDF_FILE) { long *longs = itol (value, attlen, 1); @@ -1857,22 +1733,6 @@ nncapt(cdfid, varid, attname, datatype, attlen, value, rcode, attnamelen) free (longs); return; } /* else */ -#else /* HDF */ - if ((nc_type) *datatype == NC_LONG) { - long *longs = itol (value, attlen, 1); - - if (longs == NULL) { - *rcode = NC_SYSERR; - return; - } - if (ncattput (*cdfid, *varid - 1, name, (nc_type) *datatype, *attlen, - (ncvoid *) longs) == -1) { - *rcode = ncerr; - } - free (longs); - return; - } /* else */ -#endif /* HDF */ #endif if (ncattput (*cdfid, *varid - 1, name, (nc_type) *datatype, *attlen, value) == -1) { @@ -1953,9 +1813,7 @@ nncagt(cdfid, varid, attname, value, rcode, attnamelen) char name[MAX_NC_NAME + 1]; int datatype; int attlen; -#ifdef HDF NC *handle=NC_check_id(*cdfid); -#endif /* HDF */ nstrncpy (name, attname, attnamelen); *rcode = 0; @@ -2007,7 +1865,6 @@ nncagt(cdfid, varid, attname, value, rcode, attnamelen) } /* else */ #endif /* FORTRAN_HAS_NO_SHORT */ #ifdef H4_HAVE_LP64 -#ifdef HDF if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) { /* EIP We need to use int buffer to read data in on the platforms where long is 8 bytes long *longs = (long *) malloc (attlen * sizeof (long)); @@ -2032,27 +1889,6 @@ nncagt(cdfid, varid, attname, value, rcode, attnamelen) free (longs); return; } /* else */ -#else /* HDF */ - if ((nc_type) datatype == NC_LONG) { - long *longs = (long *) malloc (attlen * sizeof (long)); - int *ip; - long *lp = longs; - - if (longs == NULL) { - *rcode = NC_SYSERR; - return; - } - if (ncattget (*cdfid, *varid - 1, name, (ncvoid *) longs) == -1) { - *rcode = ncerr; - free (longs); - return; - } - for (ip = (int *) value; attlen > 0; attlen--) - *ip++ = *lp++; - free (longs); - return; - } /* else */ -#endif /* HDF */ #endif if (ncattget (*cdfid, *varid - 1, name, value) == -1) { *rcode = ncerr; diff --git a/mfhdf/fortran/mfsdf.c b/mfhdf/fortran/mfsdf.c index 153df13a24..3abf9cfb77 100644 --- a/mfhdf/fortran/mfsdf.c +++ b/mfhdf/fortran/mfsdf.c @@ -27,8 +27,6 @@ */ #include "mfsdf.h" -#ifdef HDF - FRETVAL(intf) nsfscfill(intf *id, _fcd val); FRETVAL(intf) nsfsfill(intf *id, void *val); FRETVAL(intf) nsfgfill(intf *id, void *val); @@ -1571,7 +1569,6 @@ nsfsflmd(intf *id, intf *fillmode) { return ((intf)SDsetfillmode(*id, *fillmode)); } -#endif /* HDF */ /*------------------------------------------------------------------------- * Name: scgichnk diff --git a/mfhdf/libsrc/array.c b/mfhdf/libsrc/array.c index 736b675336..1316b48e2d 100644 --- a/mfhdf/libsrc/array.c +++ b/mfhdf/libsrc/array.c @@ -17,22 +17,6 @@ #include #include "local_nc.h" -#ifdef NO_MEM_FUNCTS -/* - * internal replacement for memset - */ -char * -NCmemset(char *s, int c, int n) -{ - char *cp; - - for (cp = s; cp < &s[n]; *cp++ = c) - /* nada */; - - return s; -} -#endif - /* * for a netcdf type * return the size of the on-disk representation @@ -229,22 +213,13 @@ NC_new_array(nc_type type, unsigned count, const void *values) if (ret == NULL) goto alloc_err; - ret->type = type; - ret->szof = NC_typelen(type); -#ifdef SDDEBUG - fprintf(stderr, "NC_new_array(): type=%u, NC_typelen(type)=%u\n", (unsigned)type, (unsigned)ret->szof); -#endif + ret->type = type; + ret->szof = NC_typelen(type); ret->count = count; memlen = count * ret->szof; ret->len = count * NC_xtypelen(type); -#ifdef SDDEBUG - fprintf(stderr, "NC_new_array(): count=%u, memlen=%u\n", count, memlen); -#endif if (count != 0) { ret->values = malloc(memlen); -#ifdef SDDEBUG - fprintf(stderr, "NC_new_array(): ret->values=%p, values=%p\n", ret->values, values); -#endif if (ret->values == NULL) goto alloc_err; if (values == NULL) { @@ -259,9 +234,6 @@ NC_new_array(nc_type type, unsigned count, const void *values) ret->values = NULL; } -#ifdef SDDEBUG - fprintf(stderr, "NC_new_array(): ret=%p\n", ret); -#endif return (ret); alloc_err: nc_serror("NC_new_array"); diff --git a/mfhdf/libsrc/attr.c b/mfhdf/libsrc/attr.c index 77dfa16a3e..810d713b59 100644 --- a/mfhdf/libsrc/attr.c +++ b/mfhdf/libsrc/attr.c @@ -33,9 +33,7 @@ NC_new_attr(const char *name, nc_type type, unsigned count, const void *values) ret->data = NC_new_array(type, count, values); if (ret->data == NULL) goto alloc_err; -#ifdef HDF ret->HDFtype = hdf_map_type(type); -#endif return (ret); alloc_err: nc_serror("NC_new_attr"); @@ -216,9 +214,7 @@ NC_aput(int cdfid, NC_array **ap, const char *name, nc_type datatype, unsigned c return (-1); } /* else */ -#ifdef HDF (*atp)->HDFtype = hdf_map_type(datatype); -#endif if (handle->flags & NC_HSYNC) { handle->xdrs->x_op = XDR_ENCODE; if (!xdr_cdf(handle->xdrs, &handle)) @@ -288,11 +284,7 @@ ncattname(int cdfid, int varid, int attnum, char *name) attr = (NC_attr **)(*ap)->values; attr += attnum; -#ifdef HDF (void)memcpy(name, (*attr)->name->values, (*attr)->name->len); -#else - (void)strncpy(name, (*attr)->name->values, (*attr)->name->len); -#endif name[(*attr)->name->len] = 0; return (attnum); @@ -462,10 +454,8 @@ xdr_NC_attr(XDR *xdrs, NC_attr **app) if (!xdr_NC_string(xdrs, &((*app)->name))) return (FALSE); - ret_value = xdr_NC_array(xdrs, &((*app)->data)); -#ifdef HDF + ret_value = xdr_NC_array(xdrs, &((*app)->data)); (*app)->HDFtype = hdf_map_type(((*app)->data)->type); -#endif return ret_value; } diff --git a/mfhdf/libsrc/cdf.c b/mfhdf/libsrc/cdf.c index bf3ce3559f..3acc57f2b0 100644 --- a/mfhdf/libsrc/cdf.c +++ b/mfhdf/libsrc/cdf.c @@ -17,7 +17,6 @@ #include "local_nc.h" #include "herr.h" -#ifdef HDF #include "hfile.h" int32 hdf_get_magicnum(const char *filename); @@ -25,8 +24,6 @@ int32 hdf_get_magicnum(const char *filename); static intn hdf_num_attrs(NC *handle, /* IN: handle to SDS */ int32 vg /* IN: ref of top Vgroup */); -#endif /* HDF */ - static bool_t NC_xdr_cdf(XDR *xdrs, NC **handlep); static int NC_free_xcdf(NC *); @@ -34,20 +31,8 @@ static int NC_free_xcdf(NC *); /* hmm we write the NDG out always for now */ #define WRITE_NDG 1 -/* Debugging: define for each function you want debugging printfs */ -/* #define HDF_READ_VARS -#define HDF_READ_ATTRS -#define HDF_NUM_ATTRS -#define HDF_XDR_CDF -#define HDF_VG_CLOBBER -#define HDF_CDF_CLOBBER -#define HDF_CLOSE */ - /* * Free the resources that xdr_cdf allocates - * - * NOTE: Modified to return SUCCEED / FAIL and to catch errors - * -GV 9/16/97 */ static int NC_free_xcdf(NC *handle) @@ -67,10 +52,6 @@ NC_free_xcdf(NC *handle) return ret_value; } -/* - * NOTE: Modified to return SUCCEED / FAIL and to catch errors - * -GV 9/16/97 - */ int NC_free_cdf(NC *handle) { @@ -85,7 +66,6 @@ NC_free_cdf(NC *handle) free(handle->xdrs); handle->xdrs = NULL; -#ifdef HDF if (handle->file_type == HDF_FILE) { if (Vend(handle->hdf_file) == FAIL) HGOTO_FAIL(FAIL); @@ -93,7 +73,6 @@ NC_free_cdf(NC *handle) if (Hclose(handle->hdf_file) == FAIL) HGOTO_FAIL(FAIL); } -#endif /* HDF */ free(handle); handle = NULL; @@ -103,15 +82,11 @@ NC_free_cdf(NC *handle) return ret_value; } -#ifdef HDF - /* --------------------------- hdf_get_magicnum ---------------------------- */ /* Return the file's format version number, i.e., magic number. This number can be used to determine the format type of a file, such as HDF, CDF, or netCDF/64-bit. - - Refactored out from existing functions. -BMR, Jun 7, 2016 */ int32 hdf_get_magicnum(const char *filename) @@ -223,19 +198,13 @@ HDisnetcdf64(const char *filename) } /* HDisnetcdf64 */ /******************************************************************************/ -#endif /* HDF */ -/* - * NOTE: Cleaned up to catch errors - GV 9/19/97 - */ NC * NC_new_cdf(const char *name, int mode) { -#ifdef HDF - int32 hdf_mode = DFACC_RDWR; /* default */ -#endif - NC *cdf = NULL; - NC *ret_value = NULL; + int32 hdf_mode = DFACC_RDWR; /* default */ + NC *cdf = NULL; + NC *ret_value = NULL; /* allocate an NC struct */ cdf = calloc(1, sizeof(NC)); @@ -246,7 +215,6 @@ NC_new_cdf(const char *name, int mode) cdf->flags = mode; -#ifdef HDF /* * See what type of file we are looking at. * If we are creating a new file it will be an HDF file @@ -263,11 +231,6 @@ NC_new_cdf(const char *name, int mode) cdf->file_type = netCDF_FILE; else HGOTO_FAIL(NULL); - -#ifdef DEBUG - if (cdf->file_type == CDF_FILE) - printf("Yow! found a CDF file\n"); -#endif } /* Delay allocating xdr struct until it is needed */ @@ -295,11 +258,6 @@ NC_new_cdf(const char *name, int mode) break; } -#else /* !HDF */ - if (NCxdrfile_create(cdf->xdrs, name, mode) < 0) - HGOTO_FAIL(NULL); -#endif /* !HDF */ - cdf->dims = NULL; cdf->attrs = NULL; cdf->vars = NULL; @@ -308,7 +266,6 @@ NC_new_cdf(const char *name, int mode) cdf->numrecs = 0; cdf->redefid = -1; -#ifdef HDF /* * determine the HDF access mode */ @@ -367,15 +324,11 @@ NC_new_cdf(const char *name, int mode) cdf->path[strlen(name)] = '\0'; break; case CDF_FILE: -#ifdef DEBUG - fprintf(stderr, "About to do CDF file set up\n"); -#endif cdf->cdf_fp = (hdf_file_t)HI_OPEN(name, hdf_mode); if (OPENERR(cdf->cdf_fp)) HRETURN_ERROR(DFE_DENIED, NULL); break; } -#endif /* HDF */ /* * Read in the contents @@ -414,8 +367,6 @@ NC_new_cdf(const char *name, int mode) /* * Duplicate a description structure. * Can only be called for 'old' extant on disk, eg, old in DATA mode. - * - * NOTE: Cleaned up to catch errors - GV 9/19/97 */ NC * NC_dup_cdf(const char *name, int mode, NC *old) @@ -444,9 +395,7 @@ NC_dup_cdf(const char *name, int mode, NC *old) cdf->recsize = 0; cdf->numrecs = 0; -#ifdef HDF cdf->file_type = old->file_type; -#endif if (NCxdrfile_create(cdf->xdrs, name, mode) < 0) HGOTO_FAIL(NULL); @@ -514,15 +463,11 @@ ncinquire(int cdfid, int *ndimsp, int *nvarsp, int *nattrsp, int *xtendimp) return (cdfid); } -/* - * NOTE: modified how errors were caught and reported - GV 9/19/97 - */ bool_t xdr_cdf(XDR *xdrs, NC **handlep) { bool_t ret_value = TRUE; -#ifdef HDF switch ((*handlep)->file_type) { case HDF_FILE: if (hdf_xdr_cdf(xdrs, handlep) == FAIL) @@ -538,9 +483,6 @@ xdr_cdf(XDR *xdrs, NC **handlep) ret_value = FALSE; break; } -#else /* !HDF */ - ret_value = NC_xdr_cdf(xdrs, handlep); -#endif /* !HDF */ return ret_value; } @@ -602,7 +544,6 @@ NC_xdr_cdf(XDR *xdrs, NC **handlep) return (TRUE); } -#ifdef HDF /***************************************************************************** * * NCSA HDF / netCDF Project @@ -722,7 +663,6 @@ hdf_get_ref(NC *handle, int i) int hdf_create_dim_vdata(XDR *xdrs, NC *handle, NC_dim *dim) { - int found = FALSE; int ref; int32 val; long dsize; @@ -730,35 +670,15 @@ hdf_create_dim_vdata(XDR *xdrs, NC *handle, NC_dim *dim) (void)xdrs; -#ifdef DEBUG - fprintf(stderr, "hdf_create_dim_vdata I've been called\n"); - fprintf(stderr, "handle->hdf_file = %d\n", handle->hdf_file); -#endif + dsize = 1; + val = (dim->size != NC_UNLIMITED) ? dim->size : (int32)handle->numrecs; + ref = VHstoredata(handle->hdf_file, "Values", (const uint8 *)&val, dsize, DFNT_INT32, dim->name->values, + DIM_VALS01); - if (found) { - /* load in the variable's values */ -#ifdef DEBUG - fprintf(stderr, "Found real values for dimension %s\n", dim->name->values); -#endif - } - else { - dsize = 1; - val = (dim->size != NC_UNLIMITED) ? dim->size : (int32)handle->numrecs; - ref = VHstoredata(handle->hdf_file, "Values", (const uint8 *)&val, dsize, DFNT_INT32, - dim->name->values, DIM_VALS01); - - if (ref == FAIL) { -#ifdef DEBUG - fprintf(stderr, "FAILed creating Vdata %s\n", dim->name->values); -#endif - HGOTO_FAIL(FAIL); - } + if (ref == FAIL) { + HGOTO_FAIL(FAIL); } -#ifdef DEBUG - fprintf(stderr, "Returning vdata pointer %d\n", ref); -#endif - ret_value = ref; done: @@ -785,22 +705,13 @@ hdf_create_compat_dim_vdata(XDR *xdrs, NC *handle, NC_dim *dim, int32 dimval_ver (void)xdrs; -#ifdef DEBUG - fprintf(stderr, "hdf_create_compat_dim_vdata I've been called\n"); - fprintf(stderr, "handle->hdf_file = %d\n", handle->hdf_file); - fprintf(stderr, "dim_ver = %d\n", dim_ver); -#endif - if (dimval_ver != DIMVAL_VERSION00) HGOTO_FAIL(FAIL); dsize = (dim->size == NC_UNLIMITED) ? 1 : dim->size; if (dsize < 0) HGOTO_FAIL(FAIL); - /* create a fake one */ -#ifdef DEBUG - fprintf(stderr, "Creating fake dim ::::%s::: (%d)\n", dim->name->values, dsize); -#endif + /* create a fake one */ /* allocate space */ val = malloc(dsize * sizeof(int32)); if (!val) @@ -820,16 +731,9 @@ hdf_create_compat_dim_vdata(XDR *xdrs, NC *handle, NC_dim *dim, int32 dimval_ver ref = VHstoredata(handle->hdf_file, "Values", (const uint8 *)val, dsize, DFNT_INT32, dim->name->values, DIM_VALS); if (ref == FAIL) { -#ifdef DEBUG - fprintf(stderr, "FAILed creating Vdata %s\n", dim->name->values); -#endif HGOTO_FAIL(FAIL); } -#ifdef DEBUG - fprintf(stderr, "Returning vdata pointer %d\n", ref); -#endif - ret_value = ref; done: @@ -858,44 +762,6 @@ hdf_write_attr(XDR *xdrs, NC *handle, NC_attr **attr) size = (*attr)->data->count; type = (*attr)->HDFtype; -#ifdef DEBUG - fprintf(stderr, "hdf_write_attr I've been called\n"); - fprintf(stderr, "The attribute is called %s\n", name); - fprintf(stderr, "Type = %d (%d) size %d\n", type, (*attr)->HDFtype, size); - fprintf(stderr, "Value: "); - switch (type) { - case DFNT_CHAR: - fprintf(stderr, " (char) %s\n", (char *)values); - break; - case DFNT_UINT8: - fprintf(stderr, " (uint8) %d\n", (char *)values); - break; - case DFNT_INT8: - fprintf(stderr, " (int8) %d\n", (char *)values); - break; - case DFNT_UINT16: - fprintf(stderr, " (uint16) %d\n", (int *)values); - break; - case DFNT_INT16: - fprintf(stderr, " (int16) %d\n", (int *)values); - break; - case DFNT_UINT32: - fprintf(stderr, " (uint32) %d\n", (int *)values); - break; - case DFNT_INT32: - fprintf(stderr, " (int32) %d\n", (int *)values); - break; - case DFNT_FLOAT32: - fprintf(stderr, " (float32) %f\n", (float *)values); - break; - case DFNT_FLOAT64: - fprintf(stderr, " (float64) %f\n", (double *)values); - break; - default: - fprintf(stderr, "???\n"); - } -#endif - if (type == DFNT_CHAR) { order = size; size = 1; @@ -907,10 +773,6 @@ hdf_write_attr(XDR *xdrs, NC *handle, NC_attr **attr) ret_value = VHstoredatam(handle->hdf_file, ATTR_FIELD_NAME, (unsigned char *)values, size, type, name, _HDF_ATTRIBUTE, order); -#ifdef DEBUG - fprintf(stderr, "hdf_write_attr returning %d\n", ret_value); -#endif - return ret_value; } /* hdf_write_attr */ @@ -927,11 +789,6 @@ hdf_write_dim(XDR *xdrs, NC *handle, NC_dim **dim, int32 cnt) char name[H4_MAX_NC_NAME] = ""; int32 ret_value = SUCCEED; -#ifdef DEBUG - fprintf(stderr, "hdf_write_dim I've been called\n"); - fprintf(stderr, "The name is -- %s -- \n", (*dim)->name->values); -#endif - /* * Look up to see if there is a variable of the same name * giving values @@ -1000,18 +857,6 @@ hdf_write_var(XDR *xdrs, NC *handle, NC_var **var) assoc = (*var)->assoc; attrs = (*var)->attrs; -#ifdef DEBUG - fprintf(stderr, "hdf_write_var I've been called\n"); - fprintf(stderr, "handle->hdf_file = %d\n", handle->hdf_file); - fprintf(stderr, "The name is -- %s -- \n", (*var)->name->values); - - if (assoc && assoc->count) { - fprintf(stderr, "value of assoc %d\n", assoc); - fprintf(stderr, " assoc->count %d\n", assoc->count); - fprintf(stderr, " asc[0] %d asc[1] %d\n", assoc->values[0], assoc->values[1]); - } -#endif - /* * Get the dimension information */ @@ -1081,9 +926,6 @@ hdf_write_var(XDR *xdrs, NC *handle, NC_var **var) if ((*var)->data_ref) { tags[count] = (int32)DFTAG_SD; refs[count] = (*var)->data_ref; -#ifdef DEBUG - fprintf(stderr, " ---- Carrying forward data with ref %d ---- \n", (*var)->data_ref); -#endif count++; } @@ -1180,17 +1022,6 @@ hdf_write_var(XDR *xdrs, NC *handle, NC_var **var) /* write the vgroup for the coordinate variable */ (*var)->vgid = VHmakegroup(handle->hdf_file, tags, refs, count, (*var)->name->values, _HDF_VARIABLE); -#ifdef DEBUG - if ((*var)->vgid == FAIL) { - fprintf(stderr, "Failed to write variable %s\n", (*var)->name->values); - fprintf(stderr, "count = %d\n", count); - for (i = 0; i < count; i++) - fprintf(stderr, "i = %d tag = %d ref = %d\n", i, tags[i], refs[i]); - - HEprint(stdout, 0); - } -#endif - ret_value = (*var)->vgid; /* ref of vgroup of variable */ done: @@ -1221,10 +1052,6 @@ hdf_write_xdr_cdf(XDR *xdrs, NC **handlep) Void *attrs = NULL; intn ret_value = SUCCEED; -#ifdef DEBUG - fprintf(stderr, "hdf_write_xdr_cdf i've been called op = %d \n", xdrs->x_op); -#endif - /* Convert old scales into coordinate var values before writing out any header info */ status = hdf_conv_scales(handlep); @@ -1240,17 +1067,10 @@ hdf_write_xdr_cdf(XDR *xdrs, NC **handlep) if ((*handlep)->attrs) sz += (*handlep)->attrs->count; -#ifdef DEBUG - fprintf(stderr, "sz = %d\n", sz); -#endif - /* allocate tag / ref arrays */ tags = malloc(sz * sizeof(int32) + 1); refs = malloc(sz * sizeof(int32) + 1); if (NULL == tags || NULL == refs) { -#ifdef DEBUG - fprintf(stderr, "Out of memory line %d file %s\n", __LINE__, __FILE__); -#endif HGOTO_FAIL(FAIL); } @@ -1266,9 +1086,6 @@ hdf_write_xdr_cdf(XDR *xdrs, NC **handlep) thashptr = dim_hash_array = malloc(sizeof(uint32) * (size_t)tmp->count); if (NULL == dim_size_array || NULL == dim_hash_array) { -#ifdef DEBUG - fprintf(stderr, "Out of memory line %d file %s\n", __LINE__, __FILE__); -#endif HGOTO_FAIL(FAIL); } @@ -1344,25 +1161,12 @@ hdf_write_xdr_cdf(XDR *xdrs, NC **handlep) } } -#ifdef DEBUG - fprintf(stderr, "About to write top level VG with %d elements\n", count); - { - int i; - for (i = 0; i < count; i++) - fprintf(stderr, "%d :=> %d %d\n", i, tags[i], refs[i]); - } -#endif - /* write out final VGroup thang */ /* set the top level CDF VGroup pointer */ (*handlep)->vgid = VHmakegroup((*handlep)->hdf_file, tags, refs, count, (*handlep)->path, _HDF_CDF); ret_value = (*handlep)->vgid; /* ref of final vgroup */ -#ifdef DEBUG - fprintf(stderr, "======= Have finished writing top level VGroup #%d\n", ret_value); -#endif - done: free(dim_size_array); free(dim_hash_array); @@ -1462,10 +1266,6 @@ hdf_read_dims(XDR *xdrs, NC *handle, int32 vg) count = 0; id = -1; -#ifdef DEBUG - fprintf(stderr, "hdf_read_dims I've been called, handle->hdf_file = %d\n", handle->hdf_file); -#endif - /* * Allocate enough space in case everything is a dimension */ @@ -1473,9 +1273,6 @@ hdf_read_dims(XDR *xdrs, NC *handle, int32 vg) dimension = malloc(sizeof(NC_dim *) * Vntagrefs(vg) + 1); if (NULL == dimension) { /* replace it with NCadvice or HERROR?? */ -#ifdef DEBUG - fprintf(stderr, "Out of memory line %d file %s\n", __LINE__, __FILE__); -#endif HGOTO_FAIL(FAIL); } @@ -1578,15 +1375,8 @@ hdf_read_dims(XDR *xdrs, NC *handle, int32 vg) if (!found) { dimension[count] = NC_new_dim(vgname, dim_size); if (NULL == dimension[count]) { -#ifdef DEBUG - /* replace it with NCadvice or HERROR?? */ - fprintf(stderr, "Can't create new dimension #%d\n", count); -#endif HGOTO_FAIL(FAIL); - } /* dimension[count] */ -#ifdef DEBUG - fprintf(stderr, "Dimension <%s> has size %d\n", vgname, dim_size); -#endif + } /* dimension[count] */ if (!strcmp(vsclass, DIM_VALS01)) /* dimvals01 only */ dimension[count]->dim00_compat = 0; @@ -1613,10 +1403,6 @@ hdf_read_dims(XDR *xdrs, NC *handle, int32 vg) else handle->dims = NULL; -#ifdef DEBUG - fprintf(stderr, "Created dimension array %d \n", handle->dims); -#endif - done: if (ret_value == FAIL) { /* Failure cleanup */ if (handle->dims != NULL) { @@ -1652,22 +1438,11 @@ hdf_num_attrs(NC *handle, /* IN: handle to SDS */ char class[H4_MAX_NC_CLASS] = ""; intn ret_value = FAIL; -#ifdef HDF_NUM_ATTRS - fprintf(stderr, "hdf_num_attrs: I've been called, handle->hdf_file = %d\n", handle->hdf_file); -#endif - n = Vntagrefs(vg); if (n == FAIL) { -#ifdef HDF_NUM_ATTRS - fprintf(stderr, "hdf_read_attrs: Vntagrefs failed \n"); -#endif HGOTO_FAIL(FAIL); } -#ifdef HDF_NUM_ATTRS - fprintf(stderr, "hdf_num_attrs: Vntagrefs returned =%d \n", n); -#endif - /* * look through for a Vdata of class _HDF_ATTRIBUTE */ @@ -1691,10 +1466,6 @@ hdf_num_attrs(NC *handle, /* IN: handle to SDS */ } } -#ifdef HDF_NUM_ATTRS - fprintf(stderr, "hdf_num_attrs: number of attributes is %d \n", count); -#endif - ret_value = count; done: @@ -1725,22 +1496,11 @@ hdf_read_attrs(XDR *xdrs, NC *handle, int32 vg) count = 0; id = -1; -#ifdef DEBUG - fprintf(stderr, "hdf_read_attrs I've been called, handle->hdf_file = %d\n", handle->hdf_file); -#endif - n = Vntagrefs(vg); if (n == FAIL) { -#ifdef HDF_READ_ATTRS - fprintf(stderr, "hdf_read_attrs: Vntagrefs failed \n"); -#endif HGOTO_FAIL(NULL); } -#ifdef HDF_READ_ATTRS - fprintf(stderr, "hdf_read_attrs: Vntagrefs returned =%d \n", n); -#endif - /* * Allocate enough space in case everything is an attribute */ @@ -1748,9 +1508,6 @@ hdf_read_attrs(XDR *xdrs, NC *handle, int32 vg) attributes = malloc(sizeof(NC_attr *) * n + 1); if (NULL == attributes) { /* replace it with NCAdvice or HERROR? */ -#ifdef HDF_READ_ATTRS - fprintf(stderr, "Out of memory line %d file %s\n", __LINE__, __FILE__); -#endif HGOTO_FAIL(NULL); } @@ -1799,17 +1556,10 @@ hdf_read_attrs(XDR *xdrs, NC *handle, int32 vg) attributes[count] = (NC_attr *)NC_new_attr(vsname, type, attr_size, values); if (NULL == attributes[count]) { /* replace it with NCadvice or HERROR? */ -#ifdef HDF_READ_ATTRS - fprintf(stderr, "hdf_read_attrs: Can't create new attribute #%d\n", count); -#endif HGOTO_FAIL(NULL); } attributes[count]->HDFtype = nt; -#ifdef HDF_READ_ATTRS - fprintf(stderr, "hdf_read_attrs: Attribute <%s> has type %d and size %d\n", vsname, type, - attr_size); -#endif /* free values and reset to NULL */ free(values); values = NULL; @@ -1825,10 +1575,6 @@ hdf_read_attrs(XDR *xdrs, NC *handle, int32 vg) if (count) Array = NC_new_array(NC_ATTRIBUTE, count, (Void *)attributes); -#ifdef HDF_READ_ATTRS - fprintf(stderr, "hdf_read_attrs: Created attribute array %d \n", Array); -#endif - ret_value = Array; /* return array of attributes */ done: @@ -1882,19 +1628,12 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) count = 0; id = -1; -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars: I've been called, handle->hdf_file = %d\n", handle->hdf_file); -#endif - /* * Allocate enough space in case everything is a variable */ count = 0; variables = malloc(sizeof(NC_var *) * Vntagrefs(vg) + 1); if (NULL == variables) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Out of memory line %d file %s\n", __LINE__, __FILE__); -#endif HGOTO_FAIL(FAIL); } @@ -1903,9 +1642,6 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) */ dims = malloc(sizeof(int) * Vntagrefs(vg) + 1); if (NULL == dims) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Out of memory line %d file %s\n", __LINE__, __FILE__); -#endif HGOTO_FAIL(FAIL); } @@ -1917,9 +1653,6 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) for (i = 0; i < vg_size; i++) { if (Vgettagref(vg, i, &tag, &id) == FAIL) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Vgettagref failed\n"); -#endif HGOTO_FAIL(FAIL); } @@ -1929,9 +1662,6 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) continue; /* isn't this bad? -GV */ if (Vgetclass(var, class) == FAIL) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Vgetclass failed\n"); -#endif HGOTO_FAIL(FAIL); } @@ -1951,9 +1681,6 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) is_rec_var = FALSE; if (Vinquire(var, &n, vgname) == FAIL) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Vinquire failed\n"); -#endif HGOTO_FAIL(FAIL); } @@ -1964,9 +1691,6 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) char dimclass[H4_MAX_NC_CLASS] = ""; char vsclass[H4_MAX_NC_CLASS] = ""; if (Vgettagref(var, t, &tag, &sub_id) == FAIL) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Vgettagref failed\n"); -#endif HGOTO_FAIL(FAIL); } @@ -1974,16 +1698,10 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) case DFTAG_VG: /* ------ V G R O U P ---------- */ sub = Vattach(handle->hdf_file, sub_id, "r"); if (FAIL == sub) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Vattach failed\n"); -#endif HGOTO_FAIL(FAIL); } if (FAIL == Vgetclass(sub, dimclass)) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Vgetclass failed\n"); -#endif HGOTO_FAIL(FAIL); } @@ -1993,27 +1711,18 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) is_rec_var = TRUE; if (FAIL == Vinquire(sub, &entries, subname)) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Vinquire failed\n"); -#endif HGOTO_FAIL(FAIL); } dims[ndims] = (int)NC_dimid(handle, subname); if (-1 == dims[ndims]) /* should change to FAIL */ { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:NC_dimid failed\n"); -#endif HGOTO_FAIL(FAIL); } ndims++; } if (FAIL == Vdetach(sub)) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Vdetach failed\n"); -#endif HGOTO_FAIL(FAIL); } @@ -2046,30 +1755,18 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) the data does not exist yet in the file? So we can't catch this error -GV*/ data_count = Hlength(handle->hdf_file, DATA_TAG, sub_id); -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Hlength returned %d\n", data_count); -#endif break; case DFTAG_SDRAG: /* ----- Ragged Array index ----- */ rag_ref = sub_id; -#ifdef HDF_READ_VARS - printf("hdf_read_vars:Lookout! Found a ragged array element\n"); -#endif break; case DFTAG_NT: /* ------- Number type ------- */ if (Hgetelement(handle->hdf_file, tag, sub_id, ntstring) == FAIL) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Hgetlement failed\n"); -#endif HGOTO_FAIL(FAIL); } HDFtype = ntstring[1]; if ((type = hdf_unmap_type(HDFtype)) == FAIL) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:hdf_unmap_teyp failed\n"); -#endif HGOTO_FAIL(FAIL); } @@ -2091,9 +1788,6 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) * for a different machine. PUNT */ goto bad_number_type; /* GOTO */ -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars: BAD number type \n"); -#endif } else { /* @@ -2120,24 +1814,15 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) vp = variables[count]; if (NULL == vp) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Can't read new variable %s\n", vgname); -#endif HGOTO_FAIL(FAIL); } -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:Created a variable called %s (id %d) \n", vgname, id); -#endif /* Read in the attributes if any */ if ((nattrs = hdf_num_attrs(handle, var)) > 0) vp->attrs = hdf_read_attrs(xdrs, handle, var); else vp->attrs = NULL; -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:read in %d attributes \n", nattrs); -#endif /* set up for easy access later */ vp->vgid = id; vp->data_ref = data_ref; @@ -2168,9 +1853,6 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) */ if (NC_var_shape(vp, handle->dims) == -1) { -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:NC_var_shape failed \n"); -#endif HGOTO_FAIL(FAIL); } @@ -2182,9 +1864,6 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) */ vp->numrecs = data_count / vp->dsizes[0]; -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars:I have set numrecs to %d\n", vp->numrecs); -#endif /* * Deallocate the shape info as it will be recomputed * at a higher level later @@ -2221,16 +1900,8 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) else handle->vars = NULL; -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars: Created variable array %d \n", handle->vars); -#endif - done: if (ret_value == FAIL) { /* Failure cleanup */ -#ifdef HDF_READ_VARS - fprintf(stderr, "hdf_read_vars: failed to created variable array \n"); -#endif - if (handle->vars != NULL) NC_free_array(handle->vars); } @@ -2247,19 +1918,11 @@ hdf_read_vars(XDR *xdrs, NC *handle, int32 vg) intn hdf_read_xdr_cdf(XDR *xdrs, NC **handlep) { -#ifdef DEBUG - char vgname[H4_MAX_NC_NAME]; - int32 entries; -#endif int32 cdf_vg = FAIL; int vgid = 0; int status; intn ret_value = SUCCEED; -#ifdef DEBUG - fprintf(stderr, "hdf_read_xdr_cdf i've been called %d\n", (*handlep)->hdf_file); -#endif - if ((vgid = Vfindclass((*handlep)->hdf_file, _HDF_CDF)) != FAIL) { cdf_vg = Vattach((*handlep)->hdf_file, vgid, "r"); if (cdf_vg == FAIL) @@ -2270,11 +1933,6 @@ hdf_read_xdr_cdf(XDR *xdrs, NC **handlep) (*handlep)->vgid = vgid; /* ref of vgroup */ -#ifdef DEBUG - Vinquire(cdf_vg, &entries, vgname); - fprintf(stderr, "Found _HDF_CDF : %s (%d entries)\n", vgname, entries); -#endif - /* read in dimensions */ status = hdf_read_dims(xdrs, (*handlep), cdf_vg); if (status == FAIL) @@ -2318,10 +1976,6 @@ hdf_xdr_cdf(XDR *xdrs, NC **handlep) intn status; intn ret_value = SUCCEED; -#ifdef HDF_XDR_CDF - fprintf(stderr, "hdf_xdr_cdf: i've been called op = %d \n", xdrs->x_op); -#endif - switch (xdrs->x_op) { case XDR_ENCODE: if ((*handlep)->vgid) { @@ -2330,23 +1984,13 @@ hdf_xdr_cdf(XDR *xdrs, NC **handlep) } status = hdf_write_xdr_cdf(xdrs, handlep); if (FAIL == status) { -#ifdef HDF_XDR_CDF - fprintf(stderr, "hdf_xdr_cdf: hdf_write_xdr_cdf failed \n"); -#endif HGOTO_FAIL(FAIL); } break; case XDR_DECODE: if (FAIL == (status = hdf_read_xdr_cdf(xdrs, handlep))) { -#ifdef HDF_XDR_CDF - fprintf(stderr, "hdf_xdr_cdf: hdf_read_xdr_cdf failed \n"); - fprintf(stderr, " going to hdf_read_sds \n"); -#endif status = hdf_read_sds_cdf(xdrs, handlep); if (FAIL == status) { -#ifdef HDF_XDR_CDF - fprintf(stderr, "hdf_xdr_cdf: hdf_read_sds failed \n"); -#endif HGOTO_ERROR(DFE_BADNDG, FAIL); } } /* end if */ @@ -2379,58 +2023,34 @@ hdf_vg_clobber(NC *handle, int id) int32 status; intn ret_value = SUCCEED; -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: has been called for vgroup ref=%d\n", id); -#endif - /* loop through and Clobber all top level VGroups */ /* attach to top level vgroup with read access */ vg = Vattach(handle->hdf_file, id, "r"); if (FAIL == vg) { -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: Vattach failed for vgroup ref =%d\n", id); - HEprint(stderr, 0); -#endif HGOTO_FAIL(FAIL); } /* get number of members in vgroup */ n = Vntagrefs(vg); if (FAIL == n) { -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: Vntagrefs failed \n"); -#endif HGOTO_FAIL(FAIL); } /* Loop though and kill stuff */ for (t = 0; t < n; t++) { /* get tag/ref of element in vgroup */ if (FAIL == Vgettagref(vg, t, &tag, &ref)) { -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: Vgettagref failed \n"); -#endif HGOTO_FAIL(FAIL); } -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: Looking at <%d, %d> in vgroup\n", tag, ref); -#endif /* switch on the type of element: vgroup, vdata, data, everything else */ switch (tag) { case DFTAG_VG: /* recursive call */ -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: found a vgroup ref %d in vgroup %d\n", ref, id); -#endif /* check if vgroup exists in file before trying to delete it's members */ if (vexistvg(handle->hdf_file, ref) != FAIL) { if (FAIL == hdf_vg_clobber(handle, ref)) { -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: hdf_vg_clobber failed member whose vgroup ref=%d\n", - ref); -#endif HGOTO_FAIL(FAIL); } } @@ -2440,15 +2060,9 @@ hdf_vg_clobber(NC *handle, int id) if (vexistvs(handle->hdf_file, ref) != FAIL) { status = VSdelete(handle->hdf_file, (int32)ref); if (FAIL == status) { -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: VSdelete failed for vdata ref=%d\n", ref); -#endif HGOTO_FAIL(FAIL); } } -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: VSdelete deleted vdata ref=%d\n", ref); -#endif break; case DFTAG_SD: /* @@ -2458,32 +2072,16 @@ hdf_vg_clobber(NC *handle, int id) break; default: /* delete other objects given tag/ref in file */ if (FAIL == Hdeldd(handle->hdf_file, (uint16)tag, (uint16)ref)) { -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: Hdeldd failed \n"); -#endif HGOTO_FAIL(FAIL); } -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: Hdeldd deleted tag/ref=%d/%d\n", tag, ref); -#endif break; } } ret_value = Vdetach(vg); -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: Vdetach, ret_value=%d \n", ret_value); -#endif - done: - if (ret_value == FAIL) { /* Failure cleanup */ -#ifdef HDF_VG_CLOBBER - fprintf(stderr, "hdf_vg_clobber: failed \n"); -#endif - } - return ret_value; } /* hdf_vg_clobber */ @@ -2505,49 +2103,29 @@ hdf_cdf_clobber(NC *handle) /* Close open VData pointers */ if (FAIL == hdf_close(handle)) { -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: hdf_close failed \n"); -#endif HGOTO_FAIL(FAIL); } -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: closed all open vdata handles \n"); -#endif - /* loop through and Clobber all top level VGroups */ vg = Vattach(handle->hdf_file, handle->vgid, "r"); if (vg == FAIL) { -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: Vattach failed for vgroup ref=%d\n", handle->vgid); -#endif HGOTO_FAIL(FAIL); } /* get number of members of Vgroup */ n = Vntagrefs(vg); if (FAIL == n) { -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: Vntagrefs failed \n"); -#endif HGOTO_FAIL(FAIL); } /* Loop though and just kill everyone */ for (t = 0; t < n; t++) { if (FAIL == Vgettagref(vg, t, &tag, &ref)) { -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: Vgettagref failed for vgroup %d\n", handle->vgid); -#endif HGOTO_FAIL(FAIL); } /* if this member is a vgroup destroy everything in it */ if (tag == DFTAG_VG) { -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: member of vgroup is a vgroup,"); - fprintf(stderr, "deleting everything in vgroup %d \n", ref); -#endif /* check if vgroup exists in file */ if (vexistvg(handle->hdf_file, ref) != FAIL) { hdf_vg_clobber(handle, ref); @@ -2558,73 +2136,39 @@ hdf_cdf_clobber(NC *handle) case DFTAG_VG: status = Vdelete(handle->hdf_file, (int32)ref); if (FAIL == status) { -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: Vdelete failed for vgroup %d\n", ref); -#endif HGOTO_FAIL(FAIL); } -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: Vdelete deleted vgroup %d\n", ref); -#endif break; case DFTAG_VH: status = VSdelete(handle->hdf_file, (int32)ref); if (FAIL == status) { -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: VSdelete failed for vdata %d\n", ref); -#endif HGOTO_FAIL(FAIL); } -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: VSdelete deleted vdata %d\n", ref); -#endif break; default: status = Hdeldd(handle->hdf_file, (uint16)tag, (uint16)ref); if (FAIL == status) { -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: Hdeldd failed for tag/ref %d/%d\n", tag, ref); -#endif HGOTO_FAIL(FAIL); } -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: Hdeldd deleted tag/ref %d/%d\n", tag, ref); -#endif break; } /* end switch tag */ } /* end for every member in vgroup */ if (FAIL == Vdetach(vg)) { -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: Vdetach failed for vgroup %d\n", handle->vgid); -#endif HGOTO_FAIL(FAIL); } status = Vdelete(handle->hdf_file, (int32)handle->vgid); if (FAIL == status) { -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: Vdelete failed for vgroup %d\n", handle->vgid); -#endif HGOTO_FAIL(FAIL); } -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber:Clobbering VGroup %d\n\n", handle->vgid); -#endif - handle->vgid = 0; /* reset ref of SDS vgroup to invalid ref */ done: - if (ret_value == FAIL) { /* Error condition cleanup */ -#ifdef HDF_CDF_CLOBBER - fprintf(stderr, "hdf_cdf_clobber: Failed to Clobber VGroup %d\n\n", handle->vgid); -#endif - } - return ret_value; } /* hdf_cdf_clobber */ @@ -2654,10 +2198,6 @@ hdf_close(NC *handle) char class[H4_MAX_NC_CLASS] = ""; intn ret_value = SUCCEED; -#ifdef HDF_CLOSE - fprintf(stderr, "hdf_close: I've been called\n"); -#endif - /* loop through and detach from variable data VDatas */ if (handle->vars) { tmp = handle->vars; @@ -2668,9 +2208,6 @@ hdf_close(NC *handle) if ((*vp)->aid != FAIL) { if (FAIL == Hendaccess((*vp)->aid)) { -#ifdef HDF_CLOSE - fprintf(stderr, "hdf_close: Hendaccess failed for vdata aid %d\n", (*vp)->aid); -#endif HGOTO_FAIL(FAIL); } } @@ -2686,9 +2223,6 @@ hdf_close(NC *handle) id = -1; vg = Vattach(handle->hdf_file, handle->vgid, "r"); if (FAIL == vg) { -#ifdef HDF_CLOSE - fprintf(stderr, "hdf_close: Vattach failed for vgroup ref %d\n", handle->vgid); -#endif HGOTO_FAIL(FAIL); } @@ -2697,16 +2231,10 @@ hdf_close(NC *handle) if (Visvg(vg, id)) { dim = Vattach(handle->hdf_file, id, "r"); if (FAIL == dim) { -#ifdef HDF_CLOSE - fprintf(stderr, "hdf_close: Vattach failed for vgroup ref %d\n", id); -#endif HGOTO_FAIL(FAIL); } if (FAIL == Vgetclass(dim, class)) { -#ifdef HDF_CLOSE - fprintf(stderr, "hdf_close: Vgetclass failed for vgroup ref %d\n", id); -#endif HGOTO_FAIL(FAIL); } @@ -2718,17 +2246,11 @@ hdf_close(NC *handle) if (Visvs(dim, sub_id)) { /* yes, attach to vdata */ vs = VSattach(handle->hdf_file, sub_id, "w"); if (vs == FAIL) { -#ifdef HDF_CLOSE - fprintf(stderr, "hdf_close: VSattach failed for vdata ref %d\n", sub_id); -#endif HGOTO_FAIL(FAIL); /* HEprint(stdout, 0); */ } /* get class of vdata */ if (FAIL == VSgetclass(vs, class)) { -#ifdef HDF_CLOSE - fprintf(stderr, "hdf_close: VSgetclass failed for vdata ref %d\n", sub_id); -#endif HGOTO_FAIL(FAIL); } @@ -2737,34 +2259,21 @@ hdf_close(NC *handle) int32 val = handle->numrecs; if (FAIL == VSsetfields(vs, "Values")) { -#ifdef HDF_CLOSE - fprintf(stderr, "hdf_close: VSsetfields failed for vdata ref %d\n", - sub_id); -#endif HGOTO_FAIL(FAIL); } if (FAIL == VSseek(vs, 0)) { -#ifdef HDF_CLOSE - fprintf(stderr, "hdf_close: VSseek failed for vdata ref %d\n", sub_id); -#endif HGOTO_FAIL(FAIL); } /* write out dimension vdatas? */ if (VSwrite(vs, (uint8 *)&val, 1, FULL_INTERLACE) != 1) { -#ifdef HDF_CLOSE - fprintf(stderr, "hdf_close: VSwrite failed for vdata ref %d\n", sub_id); -#endif HGOTO_FAIL(FAIL); } } /* detach from vdata */ if (FAIL == VSdetach(vs)) { -#ifdef HDF_CLOSE - fprintf(stderr, "hdf_close: VSdetach failed for vdata ref %d\n", sub_id); -#endif HGOTO_FAIL(FAIL); } @@ -2781,9 +2290,6 @@ hdf_close(NC *handle) } /* end if looking through toplevel vgroup hierarchy */ if (FAIL == Vdetach(vg)) { -#ifdef HDF_CLOSE - fprintf(stderr, "hdf_close: Vdetach failed for vgroup ref %d\n", handle->vgid); -#endif HGOTO_FAIL(FAIL); } @@ -2794,7 +2300,6 @@ hdf_close(NC *handle) } /* hdf_close */ /*******************************************************************************/ -#endif /* HDF */ /* * How much space will the xdr'd NC description take. @@ -2820,10 +2325,8 @@ bool_t xdr_numrecs(XDR *xdrs, NC *handle) { -#ifdef HDF if (handle->file_type == HDF_FILE) return TRUE; /* hmm...why? */ -#endif if ((handle->flags & NC_NOFILL) && xdrs->x_op == XDR_ENCODE && handle->begin_rec > 0) { /* @@ -2835,10 +2338,6 @@ xdr_numrecs(XDR *xdrs, NC *handle) nc_serror("Can't set position to EOF"); return (FALSE); } -#ifdef RDEBUG - fprintf(stderr, "\txdr_numrecs %ld = %d + %ld * %d\n", xdr_getpos(xdrs), handle->begin_rec, - handle->numrecs, handle->recsize); -#endif /* RDEBUG */ if (!xdr_u_long(xdrs, &(handle->numrecs))) return (FALSE); } diff --git a/mfhdf/libsrc/dim.c b/mfhdf/libsrc/dim.c index 276e51725d..df73543142 100644 --- a/mfhdf/libsrc/dim.c +++ b/mfhdf/libsrc/dim.c @@ -30,13 +30,11 @@ NC_new_dim(const char *name, long size) if (ret->name == NULL) goto alloc_err; - ret->size = size; -#ifdef HDF + ret->size = size; ret->vgid = 0; /* no vgroup representing this dimension yet -BMR 2010/12/29 */ ret->count = 1; /* ret->dim00_compat = (size == NC_UNLIMITED)? 0 : 1; */ ret->dim00_compat = 0; -#endif /* HDF */ return (ret); alloc_err: nc_serror("NC_new_dim"); @@ -55,13 +53,11 @@ NC_free_dim(NC_dim *dim) int ret_value = SUCCEED; if (dim != NULL) { -#ifdef HDF if (dim->count > 1) { dim->count -= 1; ret_value = SUCCEED; goto done; } -#endif /* HDF */ if (NC_free_string(dim->name) == FAIL) { ret_value = FAIL; @@ -198,11 +194,7 @@ ncdiminq(int cdfid, int dimid, char *name, long *sizep) dp += dimid; if (name != NULL) { -#ifdef HDF (void)memcpy(name, (*dp)->name->values, (size_t)(*dp)->name->len); -#else - (void)strncpy(name, (*dp)->name->values, (size_t)(*dp)->name->len); -#endif name[(*dp)->name->len] = 0; } if (sizep != 0) { @@ -287,11 +279,9 @@ xdr_NC_dim(XDR *xdrs, NC_dim **dpp) } } -#ifdef HDF /* hmm...what does this do? */ if (xdrs->x_op == XDR_DECODE) (*dpp)->count = 0; -#endif if (!xdr_NC_string(xdrs, &((*dpp)->name))) return (FALSE); diff --git a/mfhdf/libsrc/file.c b/mfhdf/libsrc/file.c index d5b7707cc5..e8d681e60b 100644 --- a/mfhdf/libsrc/file.c +++ b/mfhdf/libsrc/file.c @@ -20,10 +20,6 @@ #include "local_nc.h" #include "herr.h" -#ifdef DEBUG -#include -#endif /* DEBUG */ - #ifdef H4_HAVE_UNISTD_H #include /* getpid(), access(), F_OK */ #endif @@ -354,9 +350,7 @@ ncsync(int cdfid) else if (handle->flags & NC_NDIRTY) { if (!xdr_numrecs(handle->xdrs, handle)) return (-1); -#ifdef HDF if (handle->file_type != HDF_FILE) -#endif handle->flags &= ~(NC_NDIRTY); } } @@ -394,9 +388,7 @@ ncabort(int cdfid) NC *handle; char path[FILENAME_MAX + 1]; unsigned flags; -#ifdef HDF - intn file_type; -#endif + intn file_type; cdf_routine_name = "ncabort"; @@ -436,12 +428,9 @@ ncabort(int cdfid) } } -#ifdef HDF file_type = handle->file_type; -#endif NC_free_cdf(handle); /* calls fclose */ -#ifdef HDF switch (file_type) { case netCDF_FILE: if (flags & (NC_INDEF | NC_CREAT)) { @@ -456,12 +445,6 @@ ncabort(int cdfid) } break; } -#else - if (flags & (NC_INDEF | NC_CREAT)) { - if (remove(path) != 0) - nc_serror("couldn't remove filename \"%s\"", path); - } -#endif _cdfs[cdfid] = NULL; /* reset pointer */ @@ -587,13 +570,11 @@ ncredef(int cdfid) return (-1); } -#ifdef HDF if (handle->file_type == HDF_FILE) { handle->flags |= NC_INDEF; handle->redefid = TRUE; return (0); } -#endif /* find first available id */ for (id = 0; id < _ncdf; id++) @@ -665,9 +646,6 @@ NC_begins(NC *handle) (*vpp)->begin = index; index += (*vpp)->len; -#ifdef EDEBUG - NCadvise(NC_NOERR, "%s pass 1 begin %d, length %d", (*vpp)->name->values, (*vpp)->begin, (*vpp)->len); -#endif /* EDEBUG */ } handle->begin_rec = index; @@ -681,10 +659,6 @@ NC_begins(NC *handle) } (*vpp)->begin = index; -#ifdef EDEBUG - NCadvise(NC_NOERR, "%s pass 2 begin %d, len %d, *dsizes %d", (*vpp)->name->values, (*vpp)->begin, - index, (*vpp)->len, *(*vpp)->dsizes); -#endif /* EDEBUG */ index += (*vpp)->len; handle->recsize += (*vpp)->len; last = (*vpp); @@ -778,9 +752,7 @@ NC_endef(int cdfid, NC *handle) NC_var **vpp; NC *stash = STASH(cdfid); /* faster rvalue */ -#ifdef HDF if (handle->file_type != HDF_FILE) -#endif NC_begins(handle); xdrs = handle->xdrs; @@ -791,7 +763,6 @@ NC_endef(int cdfid, NC *handle) return (-1); } -#ifdef HDF /* Get rid of the temporary buffer allocated for I/O */ SDPfreebuf(); @@ -799,7 +770,6 @@ NC_endef(int cdfid, NC *handle) handle->flags &= ~(NC_CREAT | NC_INDEF | NC_NDIRTY | NC_HDIRTY); return (0); } -#endif if (handle->vars == NULL) goto done; @@ -811,10 +781,6 @@ NC_endef(int cdfid, NC *handle) continue; /* skip record variables on this pass */ } -#ifdef DEBUG - assert((*vpp)->begin == xdr_getpos(xdrs)); -#endif /* DEBUG */ - if (!(handle->flags & NC_CREAT) && stash->vars != NULL && ii < stash->vars->count) { /* copy data */ if (!NC_vcpy(xdrs, stash, ii)) @@ -851,11 +817,6 @@ NC_endef(int cdfid, NC *handle) return (-1); } -#ifdef EDEBUG - NCadvise(NC_NOERR, "begin %d, recsize %d, numrecs %d", handle->begin_rec, handle->recsize, - handle->numrecs); -#endif /* EDEBUG */ - if (!(handle->flags & NC_CREAT)) /* redefine */ { char realpath[FILENAME_MAX + 1]; @@ -952,10 +913,8 @@ ncclose(int cdfid) } } -#ifdef HDF if (handle->file_type == HDF_FILE) hdf_close(handle); -#endif NC_free_cdf(handle); /* calls fclose */ @@ -999,12 +958,11 @@ ncsetfill(int id, int fillmode) * We are changing back to fill mode * so do a sync */ -#ifdef HDF /* save the original x_op */ + /* save the original x_op */ enum xdr_op xdr_op = handle->xdrs->x_op; if (handle->flags & NC_RDWR) /* make sure we can write */ handle->xdrs->x_op = XDR_ENCODE; /* to the file */ -#endif if (handle->flags & NC_HDIRTY) { if (!xdr_cdf(handle->xdrs, &handle)) return (-1); @@ -1013,17 +971,12 @@ ncsetfill(int id, int fillmode) else if (handle->flags & NC_NDIRTY) { if (!xdr_numrecs(handle->xdrs, handle)) return (-1); -#ifdef HDF if (handle->file_type != HDF_FILE) handle->flags &= ~(NC_NDIRTY); -#else - handle->flags &= ~(NC_NDIRTY); -#endif } handle->flags &= ~NC_NOFILL; -#ifdef HDF /* re-store the x_op */ + /* re-store the x_op */ handle->xdrs->x_op = xdr_op; -#endif } } else { diff --git a/mfhdf/libsrc/hdfsds.c b/mfhdf/libsrc/hdfsds.c index 055fddc883..3f17bd6784 100644 --- a/mfhdf/libsrc/hdfsds.c +++ b/mfhdf/libsrc/hdfsds.c @@ -72,7 +72,6 @@ **************************************************************************/ -#ifdef HDF #include "local_nc.h" #define SDG_MAX_INITIAL 100 @@ -1011,9 +1010,6 @@ hdf_read_ndgs(NC *handle) } /* OK, now we need to get the relevant dimension structure */ -#ifdef DEBUG - printf("Found NDG at %d %d\n", ndgTag, ndgRef); -#endif /* read the group into memory */ if ((GroupID = DFdiread(handle->hdf_file, ndgTag, ndgRef)) < 0) { @@ -1641,5 +1637,3 @@ hdf_read_sds_cdf(XDR *xdrs, NC **handlep) done: return ret_value; } /* hdf_read_sds_cdf */ - -#endif /* HDF */ diff --git a/mfhdf/libsrc/local_nc.h b/mfhdf/libsrc/local_nc.h index 94004b8f97..5fd33675e2 100644 --- a/mfhdf/libsrc/local_nc.h +++ b/mfhdf/libsrc/local_nc.h @@ -78,9 +78,8 @@ typedef unsigned long u_long; #define Void char /* -** Include HDF stuff -*/ -#ifdef HDF + * Include HDF stuff + */ #include "hdf.h" #include "vg.h" @@ -99,14 +98,11 @@ typedef unsigned long u_long; #define MAX_BLOCK_SIZE 65536 /* maximum size of block in linked blocks */ #define BLOCK_COUNT 128 /* size of linked block pointer objects */ -#endif /* HDF */ - /* from cdflib.h CDF 2.3 */ #ifndef MAX_VXR_ENTRIES #define MAX_VXR_ENTRIES 10 #endif /* MAX_VXR_ENTRIES */ -#ifdef HDF /* VIX record for CDF variable data storage */ typedef struct vix_t_def { int32 nEntries; /* number of entries in this vix */ @@ -116,7 +112,6 @@ typedef struct vix_t_def { int32 offset[MAX_VXR_ENTRIES]; /* file offset of records */ struct vix_t_def *next; /* next one in line */ } vix_t; -#endif /* HDF */ /* like, a discriminated union in the sense of xdr */ typedef struct { @@ -136,17 +131,13 @@ typedef struct { count != len when a string is resized to something smaller */ -#ifdef HDF #define NC_compare_string(s1, s2) ((s1)->hash != (s2)->hash ? 1 : strcmp((s1)->values, (s2)->values)) -#endif /* HDF */ typedef struct { unsigned count; unsigned len; -#ifdef HDF - uint32 hash; /* [non-perfect] hash value for faster comparisons */ -#endif /* HDF */ - char *values; + uint32 hash; /* [non-perfect] hash value for faster comparisons */ + char *values; } NC_string; /* Counted array of ints for assoc list */ @@ -159,21 +150,17 @@ typedef struct { typedef struct { NC_string *name; long size; -#ifdef HDF - int32 dim00_compat; /* compatible with Dim0.0 */ - int32 vgid; /* id of the Vgroup representing this dimension */ - int32 count; /* Number of pointers to this dimension */ -#endif + int32 dim00_compat; /* compatible with Dim0.0 */ + int32 vgid; /* id of the Vgroup representing this dimension */ + int32 count; /* Number of pointers to this dimension */ } NC_dim; /* NC attribute */ typedef struct { NC_string *name; NC_array *data; -#ifdef HDF - int32 HDFtype; /* it should be in NC_array *data. However, */ - /* NC.dims and NC.vars are NC_array too. */ -#endif + int32 HDFtype; /* it should be in NC_array *data. However, */ + /* NC.dims and NC.vars are NC_array too. */ } NC_attr; typedef struct { @@ -188,29 +175,26 @@ typedef struct { NC_array *dims; NC_array *attrs; NC_array *vars; -#ifdef HDF - int32 hdf_file; - int file_type; - int32 vgid; - int hdf_mode; /* mode we are attached for */ - hdf_file_t cdf_fp; /* file pointer used for CDF files */ -#endif + int32 hdf_file; + int file_type; + int32 vgid; + int hdf_mode; /* mode we are attached for */ + hdf_file_t cdf_fp; /* file pointer used for CDF files */ } NC; /* NC variable: description and data */ typedef struct { - NC_string *name; /* name->values shows data set's name */ - NC_iarray *assoc; /* user definition */ - unsigned long *shape; /* compiled info (Each holds a dimension size. -BMR) */ - unsigned long *dsizes; /* compiled info (Each element holds the amount of space - needed to hold values in that dimension, e.g., first dimension - size is 10, value type is int32=4, then dsizes[0]=4*10=40. -BMR) */ - NC_array *attrs; /* list of attribute structures */ - nc_type type; /* the discriminant */ - unsigned long len; /* the total length originally allocated */ - size_t szof; /* sizeof each value */ - long begin; /* seek index, often an off_t */ -#ifdef HDF + NC_string *name; /* name->values shows data set's name */ + NC_iarray *assoc; /* user definition */ + unsigned long *shape; /* compiled info (Each holds a dimension size. -BMR) */ + unsigned long *dsizes; /* compiled info (Each element holds the amount of space + needed to hold values in that dimension, e.g., first dimension + size is 10, value type is int32=4, then dsizes[0]=4*10=40. -BMR) */ + NC_array *attrs; /* list of attribute structures */ + nc_type type; /* the discriminant */ + unsigned long len; /* the total length originally allocated */ + size_t szof; /* sizeof each value */ + long begin; /* seek index, often an off_t */ NC *cdf; /* handle of the file where this var belongs to */ int32 vgid; /* id of the variable's Vgroup */ uint16 data_ref; /* ref of the variable's data storage (if exists), default 0 */ @@ -240,7 +224,6 @@ typedef struct { int32 *rag_list; /* size of ragged array lines */ int32 rag_fill; /* last line in rag_list to be set */ vix_t *vixHead; /* list of VXR records for CDF data storage */ -#endif } NC_var; #define IS_RECVAR(vp) ((vp)->shape != NULL ? (*(vp)->shape == NC_UNLIMITED) : 0) @@ -502,7 +485,6 @@ HDFLIBAPI int NCxdrfile_sync(XDR *xdrs); HDFLIBAPI int NCxdrfile_create(XDR *xdrs, const char *path, int ncmode); -#ifdef HDF /* this routine is found in 'xdrposix.c' */ HDFLIBAPI void hdf_xdrfile_create(XDR *xdrs, int ncop); @@ -582,8 +564,6 @@ HDFLIBAPI intn HDisnetcdf(const char *filename); HDFLIBAPI intn HDisnetcdf64(const char *filename); -#endif /* HDF */ - #ifdef __cplusplus } #endif diff --git a/mfhdf/libsrc/mfdatainfo.c b/mfhdf/libsrc/mfdatainfo.c index d09bdad251..fb51ebe829 100644 --- a/mfhdf/libsrc/mfdatainfo.c +++ b/mfhdf/libsrc/mfdatainfo.c @@ -43,8 +43,6 @@ LOCAL ROUTINES #include "local_nc.h" -#ifdef HDF - #ifndef DATAINFO_MASTER #define DATAINFO_MASTER #endif @@ -855,5 +853,3 @@ SDgetanndatainfo(int32 sdsid, ann_type annot_type, uintn size, int32 *offsetarra return ret_value; } /* SDgetanndatainfo */ - -#endif /* HDF */ diff --git a/mfhdf/libsrc/mfhdf.h b/mfhdf/libsrc/mfhdf.h index ebecd051fa..3c77650f75 100644 --- a/mfhdf/libsrc/mfhdf.h +++ b/mfhdf/libsrc/mfhdf.h @@ -65,9 +65,7 @@ HDFLIBAPI int32 SDselect(int32 fid, int32 idx); HDFLIBAPI intn SDgetinfo(int32 sdsid, char *name, int32 *rank, int32 *dimsizes, int32 *nt, int32 *nattr); -#ifndef __CSTAR__ HDFLIBAPI intn SDreaddata(int32 sdsid, int32 *start, int32 *stride, int32 *end, void *data); -#endif HDFLIBAPI uint16 SDgerefnumber(int32 sdsid); @@ -95,9 +93,7 @@ HDFLIBAPI intn SDattrinfo(int32 id, int32 idx, char *name, int32 *nt, int32 *cou HDFLIBAPI intn SDreadattr(int32 id, int32 idx, void *buf); -#ifndef __CSTAR__ HDFLIBAPI intn SDwritedata(int32 sdsid, int32 *start, int32 *stride, int32 *end, void *data); -#endif HDFLIBAPI intn SDsetdatastrs(int32 sdsid, const char *l, const char *u, const char *f, const char *c); diff --git a/mfhdf/libsrc/mfsd.c b/mfhdf/libsrc/mfsd.c index 0266e21c07..35a14319c6 100644 --- a/mfhdf/libsrc/mfsd.c +++ b/mfhdf/libsrc/mfsd.c @@ -20,8 +20,6 @@ file - mfsd.c with SD. Routines beginning with SDI are internal routines and should not be used outside of this module. - Defining SDDEBUG will print status messages to stderr - SD interface: ------------------ @@ -87,7 +85,6 @@ NOTE: This file needs to have the comments cleaned up for most of the #include "local_nc.h" -#ifdef HDF #include "mfhdf.h" #include "hfile.h" @@ -97,10 +94,6 @@ NOTE: This file needs to have the comments cleaned up for most of the #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif #endif -/* for Chunk debugging */ -/* -#define CHK_DEBUG -*/ #ifndef MFSD_INTERNAL #define MFSD_INTERNAL @@ -315,10 +308,6 @@ SDstart(const char *name, /* IN: file name to open */ NC *handle = NULL; int32 ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDstart: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -388,18 +377,12 @@ SDend(int32 id /* IN: file ID of file to close */) NC *handle = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDend: I've been called\n"); -#endif - /* clear error stack */ HEclear(); /* get id? */ cdfid = (intn)id & 0xffff; -#ifndef SYNC_ON_EACC - /* get the handle */ handle = SDIhandle_from_id(id, CDFTYPE); if (handle == NULL) @@ -431,8 +414,6 @@ SDend(int32 id /* IN: file ID of file to close */) } } -#endif /* SYNC_ON_EACC */ - /* call netCDF close */ ret_value = ncclose(cdfid); @@ -462,10 +443,6 @@ SDfileinfo(int32 fid, /* IN: file ID */ NC *handle = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDnumber: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -475,10 +452,6 @@ SDfileinfo(int32 fid, /* IN: file ID */ HGOTO_ERROR(DFE_ARGS, FAIL); } -#ifdef SDDEBUG - fprintf(stderr, "SDnumber: looked up handle as %d\n", handle); -#endif - /* get number of data sets and global attributes */ *(int32 *)datasets = ((handle->vars != NULL) ? handle->vars->count : 0); *(int32 *)attrs = ((handle->attrs != NULL) ? handle->attrs->count : 0); @@ -521,10 +494,6 @@ SDselect(int32 fid, /* IN: file ID */ int32 sdsid; /* the id we're gonna build */ int32 ret_value = FAIL; -#ifdef SDDEBUG - fprintf(stderr, "SDselect: I've been called (index: %d) \n", index); -#endif - /* clear error stack */ HEclear(); @@ -582,10 +551,6 @@ SDgetinfo(int32 sdsid, /* IN: dataset ID */ NC_var *var = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetinfo: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -836,10 +801,6 @@ SDnametoindex(int32 fid, /* IN: file ID */ NC_var **dp = NULL; int32 ret_value = FAIL; -#ifdef SDDEBUG - fprintf(stderr, "SDnametoindex: I've been called\n"); -#endif - /* check that fid is valid */ handle = SDIhandle_from_id(fid, CDFTYPE); if (handle == NULL) { @@ -891,10 +852,6 @@ SDgetnumvars_byname(int32 fid, /* IN: file ID */ NC_var **dp = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetnumvars_byname: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -952,10 +909,6 @@ SDnametoindices(int32 fid, /* IN: file ID */ hdf_varlist_t *varlistp; int32 ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDnametoindices: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -1017,10 +970,6 @@ SDgetrange(int32 sdsid, /* IN: dataset ID */ NC_array *array = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetrange: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -1046,16 +995,10 @@ SDgetrange(int32 sdsid, /* IN: dataset ID */ attr2 = (NC_attr **)NC_findattr(&(var->attrs), "valid_min"); if ((attr1 == NULL) || (attr2 == NULL)) { -#ifdef SDDEBUG - fprintf(stderr, "No dice on range info (missing at least one)\n"); -#endif HGOTO_ERROR(DFE_RANGE, FAIL); } if (((*attr1)->HDFtype != var->HDFtype) || ((*attr2)->HDFtype != var->HDFtype)) { -#ifdef SDDEBUG - fprintf(stderr, "No dice on range info (wrong types)\n"); -#endif HGOTO_ERROR(DFE_RANGE, FAIL); } @@ -1137,10 +1080,6 @@ SDcreate(int32 fid, /* IN: file ID */ intn is_ragged; int32 ret_value = FAIL; -#ifdef SDDEBUG - fprintf(stderr, "SDcreate: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -1157,9 +1096,6 @@ SDcreate(int32 fid, /* IN: file ID */ /* check if its a ragged array. Why is this code still here? -GV */ if ((rank > 1) && dimsizes[rank - 1] == SD_RAGGED) { -#ifdef DEBUG - printf("YOW! We have a ragged array kids: %s\n", name); -#endif rank--; is_ragged = TRUE; } @@ -1309,10 +1245,6 @@ SDgetdimid(int32 sdsid, /* IN: dataset ID */ int32 dimindex; /* index of dim in the file, ie. dims of all SDSs */ int32 ret_value = FAIL; -#ifdef SDDEBUG - fprintf(stderr, "SDgetdimid: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -1381,10 +1313,6 @@ SDsetdimname(int32 id, /* IN: dataset ID */ unsigned ii; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetdimname: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -1446,10 +1374,6 @@ SDsetdimname(int32 id, /* IN: dataset ID */ DESCRIPTION Close down this access ID to a data object - Usually, this will do nothing. However, if the meta-data - has changed and SYNC_ON_EACC is defined flush it all out - to disk. - RETURNS SUCCEED / FAIL @@ -1460,10 +1384,6 @@ SDendaccess(int32 id /* IN: dataset ID */) NC *handle; int32 ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDendaccess: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -1473,38 +1393,8 @@ SDendaccess(int32 id /* IN: dataset ID */) HGOTO_ERROR(DFE_ARGS, FAIL); } -#ifdef SYNC_ON_EACC - - /* make sure we can write to the file */ - if (handle->flags & NC_RDWR) { - handle->xdrs->x_op = XDR_ENCODE; - - /* see if the meta-data needs to be updated */ - if (handle->flags & NC_HDIRTY) { - if (!xdr_cdf(handle->xdrs, &handle)) { - HGOTO_ERROR(DFE_XDRERROR, FAIL); - } - - handle->flags &= ~(NC_NDIRTY | NC_HDIRTY); - } - else { - /* see if the numrecs info needs updating */ - if (handle->flags & NC_NDIRTY) { - if (!xdr_numrecs(handle->xdrs, handle)) { - HGOTO_ERROR(DFE_XDRERROR, FAIL); - } - - handle->flags &= ~(NC_NDIRTY); - } - } - } - -#else - /* free the AID */ - ret_value = SDIfreevarAID(handle, id & 0xffff); - -#endif /* SYNC_ON_EACC */ + ret_value = SDIfreevarAID(handle, id & 0xffff); done: return ret_value; @@ -1537,10 +1427,6 @@ SDIputattr(NC_array **ap, /* IN/OUT: attribute list */ nc_type type; /* unmap -- HDF type to NC type */ intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDIputattr: I've been called\n"); -#endif - if ((type = hdf_unmap_type((int)nt)) == FAIL) { HGOTO_ERROR(DFE_ARGS, FAIL); } @@ -1620,10 +1506,6 @@ SDsetrange(int32 sdsid, /* IN: dataset ID */ intn sz; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetrange: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -1766,10 +1648,6 @@ SDsetattr(int32 id, /* IN: object ID */ intn sz; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetattr: I've been called\n"); -#endif - /* Clear error stack */ HEclear(); @@ -1849,10 +1727,6 @@ SDattrinfo(int32 id, /* IN: object ID */ NC *handle = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDattrinfo: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -1916,10 +1790,6 @@ SDreadattr(int32 id, /* IN: object ID */ NC *handle = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDreadattr: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -1993,10 +1863,6 @@ SDwritedata(int32 sdsid, /* IN: dataset ID */ intn ret_value = SUCCEED; int i; -#ifdef SDDEBUG - fprintf(stderr, "SDwritedata: I've been called\n"); -#endif - /* this decides how a dataset with unlimited dimension is written along the unlimited dimension; the behavior is different between SD and nc APIs */ cdf_routine_name = "SDwritedata"; @@ -2154,10 +2020,6 @@ SDsetdatastrs(int32 sdsid, /* IN: dataset ID */ NC_var *var = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetdatastrs: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -2230,10 +2092,6 @@ SDsetcal(int32 sdsid, /* IN: dataset ID */ NC_var *var = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetcal: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -2298,10 +2156,6 @@ SDsetfillvalue(int32 sdsid, /* IN: dataset ID */ NC_var *var = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetfillvalue: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -2352,10 +2206,6 @@ SDgetfillvalue(int32 sdsid, /* IN: dataset ID */ NC_attr **attr = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetfillvalue: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -2415,10 +2265,6 @@ SDgetdatastrs(int32 sdsid, /* IN: dataset ID */ NC_attr **attr = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetdatastrs: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -2520,10 +2366,6 @@ SDgetcal(int32 sdsid, /* IN: dataset ID */ NC_attr **attr = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetcal: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -2625,14 +2467,7 @@ SDIgetcoordvar(NC *handle, /* IN: file handle */ (*dp)->var_type == UNKNOWN) { /* see if we need to change the number type */ if ((nt != 0) && (nt != (*dp)->type)) { -#ifdef SDDEBUG - fprintf(stderr, "SDIgetcoordvar redefining type\n"); -#endif if (((*dp)->type = hdf_unmap_type((int)nt)) == FAIL) { -#ifdef SDDEBUG - /* replace it with NCAdvice or HERROR? */ - fprintf(stderr, "SDIgetcoordvar: hdf_unmap_type failed for %d\n", nt); -#endif HGOTO_ERROR(DFE_INTERNAL, FAIL); } @@ -2730,9 +2565,6 @@ SDsetdimstrs(int32 id, /* IN: dimension ID */ NC_var *var = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetdimstrs: I've been called\n"); -#endif /* clear error stack */ HEclear(); @@ -2858,10 +2690,6 @@ SDsetdimscale(int32 id, /* IN: dimension ID */ long end[1]; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetdimscales: I've been called\n"); -#endif - /* this decides how a dataset with unlimited dimension is written along the unlimited dimension; the behavior is different between SD and nc APIs */ cdf_routine_name = "SDsetdimscales"; @@ -2937,10 +2765,6 @@ SDgetdimscale(int32 id, /* IN: dimension ID */ long end[1]; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetdimscale: I've been called\n"); -#endif - /* this decides how a dataset with unlimited dimension is read along the unlimited dimension; the behavior is different between SD and nc APIs */ cdf_routine_name = "SDgetdimscale"; @@ -3034,10 +2858,6 @@ SDdiminfo(int32 id, /* IN: dimension ID */ intn len; int ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDdiminfo: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -3143,10 +2963,6 @@ SDgetdimstrs(int32 id, /* IN: dataset ID */ int32 namelen; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetdimstrs: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -3294,10 +3110,6 @@ SDsetexternalfile(int32 id, /* IN: dataset ID */ intn status; int ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetexternalfile: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -3411,10 +3223,6 @@ SDgetexternalinfo(int32 id, /* IN: dataset ID */ intn actual_fname_len = 0; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetexternalinfo: I've been called\n"); -#endif - /* Clear error stack */ HEclear(); @@ -3554,10 +3362,6 @@ SDgetexternalfile(int32 id, /* IN: dataset ID */ intn actual_len = 0; int ret_value = 0; -#ifdef SDDEBUG - fprintf(stderr, "SDgetexternalfile: I've been called\n"); -#endif - /* Clear error stack */ HEclear(); @@ -3673,10 +3477,6 @@ SDsetnbitdataset(int32 id, /* IN: dataset ID */ intn status; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetnbitdataset: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -3705,15 +3505,7 @@ SDsetnbitdataset(int32 id, /* IN: dataset ID */ c_info.nbit.start_bit = start_bit; c_info.nbit.bit_len = bit_len; -#ifdef SDDEBUG - printf("SDsetnbitdata(): nt=%d, sign_ext=%d, fill_one=%d, start_bit=%d, bit_len=%d\n", - (intn)c_info.nbit.nt, (intn)c_info.nbit.sign_ext, (intn)c_info.nbit.fill_one, - (intn)c_info.nbit.start_bit, (intn)c_info.nbit.bit_len); -#endif if (!var->data_ref) { /* doesn't exist */ -#ifdef SDDEBUG - printf("SDsetnbitdata(): dataset doesn't exist\n"); -#endif /* element doesn't exist so we need a reference number */ var->data_ref = Hnewref(handle->hdf_file); @@ -3725,9 +3517,6 @@ SDsetnbitdataset(int32 id, /* IN: dataset ID */ status = (intn)HCcreate(handle->hdf_file, (uint16)DATA_TAG, (uint16)var->data_ref, COMP_MODEL_STDIO, &m_info, COMP_CODE_NBIT, &c_info); -#ifdef SDDEBUG - printf("SDsetnbitdata(): HCcreate() status=%d\n", (intn)status); -#endif if (status != FAIL) { if (var && (var->aid != 0) && (var->aid != FAIL)) { if (Hendaccess(var->aid) == FAIL) { @@ -3833,10 +3622,6 @@ SDsetcompress(int32 id, /* IN: dataset ID */ intn status = FAIL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetcompress: I've been called\n"); -#endif /* SDDEBUG */ - /* clear error stack */ HEclear(); @@ -3902,13 +3687,7 @@ SDsetcompress(int32 id, /* IN: dataset ID */ } #endif /* H4_HAVE_LIBSZ */ -#ifdef SDDEBUG - printf("SDsetcompress(): var->data_ref=%d\n", (int)var->data_ref); -#endif /* SDDEBUG */ if (!var->data_ref) { /* doesn't exist */ -#ifdef SDDEBUG - printf("SDsetcompress(): dataset doesn't exist\n"); -#endif /* SDDEBUG */ /* element doesn't exist so we need a reference number */ var->data_ref = Hnewref(handle->hdf_file); @@ -3920,12 +3699,6 @@ SDsetcompress(int32 id, /* IN: dataset ID */ status = (intn)HCcreate(handle->hdf_file, (uint16)DATA_TAG, (uint16)var->data_ref, COMP_MODEL_STDIO, &m_info, comp_type, &c_info_x); -#ifdef SDDEBUG - printf("SDsetcompress(): HCcreate() status=%d\n", (intn)status); - if (status == FAIL) - HEprint(stderr, 0); -#endif /* SDDEBUG */ - if (status != FAIL) { if (var && (var->aid != 0) && (var->aid != FAIL)) { if (Hendaccess(var->aid) == FAIL) { @@ -3997,10 +3770,6 @@ SDgetcompress( intn status = FAIL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetcompress: I've been called\n"); -#endif /* SDDEBUG */ - /* clear error stack */ HEclear(); @@ -4017,9 +3786,6 @@ SDgetcompress( if (var == NULL) HGOTO_ERROR(DFE_ARGS, FAIL); -#ifdef SDDEBUG - printf("SDgetcompress(): var->data_ref=%d, var->aid=%d\n", (int)var->data_ref, (int)var->aid); -#endif /* SDDEBUG */ if (!var->data_ref) HGOTO_ERROR(DFE_ARGS, FAIL); @@ -4066,10 +3832,6 @@ SDgetcompinfo(int32 sdsid, /* IN: dataset ID */ intn status = FAIL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetcompinfo: I've been called\n"); -#endif /* SDDEBUG */ - /* clear error stack */ HEclear(); @@ -4086,9 +3848,6 @@ SDgetcompinfo(int32 sdsid, /* IN: dataset ID */ if (var == NULL) HGOTO_ERROR(DFE_ARGS, FAIL); -#ifdef SDDEBUG - printf("SDgetcompinfo(): var->data_ref=%d, var->aid=%d\n", (int)var->data_ref, (int)var->aid); -#endif /* SDDEBUG */ /* return with SUCCEED if the data set is empty and not compressed; when the data set is set compressed, the data has a valid reference number */ if (!var->data_ref) { @@ -4133,10 +3892,6 @@ SDgetcomptype(int32 sdsid, /* IN: dataset ID */ intn status = FAIL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetcomptype: I've been called\n"); -#endif /* SDDEBUG */ - /* clear error stack */ HEclear(); @@ -4331,10 +4086,6 @@ SDidtoref(int32 id /* IN: dataset ID */) NC_var *var = NULL; int32 ret_value = FAIL; -#ifdef SDDEBUG - fprintf(stderr, "SDidtoref: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -4378,10 +4129,6 @@ SDreftoindex(int32 fid, /* IN: file ID */ intn ii; int32 ret_value = FAIL; -#ifdef SDDEBUG - fprintf(stderr, "SDreftoindex: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -4426,10 +4173,6 @@ SDisrecord(int32 id /* IN: dataset ID */) NC_var *var = NULL; int32 ret_value = TRUE; -#ifdef SDDEBUG - fprintf(stderr, "SDisrecord: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -4481,10 +4224,6 @@ SDiscoordvar(int32 id /* IN: dataset ID */) int32 dimindex; intn ret_value = TRUE; -#ifdef SDDEBUG - fprintf(stderr, "SDiscoordvar: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -4562,10 +4301,6 @@ SDsetaccesstype(int32 id, /* IN: dataset ID */ NC_var *var = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetaccesstype: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -4625,10 +4360,6 @@ SDsetblocksize(int32 sdsid, /* IN: dataset ID */ NC_var *var = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetblocksize: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -4673,10 +4404,6 @@ SDgetblocksize(int32 sdsid, /* IN: dataset ID */ int32 temp_aid = -1; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetblocksize: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -4744,10 +4471,6 @@ SDsetfillmode(int32 sd_id, /* IN: HDF file ID, returned from SDstart */ intn cdfid; intn ret_value = FAIL; -#ifdef SDDEBUG - fprintf(stderr, "SDsetfillmode: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -4785,10 +4508,6 @@ SDsetdimval_comp(int32 dimid, /* IN: dimension ID, returned from SDgetdimid * NC_dim *dim = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDsetdimval_comp: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -4836,10 +4555,6 @@ SDisdimval_bwcomp(int32 dimid /* IN: dimension ID, returned from SDgetdimid */) NC_dim *dim = NULL; intn ret_value = FAIL; -#ifdef SDDEBUG - fprintf(stderr, "SDisdimval_bwcomp: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -5004,10 +4719,6 @@ SDsetchunk(int32 sdsid, /* IN: sds access id */ intn i; /* loop variable */ intn ret_value = SUCCEED; /* return value */ -#ifdef CHK_DEBUG - fprintf(stderr, "SDsetchunk: called \n"); -#endif - /* clear error stack */ HEclear(); @@ -5108,20 +4819,11 @@ SDsetchunk(int32 sdsid, /* IN: sds access id */ HGOTO_ERROR(DFE_ARGS, FAIL); } -#ifdef CHK_DEBUG - fprintf(stderr, "SDsetchunk: does data ref exist? \n"); -#endif /* Does data exist yet */ if (!var->data_ref) { /* doesn't exist */ -#ifdef CHK_DEBUG - fprintf(stderr, "SDsetchunk: data ref does not exist \n"); -#endif /* element doesn't exist so we need a reference number */ var->data_ref = Hnewref(handle->hdf_file); if (var->data_ref == 0) { -#ifdef CHK_DEBUG - fprintf(stderr, "SDsetchunk: failed to get data ref \n"); -#endif HGOTO_ERROR(DFE_ARGS, FAIL); } } @@ -5132,9 +4834,6 @@ SDsetchunk(int32 sdsid, /* IN: sds access id */ /* Now start setting chunk info */ ndims = var->assoc->count; /* set number of dims i.e. rank */ -#ifdef CHK_DEBUG - fprintf(stderr, "SDsetchunk: got data ref, ndims =%d \n", ndims); -#endif /* allocate space for chunk dimensions */ if ((chunk[0].pdims = malloc(ndims * sizeof(DIM_DEF))) == NULL) { @@ -5152,31 +4851,15 @@ SDsetchunk(int32 sdsid, /* IN: sds access id */ if (var->shape[i] != SD_UNLIMITED) chunk[0].pdims[i].dim_length = (int32)var->shape[i]; else { /* UNLIMITED dimension case */ -#ifdef CHK_DEBUG - fprintf(stderr, "SDsetchunk: unlimited dimension case \n"); - fflush(stderr); -#endif HGOTO_ERROR(DFE_ARGS, FAIL); } -#ifdef CHK_DEBUG - fprintf(stderr, "SDsetchunk: (int32) var->shape[%d]=%d\n", i, (int32)var->shape[i]); - fflush(stderr); -#endif /* set chunk lengths */ if (cdims[i] >= 1) chunk[0].pdims[i].chunk_length = cdims[i]; else { /* chunk length is less than 1 */ -#ifdef CHK_DEBUG - fprintf(stderr, "SDsetchunk: chunk length less than 1, cdims[%d]=%d \n", i, cdims[i]); - fflush(stderr); -#endif HGOTO_ERROR(DFE_ARGS, FAIL); } -#ifdef CHK_DEBUG - fprintf(stderr, "SDsetchunk: cdims[%d]=%d \n", i, cdims[i]); - fflush(stderr); -#endif /* Data distribution along dimensions * Check dimension length against chunk length */ if (cdims[i] == (int32)var->shape[i]) @@ -5191,10 +4874,6 @@ SDsetchunk(int32 sdsid, /* IN: sds access id */ /* Set number type size i.e. size of data type */ chunk[0].nt_size = var->HDFsize; -#ifdef CHK_DEBUG - fprintf(stderr, "SDsetchunk: var->HDFsize=%d\n", var->HDFsize); - fflush(stderr); -#endif /* allocate space for fill value whose number type is the same as the dataset */ fill_val_len = var->HDFsize; @@ -5267,9 +4946,6 @@ SDsetchunk(int32 sdsid, /* IN: sds access id */ } } -#ifdef CHK_DEBUG - fprintf(stderr, "SDsetchunk: get ready to create, convert=%d\n", convert); -#endif if (convert) { /* convert fill value */ if (FAIL == DFKconvert(fill_val, tBuf, var->HDFtype, (uint32)(fill_val_len / var->HDFsize), DFACC_WRITE, 0, 0)) { @@ -5303,9 +4979,6 @@ SDsetchunk(int32 sdsid, /* IN: sds access id */ (HCHUNK_DEF *)chunk /* chunk definition */); } -#ifdef CHK_DEBUG - fprintf(stderr, "SDsetchunk: ret_value =%d \n", ret_value); -#endif /* check return */ if (ret_value != FAIL) { /* close old aid and set new one ..hmm......maybe this is for the doubly special hack since @@ -5691,10 +5364,6 @@ SDwritechunk(int32 sdsid, /* IN: access aid to SDS */ /* Write chunk out, */ if (convert) { -#ifdef CHK_DEBUG - fprintf(stderr, "SDwritechunk: convert, var->HDFsize=%d, var->HDFtype=%d \n", - var->HDFsize, var->HDFtype); -#endif /* convert it */ if (FAIL == DFKconvert((void *)datap, tBuf, var->HDFtype, (byte_count / var->HDFsize), DFACC_WRITE, 0, 0)) { @@ -5884,10 +5553,6 @@ SDreadchunk(int32 sdsid, /* IN: access aid to SDS */ /* read chunk in */ if (convert) { -#ifdef CHK_DEBUG - fprintf(stderr, "SDreadchunk: convert, var->HDFsize=%d, var->HDFtype=%d \n", var->HDFsize, - var->HDFtype); -#endif /* read it in */ if ((ret_value = HMCreadChunk(var->aid, origin, tBuf)) != FAIL) { /* convert chunk */ @@ -6058,10 +5723,6 @@ SDcheckempty(int32 sdsid, /* IN: dataset ID */ NC_var *var = NULL; /* variable record struct */ int32 ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDcheckempty: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -6127,10 +5788,6 @@ SDidtype(int32 an_id) NC *handle = NULL; /* file record struct */ hdf_idtype_t ret_value = NOT_SDAPI_ID; -#ifdef SDDEBUG - fprintf(stderr, "SDidtype: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -6182,10 +5839,6 @@ SDreset_maxopenfiles(intn req_max) { intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDreset_maxopenfiles: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -6219,10 +5872,6 @@ SDget_maxopenfiles(intn *curr_max, /* OUT: current # of open files allowed */ { intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDget_maxopenfiles: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -6259,10 +5908,6 @@ SDget_numopenfiles(void) { intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDget_numopenfiles: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -6292,10 +5937,6 @@ SDgetfilename(int32 fid, /* IN: file ID */ intn len; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetfilename: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -6336,10 +5977,6 @@ SDgetnamelen(int32 id, /* IN: object ID */ NC_dim *dim = NULL; intn ret_value = SUCCEED; -#ifdef SDDEBUG - fprintf(stderr, "SDgetnamelen: I've been called\n"); -#endif - /* clear error stack */ HEclear(); @@ -6380,5 +6017,3 @@ SDgetnamelen(int32 id, /* IN: object ID */ done: return ret_value; } /* SDgetnamelen */ - -#endif /* HDF */ diff --git a/mfhdf/libsrc/nssdc.c b/mfhdf/libsrc/nssdc.c index c022fb2e8e..9f4bfc5719 100644 --- a/mfhdf/libsrc/nssdc.c +++ b/mfhdf/libsrc/nssdc.c @@ -12,7 +12,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "local_nc.h" -#ifdef HDF #include "hfile.h" /* constants/macros pulled out of the CDF library source */ @@ -155,10 +154,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) /* interesting stuff in AEDR record */ int32 count; -#if DEBUG - fprintf(stderr, "nssdc_read_cdf i've been called\n"); -#endif - handle = (*handlep); fp = handle->cdf_fp; current_var = 0; @@ -190,18 +185,12 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) * Only handle single file implementations for now */ if (!bitset(flags, CDF_FORMAT_BIT)) { -#ifdef DEBUG - fprintf(stderr, "We are only able to handle single-file CDFs. Sorry.\n"); -#endif return (FALSE); } /* Check the encoding */ if ((encoding != NETWORK_ENCODING) && (encoding != SUN_ENCODING) && (encoding != SGi_ENCODING) && (encoding != IBMRS_ENCODING) && (encoding != HP_ENCODING)) { -#ifdef DEBUG - fprintf(stderr, "We are only able to handle IEEE encoded files. Sorry.\n"); -#endif return (FALSE); } @@ -240,12 +229,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) if (HI_READ(fp, buffer, numDims * sizeof(int32)) == FAIL) HRETURN_ERROR(DFE_READERROR, FALSE); -#ifdef DEBUG - fprintf(stderr, "File version %d.%d\n", (int)vers, (int)release); - fprintf(stderr, " rVars %d, Attrs %d, zVars %d\n", (int)numRVars, (int)numAttrs, (int)numZVars); - fprintf(stderr, " Dims %d, maxRec %d\n", (int)numDims, (int)maxRec); -#endif - /* * For each rVariable dimension size create a new dimension object */ @@ -256,10 +239,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) INT32DECODE(b, dim_sz[i]); sprintf(tmpname, "CDFdim%d_%d", i, (int)dim_sz[i]); dim_rec[current_dim++] = NC_new_dim(tmpname, dim_sz[i]); - -#ifdef DEBUG - fprintf(stderr, "Created dimension %s\n", tmpname); -#endif } /* @@ -267,10 +246,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) */ while (varNext != 0) { -#ifdef DEBUG - fprintf(stderr, "Variable %d seeking to %d\n", (int)current_var, (int)varNext); -#endif - if (HI_SEEK(fp, varNext) == FAIL) HRETURN_ERROR(DFE_SEEKERROR, FALSE); @@ -311,11 +286,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) j++; name[j] = '\0'; -#ifdef DEBUG - fprintf(stderr, "\tName %s nt %d vMaxRec %d\n", name, (int)nt, (int)vMaxRec); - fprintf(stderr, "\tNext var at %d\n", (int)varNext); -#endif - /* * Figure out which dimensions are meaningful * If we vary in the record dimension it is reflected in the variable's @@ -353,10 +323,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) if (var == NULL) HRETURN_ERROR(DFE_NOSPACE, FALSE); -#ifdef DEBUG - fprintf(stderr, "Was able to call NC_new_var()\n"); -#endif - /* if it is unsigned at least set the HDFtype to reflect it */ switch (nt) { case CDF_UINT1: @@ -400,9 +366,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) vix->next = NULL; -#ifdef DEBUG - fprintf(stderr, "Reading a VXR record at %d\n", (int)vxrNext); -#endif /* * Read the next record out of the file */ @@ -431,13 +394,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) INT32DECODE(b, vix->lastRec[i]); for (i = 0; i < vix->nEntries; i++) INT32DECODE(b, vix->offset[i]); - -#ifdef DEBUG - for (i = 0; i < vix->nEntries; i++) - fprintf(stderr, "\t%d %d %d\n", (int)vix->firstRec[i], (int)vix->lastRec[i], - (int)vix->offset[i]); - fprintf(stderr, "Next record at %d\n", (int)vxrNext); -#endif } current_var++; @@ -448,10 +404,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) */ while (zVarNext != 0) { -#ifdef DEBUG - fprintf(stderr, "zVariable %d seeking to %d\n", i, (int)zVarNext); -#endif - if (HI_SEEK(fp, zVarNext) == FAIL) HRETURN_ERROR(DFE_SEEKERROR, FALSE); @@ -493,10 +445,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) name[j] = '\0'; /* MORE STUFF */ -#ifdef DEBUG - fprintf(stderr, "\tName %s nt %d vMaxRec %d\n", name, (int)nt, (int)vMaxRec); -#endif - /* * Get the number of dimensions defined with this dataset * This is not necessarily the rank since we may not vary in @@ -524,10 +472,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) } } -#ifdef DEBUG - fprintf(stderr, "\trank %d numDims %d\n", (int)rank, (int)numDims); -#endif - /* map the CDF type into a netCDF type */ nctype = cdf_unmap_type(nt); @@ -572,9 +516,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) vix->next = NULL; -#ifdef DEBUG - fprintf(stderr, "Reading a VXR record at %d\n", (int)vxrNext); -#endif /* * Read the next record out of the file */ @@ -603,13 +544,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) INT32DECODE(b, vix->lastRec[i]); for (i = 0; i < vix->nEntries; i++) INT32DECODE(b, vix->offset[i]); - -#ifdef DEBUG - for (i = 0; i < vix->nEntries; i++) - fprintf(stderr, "\t%d %d %d\n", (int)vix->firstRec[i], (int)vix->lastRec[i], - (int)vix->offset[i]); - fprintf(stderr, "Next record at %d\n", (int)vxrNext); -#endif } current_var++; @@ -621,10 +555,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) */ for (i = 0; i < numAttrs; i++) { -#ifdef DEBUG - fprintf(stderr, "Attribute %d seeking to %d\n", i, (int)adrNext); -#endif - if (HI_SEEK(fp, adrNext) == FAIL) HRETURN_ERROR(DFE_SEEKERROR, FALSE); @@ -655,13 +585,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) memcpy(name, b, CDF_ATTR_NAME_LEN); name[CDF_ATTR_NAME_LEN] = '\0'; -#ifdef DEBUG - fprintf(stderr, "\tname %s (%s) data at %d\n", name, (scope == 1 ? "global" : "local"), - (int)aedrNext); - fprintf(stderr, "\taedrNext %d aedzNext %d\n", (int)aedrNext, (int)aedzNext); - -#endif - /* * Read in the AEDR records now and add them to the appropriate object */ @@ -721,10 +644,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) else { /* local --- find the appropriate variable */ ap = &(vars[num]->attrs); -#ifdef DEBUG - fprintf(stderr, "\tAdding %s (%s) to var %d \n", name, (scope == 1 ? "global" : "local"), - (int)num); -#endif } /* add the attribute to the list */ @@ -752,10 +671,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) char *tBuf; int32 bsize; -#ifdef DEBUG - fprintf(stderr, "\tReading aedz from %d\n", (int)aedzNext); -#endif - if (HI_SEEK(fp, aedzNext) == FAIL) HRETURN_ERROR(DFE_SEEKERROR, FALSE); @@ -806,10 +721,6 @@ nssdc_read_cdf(XDR *xdrs, NC **handlep) else { /* local --- find the appropriate variable */ ap = &(vars[num]->attrs); -#ifdef DEBUG - fprintf(stderr, "\tAdding %s (%s) to Zvar %d \n", name, (scope == 1 ? "global" : "local"), - (int)num); -#endif } /* add the attribute to the list */ @@ -857,16 +768,6 @@ nssdc_write_cdf(XDR *xdrs, NC **handlep) (void)xdrs; (void)handlep; -#if DEBUG - fprintf(stderr, "nssdc_write_cdf i've been called\n"); -#endif - -#ifdef DEBUG - fprintf(stderr, "We are sorry, we currently do not support writing to\n"); - fprintf(stderr, "CDF files. If you would like to see this capabilities\n"); - fprintf(stderr, "please contact the HDFG helpdesk: help at hdfgroup dot org.\n"); -#endif - return (FALSE); } /* nssdc_write_cdf */ @@ -882,10 +783,6 @@ nssdc_xdr_cdf(XDR *xdrs, NC **handlep) int status; -#if DEBUG - fprintf(stderr, "nssdc_xdr_cdf i've been called op = %d \n", xdrs->x_op); -#endif - switch (xdrs->x_op) { case XDR_ENCODE: status = nssdc_write_cdf(xdrs, handlep); @@ -904,5 +801,3 @@ nssdc_xdr_cdf(XDR *xdrs, NC **handlep) return (status); } /* nssdc_xdr_cdf */ - -#endif /* HDF */ diff --git a/mfhdf/libsrc/putget.c b/mfhdf/libsrc/putget.c index 36a2282325..d4df776f85 100644 --- a/mfhdf/libsrc/putget.c +++ b/mfhdf/libsrc/putget.c @@ -16,7 +16,6 @@ #include #include "local_nc.h" -#ifdef HDF #include "hfile.h" /* Ugh! We need the defs for HI_READ and HI_SEEK */ /* Local function prototypes */ @@ -29,36 +28,10 @@ static intn hdf_xdr_NCv1data(NC *handle, NC_var *vp, u_long where, nc_type type, static intn SDIresizebuf(void **buf, int32 *buf_size, int32 size_wanted); -#endif /* HDF */ - static const long *NCvcmaxcontig(NC *, NC_var *, const long *, const long *); int NC_fill_buffer(NC *handle, int varid, const long *edges, void *values); -#ifndef HDF -#define MIN(mm, nn) (((mm) < (nn)) ? (mm) : (nn)) -#define MAX(mm, nn) (((mm) > (nn)) ? (mm) : (nn)) -#endif /* HDF */ - -/* #define VDEBUG */ -/* #define DEBUG */ -/* #define CDEBUG */ - -#ifdef VDEBUG -/* - * Print the values of an array of longs - */ -int -arrayp(const char *label, unsigned count, const long array[]) -{ - fprintf(stderr, "%s", label); - fputc('\t', stderr); - for (; count > 0; count--, array++) - fprintf(stderr, " %ld", *array); - fputc('\n', stderr); -} -#endif /* VDEBUG */ - #define xdr_NCsetpos(xdrs, pos) xdr_setpos((xdrs), (pos)) /* @@ -140,15 +113,8 @@ NCcoordck(NC *handle, NC_var *vp, const long *coords) up = vp->shape + vp->assoc->count - 1; /* pointer for dimension sizes */ ip = coords + vp->assoc->count - 1; /* pointer for start coords */ -#ifdef CDEBUG - fprintf(stderr, " NCcoordck: coords %p, *coords %ld, count %ld, ip %p, boundary %p, *ip %ld\n", - coords, *coords, vp->assoc->count, ip, boundary, *ip); -#endif /* CDEBUG */ /* for each dimension, check if starting coord is within dim size */ for (; ip >= boundary; ip--, up--) { -#ifdef CDEBUG - fprintf(stderr, " NCcoordck: ip %p, *ip %ld, up %p, *up %lu\n", ip, *ip, up, *up); -#endif /* CDEBUG */ if (*ip < 0 || *ip >= (long)*up) goto bad; } @@ -157,11 +123,10 @@ NCcoordck(NC *handle, NC_var *vp, const long *coords) /* Reset ip to coords for subsequent use */ ip = coords; - /********************************************************************/ - /* The following block (#ifdef HDF) is for hdf4 API and hdf4/nc API */ - /********************************************************************/ + /*******************************************************/ + /* The following block is for hdf4 API and hdf4/nc API */ + /*******************************************************/ -#ifdef HDF /* If file is an HDF file (ie., not netCDF, created with HDF API or HDF/nc API) and the variable has unlimited dimension */ if (handle->file_type == HDF_FILE && IS_RECVAR(vp)) { @@ -180,10 +145,6 @@ NCcoordck(NC *handle, NC_var *vp, const long *coords) if ((unfilled = *ip - vp->numrecs) < 0) return TRUE; -#ifdef CDEBUG - fprintf(stderr, "NCcoordck: check 3.6, unfilled=%d\n", unfilled); -#endif /* CDEBUG */ - /* If we get here from an nc API, then reading beyond the end of the current variable will write fill values to the gap between the end of this variable and the max numrecs in the file. It will only fail @@ -223,10 +184,6 @@ NCcoordck(NC *handle, NC_var *vp, const long *coords) else NC_arrayfill(strg, len, vp->type); -#ifdef DEBUG - fprintf(stderr, "Going to fill in record %d for variable %s\n", *ip, vp->name->values); -#endif - /* * Seek to correct location */ @@ -236,11 +193,6 @@ NCcoordck(NC *handle, NC_var *vp, const long *coords) if (FAIL == Hseek(vp->aid, (vp->numrecs) * byte_count, DF_START)) return FALSE; -#ifdef DEBUG - fprintf(stderr, "Filling %d bytes starting at %d\n", byte_count * unfilled, - (vp->numrecs) * byte_count); -#endif - /* * Write out the values */ @@ -253,19 +205,12 @@ NCcoordck(NC *handle, NC_var *vp, const long *coords) return FALSE; } -#ifdef DEBUG - fprintf(stderr, "WROTE %d values at location %d (numrecs = %d)\n", count, *ip * count, - vp->numrecs); -#endif free(strg); free(strg1); strg = strg1 = NULL; } /* !SD_NOFILL */ vp->numrecs = MAX(vp->numrecs, (*ip + 1)); /* if NOFILL */ -#ifdef CDEBUG - fprintf(stderr, "NCcoordck: check 10.0, vp->numrecs=%d\n", vp->numrecs); -#endif /* CDEBUG */ if ((*ip + 1) > (long)(handle->numrecs)) { handle->numrecs = *ip + 1; handle->flags |= NC_NDIRTY; @@ -273,7 +218,6 @@ NCcoordck(NC *handle, NC_var *vp, const long *coords) return (TRUE); } -#endif /* HDF */ /**********************************************/ /* The following block is for netCDF API file */ @@ -313,10 +257,6 @@ NCcoordck(NC *handle, NC_var *vp, const long *coords) return (TRUE); bad: -#ifdef VDEBUG - arrayp("\t\tcoords", vp->assoc->count, coords); - arrayp("\t\tmax", vp->assoc->count, vp->shape); -#endif /* VDEBUG */ NCadvise(NC_EINVALCOORDS, "%s: Invalid Coordinates", vp->name->values); return (FALSE); } @@ -331,10 +271,8 @@ NC_varoffset(NC *handle, NC_var *vp, const long *coords) const long *ip; unsigned long *up; const long *boundary; -#ifdef HDF - vix_t *vix; - intn i; -#endif + vix_t *vix; + intn i; if (vp->assoc->count == 0) /* 'scaler' variable */ return (vp->begin); @@ -350,24 +288,16 @@ NC_varoffset(NC *handle, NC_var *vp, const long *coords) offset += *up * *ip; if (IS_RECVAR(vp)) { -#ifdef HDF switch (handle->file_type) { case HDF_FILE: return (vp->dsizes[0] * *coords + offset); case netCDF_FILE: return (vp->begin + handle->recsize * *coords + offset); case CDF_FILE: -#ifdef DEBUG - fprintf(stderr, "Yow! Don't do CDF records yet\n"); -#endif return (0); } -#else /* !HDF */ - return (vp->begin + handle->recsize * *coords + offset); -#endif /* !HDF */ } else { -#ifdef HDF switch (handle->file_type) { case HDF_FILE: return (offset); @@ -398,9 +328,6 @@ NC_varoffset(NC *handle, NC_var *vp, const long *coords) } /* loop over all vix records */ break; } -#else /* !HDF */ - return (vp->begin + offset); -#endif /* !HDF */ } /* should never get to here */ @@ -575,8 +502,6 @@ xdr_NCv1data(XDR *xdrs, u_long where, nc_type type, Void *values) * *****************************************************************************/ -#ifdef HDF - static int32 tBuf_size = 0; static int32 tValues_size = 0; static int8 *tBuf = NULL; @@ -646,10 +571,6 @@ hdf_get_data(NC *handle, NC_var *vp) int32 tag, t, n; int ret_value = DFREF_NONE; -#ifdef DEBUG - fprintf(stderr, "hdf_get_data I've been called\n"); -#endif - if (NULL == handle) { ret_value = DFREF_NONE; goto done; @@ -715,11 +636,6 @@ hdf_get_data(NC *handle, NC_var *vp) /* * create a new data storage object */ -#ifdef DEBUG - fprintf(stderr, "--- Creating new data storage (len = %d) --- \n", vp->len); - fprintf(stderr, "shape[0]= %d shape[1]= %d\n", vp->shape[0], vp->shape[1]); - fprintf(stderr, "dsize[0]= %d dsize[1]= %d\n", vp->dsizes[0], vp->dsizes[1]); -#endif /* -------------------------------------- * @@ -729,10 +645,6 @@ hdf_get_data(NC *handle, NC_var *vp) */ vsid = Hnewref(handle->hdf_file); -#ifdef DEBUG - fprintf(stderr, "--- Allocating new data storage szof=%d, to_do=%d\n", (int)vp->szof, (int)to_do); - fprintf(stderr, "byte_count=%d\n", (int)byte_count); -#endif /* if it is a record var might as well make it linked blocks now */ if (IS_RECVAR(vp)) { @@ -797,10 +709,6 @@ hdf_get_data(NC *handle, NC_var *vp) } } -#ifdef DEBUG - fprintf(stderr, "Done with the DATA Vdata returning id %d\n", vsid); -#endif - vp->aid = FAIL; /* added a new object -- make sure we flush the header */ @@ -895,14 +803,6 @@ hdf_xdr_NCvdata(NC *handle, NC_var *vp, u_long where, nc_type type, uint32 count (void)type; -#ifdef DEBUG - fprintf(stderr, "hdf_xdr_NCvdata I've been called : %s\n", vp->name->values); -#endif - -#ifdef DEBUG - fprintf(stderr, "Where = %d count = %d\n", where, count); -#endif - if (vp->aid == FAIL && hdf_get_vp_aid(handle, vp) == FAIL) { /* * Fail if there is no data *AND* we were trying to read... @@ -938,10 +838,6 @@ hdf_xdr_NCvdata(NC *handle, NC_var *vp, u_long where, nc_type type, uint32 count goto done; } -#ifdef DEBUG - fprintf(stderr, "vp->aid=%d, length=%ld, byte_count=%ld\n", (int)vp->aid, (long)elem_length, - (long)byte_count); -#endif /* Check for zero-length compressed special element, i.e. a template */ if (elem_length <= 0) { attr = NC_findattr(&vp->attrs, _FillValue); @@ -983,19 +879,12 @@ hdf_xdr_NCvdata(NC *handle, NC_var *vp, u_long where, nc_type type, uint32 count in the reading values, writing values, and writing fill values parts in this routine */ -#ifdef DEBUG - fprintf(stderr, "hdf_xdr_NCvdata: tBuf_size=%d, tBuf=%p\n", (int)tBuf_size, tBuf); -#endif - /* * It may be the case that the current does NOT begin at the start of the * data-object which is storing it. In that case compute the correct * location. * QAK: This shouldn't be an issue for compressed template objects. */ -#ifdef DEBUG - fprintf(stderr, "hdf_xdr_NCvdata: vp->data_offset=%d, where=%d\n", (int)vp->data_offset, (int)where); -#endif if (vp->data_offset > 0) { where += vp->data_offset; @@ -1069,9 +958,6 @@ hdf_xdr_NCvdata(NC *handle, NC_var *vp, u_long where, nc_type type, uint32 count } /* end if */ } /* end if */ -#ifdef DEBUG - fprintf(stderr, "hdf_xdr_NCvdata vp->aid=%d, where=%d\n", (int)vp->aid, (int)where); -#endif /* if we get here and the length is 0, we need to fill in the initial set of fill-values */ if (elem_length <= 0 && where > 0) { /* fill in the lead sequence of bytes with the fill values */ if ((handle->flags & NC_NOFILL) == 0 || isspecial == SPECIAL_COMP) { @@ -1164,20 +1050,12 @@ hdf_xdr_NCvdata(NC *handle, NC_var *vp, u_long where, nc_type type, uint32 count } /* end if */ else { /* position ourselves correctly */ -#ifdef DEBUG - fprintf(stderr, "hdf_xdr_NCvdata: Check 2.0\n"); -#endif if (elem_length > 0) { if (Hseek(vp->aid, where, DF_START) == FAIL) { ret_value = FAIL; goto done; } } - -#ifdef DEBUG - fprintf(stderr, "hdf_xdr_NCvdata after Hseek(), byte_count=%d\n", (int)byte_count); -#endif - } /* end else */ /* Read or write the data into / from values */ @@ -1329,9 +1207,6 @@ hdf_xdr_NCvdata(NC *handle, NC_var *vp, u_long where, nc_type type, uint32 count /* if we get here and the length is 0, we need to finish writing out the fill-values */ bytes_left = vp->len - (where + byte_count); -#ifdef DEBUG - fprintf(stderr, "hdf_xdr_NCvdata: bytes_left=%d\n", (int)bytes_left); -#endif if (elem_length <= 0 && bytes_left > 0) { if ((handle->flags & NC_NOFILL) == 0 || isspecial == SPECIAL_COMP) { int32 buf_size = bytes_left; @@ -1416,10 +1291,6 @@ hdf_xdr_NCvdata(NC *handle, NC_var *vp, u_long where, nc_type type, uint32 count } /* end if */ } /* end if */ -#ifdef DEBUG - fprintf(stderr, " * * * Done with call to xdr_NCvdata * * *\n"); -#endif - done: return ret_value; } /* hdf_xdr_NCvdata */ @@ -1467,13 +1338,6 @@ nssdc_xdr_NCvdata(NC *handle, NC_var *vp, u_long where, nc_type type, uint32 cou (void)type; (void)values; -#ifdef DEBUG - fprintf(stderr, "nssdc_xdr_NCvdata I've been called : %s\n", vp->name->values); - fprintf(stderr, "Where = %d count = %d\n", where, count); - fprintf(stderr, "nssdc_xdr_NCvdata I've been called : %s reading %d from %d\n", vp->name->values, count, - where); -#endif - /* position ourselves correctly */ status = HI_SEEK((hdf_file_t)handle->cdf_fp, where); if (status == FAIL) @@ -1484,20 +1348,10 @@ nssdc_xdr_NCvdata(NC *handle, NC_var *vp, u_long where, nc_type type, uint32 cou if (SDIresizebuf((void **)&tBuf, &tBuf_size, byte_count) == FAIL) return (FALSE); -#ifdef DEBUG - fprintf(stderr, "\tbyte_count %d vp->HDFsize %d\n", byte_count, vp->HDFsize); -#endif - -#ifdef DEBUG - fprintf(stderr, " * * * Done with call to nssdc_xdr_NCvdata * * *\n"); -#endif - return (TRUE); } /* nssdc_xdr_NCvdata */ -#endif /* HDF */ - static int NCvar1io(NC *handle, int varid, const long *coords, Void *value) { @@ -1515,7 +1369,6 @@ NCvar1io(NC *handle, int varid, const long *coords, Void *value) if (vp->assoc->count == 0) /* 'scaler' variable */ { -#ifdef HDF switch (handle->file_type) { case HDF_FILE: @@ -1526,9 +1379,6 @@ NCvar1io(NC *handle, int varid, const long *coords, Void *value) case netCDF_FILE: return (xdr_NCv1data(handle->xdrs, vp->begin, vp->type, value) ? 0 : -1); } -#else /* !HDF */ - return (xdr_NCv1data(handle->xdrs, vp->begin, vp->type, value) ? 0 : -1); -#endif /* !HDF */ } if (!NCcoordck(handle, vp, coords)) @@ -1536,13 +1386,6 @@ NCvar1io(NC *handle, int varid, const long *coords, Void *value) offset = NC_varoffset(handle, vp, coords); -#ifdef VDEBUG - NCadvise(NC_NOERR, "%s offset %d, numrecs %d", vp->name->values, offset, vp->numrecs); - arrayp("shape", vp->assoc->count, vp->shape); - arrayp("coords", vp->assoc->count, coords); -#endif /* VDEBUG */ - -#ifdef HDF switch (handle->file_type) { case HDF_FILE: if (FAIL == hdf_xdr_NCv1data(handle, vp, offset, vp->type, value)) @@ -1553,10 +1396,6 @@ NCvar1io(NC *handle, int varid, const long *coords, Void *value) return (-1); break; } -#else /* !HDF */ - if (!xdr_NCv1data(handle->xdrs, offset, vp->type, value)) - return (-1); -#endif /* !HDF */ return (0); } @@ -1756,15 +1595,10 @@ NCsimplerecio(NC *handle, NC_var *vp, const long *start, const long *edges, Void } offset = NC_varoffset(handle, vp, start); -#ifdef VDEBUG - fprintf(stderr, "\t\t %s offset %ld, *edges %lu\n", vp->name->values, offset, *edges); - arrayp("\t\t coords", vp->assoc->count, start); -#endif if (newrecs > 0) handle->flags |= NC_NDIRTY; -#ifdef HDF switch (handle->file_type) { case HDF_FILE: DFKsetNT(vp->HDFtype); @@ -1781,12 +1615,7 @@ NCsimplerecio(NC *handle, NC_var *vp, const long *start, const long *edges, Void return (-1); break; } -#else /* !HDF */ - if (!xdr_NCvdata(handle->xdrs, offset, vp->type, (unsigned)*edges, values)) - return (-1); -#endif /* !HDF */ -#ifdef HDF if (newrecs > 0) { /* Update var's numrecs first and then handle->numrecs if the first exceeds the latter (part of bugzilla 1378, i.e., JIRA HDFFR-167) @@ -1800,7 +1629,6 @@ NCsimplerecio(NC *handle, NC_var *vp, const long *start, const long *edges, Void handle->flags &= ~NC_NDIRTY; } } -#endif return (0); } @@ -1825,22 +1653,13 @@ NCvario(NC *handle, int varid, const long *start, const long *edges, void *value if (vp == NULL) return (-1); -#ifdef VDEBUG - fprintf(stderr, "Entering NCvario, variable %s\n", vp->name->values); - arrayp("start", vp->assoc->count, start); - arrayp("edges", vp->assoc->count, edges); -#endif /* VDEBUG */ - -#ifdef HDF if (handle->file_type != netCDF_FILE) { if (FAIL == DFKsetNT(vp->HDFtype)) return -1; } -#endif if (vp->assoc->count == 0) /* 'scaler' variable */ { -#ifdef HDF switch (handle->file_type) { case HDF_FILE: if (FAIL == hdf_xdr_NCv1data(handle, vp, vp->begin, vp->type, values)) @@ -1850,9 +1669,6 @@ NCvario(NC *handle, int varid, const long *start, const long *edges, void *value case netCDF_FILE: return (xdr_NCv1data(handle->xdrs, vp->begin, vp->type, values) ? 0 : -1); } -#else /* !HDF */ - return (xdr_NCv1data(handle->xdrs, vp->begin, vp->type, values) ? 0 : -1); -#endif /* !HDF */ } if (!NCcoordck(handle, vp, start)) @@ -1867,9 +1683,6 @@ NCvario(NC *handle, int varid, const long *start, const long *edges, void *value edp0 = NCvcmaxcontig(handle, vp, start, edges); if (edp0 == NULL) return (-1); -#ifdef VDEBUG - fprintf(stderr, "edp0\t%ld\n", (unsigned long)edp0 - (unsigned long)edges); -#endif /* VDEBUG */ /* now accumulate max count for a single io operation */ edp = edges + vp->assoc->count - 1; /* count is > 0 at this point */ @@ -1890,9 +1703,6 @@ NCvario(NC *handle, int varid, const long *start, const long *edges, void *value mm = start; while (cc < &coords[vp->assoc->count]) *cc++ = *mm++; -#ifdef VDEBUG - arrayp("coords", vp->assoc->count, coords); -#endif /* set up in maximum indices */ cc = upper; @@ -1900,33 +1710,18 @@ NCvario(NC *handle, int varid, const long *start, const long *edges, void *value edp = edges; while (cc < &upper[vp->assoc->count]) *cc++ = *mm++ + *edp++; -#ifdef VDEBUG - arrayp("upper", vp->assoc->count, upper); -#endif /* ripple counter */ cc = coords; mm = upper; while (*coords < *upper) { -#ifdef VDEBUG - fprintf(stderr, "\t*cc %ld, *mm %ld\n", *cc, *mm); -#endif /* VDEBUG */ while (*cc < *mm) { -#ifdef VDEBUG - fprintf(stderr, "\t\tedp0 %p, edges %p, mm %p, &upper[] %p\n", edp0, edges, mm, - &upper[edp0 - edges - 1]); -#endif /* VDEBUG */ if (edp0 == edges || mm == &upper[edp0 - edges - 1]) { /* doit */ if (!NCcoordck(handle, vp, coords)) return (-1); offset = NC_varoffset(handle, vp, coords); -#ifdef VDEBUG - fprintf(stderr, "\t\t %s offset %lu, iocount %lu\n", vp->name->values, offset, iocount); - arrayp("\t\t coords", vp->assoc->count, coords); -#endif -#ifdef HDF switch (handle->file_type) { case HDF_FILE: if (FAIL == @@ -1942,47 +1737,22 @@ NCvario(NC *handle, int varid, const long *start, const long *edges, void *value return (-1); break; } -#else /* !HDF */ - if (!xdr_NCvdata(handle->xdrs, offset, vp->type, (unsigned)iocount, values)) - return (-1); -#endif /* !HDF */ values = (void *)((const uint8 *)values + iocount * szof); (*cc) += (edp0 == edges ? iocount : 1); -#ifdef VDEBUG - fprintf(stderr, "\t\t *cc %ld, *mm %ld continue\n", *cc, *mm); -#endif /* VDEBUG */ continue; } cc++; mm++; -#ifdef VDEBUG - fprintf(stderr, "\t\t*cc %ld, *mm %ld\n", *cc, *mm); -#endif /* VDEBUG */ } -#ifdef VDEBUG - fprintf(stderr, "\tcc %p, coords %p\n", cc, coords); -#endif /* VDEBUG */ if (cc == coords) { -#ifdef VDEBUG - fprintf(stderr, "\t break\n"); -#endif /* VDEBUG */ break; } *cc = start[cc - coords]; cc--; mm--; (*cc)++; -#ifdef VDEBUG - fprintf(stderr, "\t*coords %ld, *upper %ld\n", *coords, *upper); -#endif } -#ifdef VDEBUG - arrayp("coords", vp->assoc->count, coords); - arrayp("upper", vp->assoc->count, upper); - fprintf(stderr, "vp->numrecs=%d\n", vp->numrecs); - fprintf(stderr, "upper[0]=%d\n", upper[0]); -#endif /* * This is a kludge to work around the fact the NCcoordck() doesn't * get the upper limits on the slab to write out -QAK @@ -2002,9 +1772,6 @@ NCvario(NC *handle, int varid, const long *start, const long *edges, void *value handle->numrecs = vp->numrecs; #endif -#ifdef VDEBUG - fprintf(stderr, "Exiting NCvario\n"); -#endif return (0); } @@ -2228,7 +1995,6 @@ NCrecio(NC *handle, long recnum, Void **datap) offset = NC_varoffset(handle, rvp[ii], coords); iocount = NCelemsPerRec(rvp[ii]); -#ifdef HDF switch (handle->file_type) { case HDF_FILE: DFKsetNT(rvp[ii]->HDFtype); @@ -2246,10 +2012,6 @@ NCrecio(NC *handle, long recnum, Void **datap) return (-1); break; } -#else /* !HDF */ - if (!xdr_NCvdata(handle->xdrs, offset, rvp[ii]->type, iocount, datap[ii])) - return (-1); -#endif /* !HDF */ } return 0; } diff --git a/mfhdf/libsrc/putgetg.c b/mfhdf/libsrc/putgetg.c index c288a4b708..8c31c6012f 100644 --- a/mfhdf/libsrc/putgetg.c +++ b/mfhdf/libsrc/putgetg.c @@ -33,12 +33,9 @@ /* count - NULL => everything following start[] */ /* stride - NULL => unity strides */ /* imap - NULL => same structure as netCDF variable */ -#ifndef HDF -static -#endif - int - NCgenio(NC *handle, int varid, const long *start, const long *count, const long *stride, const long *imap, - void *values) +int +NCgenio(NC *handle, int varid, const long *start, const long *count, const long *stride, const long *imap, + void *values) { int maxidim; /* maximum dimensional index */ NC_var *vp = NC_hlookupvar(handle, varid); diff --git a/mfhdf/libsrc/sharray.c b/mfhdf/libsrc/sharray.c index b200ed05f5..87198814b2 100644 --- a/mfhdf/libsrc/sharray.c +++ b/mfhdf/libsrc/sharray.c @@ -30,9 +30,6 @@ NCxdr_shortsb(XDR *xdrs, short *sp, u_int nshorts) unsigned char *cp; unsigned int nbytes = nshorts * 2; - /* assert(nshorts <= NC_NSHRTS_PER) ; */ - /* assert(nshorts > 0) ; */ - if (xdrs->x_op == XDR_ENCODE) { for (cp = buf; cp < &buf[nbytes]; sp++, cp += 2) { *(cp + 1) = *sp % 256; diff --git a/mfhdf/libsrc/string.c b/mfhdf/libsrc/string.c index 71c3ed4976..838213aeda 100644 --- a/mfhdf/libsrc/string.c +++ b/mfhdf/libsrc/string.c @@ -17,7 +17,6 @@ #include #include "local_nc.h" -#ifdef HDF static uint32 compute_hash(unsigned count, const char *str) { @@ -42,7 +41,6 @@ compute_hash(unsigned count, const char *str) } /* end if */ return (ret); } /* end compute_hash() */ -#endif /* HDF */ NC_string * NC_new_string(unsigned count, const char *str) @@ -61,9 +59,7 @@ NC_new_string(unsigned count, const char *str) goto alloc_err; ret->count = count; ret->len = count; -#ifdef HDF - ret->hash = compute_hash(count, str); -#endif /* HDF */ + ret->hash = compute_hash(count, str); if (count != 0) /* allocate */ { memlen = count + 1; @@ -71,11 +67,7 @@ NC_new_string(unsigned count, const char *str) if (ret->values == NULL) goto alloc_err; if (str != NULL) { -#ifdef HDF memcpy(ret->values, str, (size_t)count); -#else - (void)strncpy(ret->values, str, count); -#endif ret->values[count] = 0; } } @@ -120,10 +112,8 @@ NC_re_string(NC_string *old, unsigned count, const char *str) (void)memset(old->values + count, 0, (int)old->count - (int)count + 1); /* make sure len is always == to the string length */ - old->len = count; -#ifdef HDF + old->len = count; old->hash = compute_hash(count, str); -#endif /* HDF */ return (old); } diff --git a/mfhdf/libsrc/var.c b/mfhdf/libsrc/var.c index b17e2ed772..f7a3bac353 100644 --- a/mfhdf/libsrc/var.c +++ b/mfhdf/libsrc/var.c @@ -17,10 +17,6 @@ #include #include "local_nc.h" -#ifdef NOT_USED -static int ncvarcpy(int, int, int); -#endif /* NOT_USED */ - NC_var * NC_new_var(const char *name, nc_type type, int ndims, const int *dims) { @@ -46,7 +42,6 @@ NC_new_var(const char *name, nc_type type, int ndims, const int *dims) ret->szof = NC_typelen(type); ret->begin = 0; -#ifdef HDF ret->vgid = 0; ret->data_ref = 0; ret->data_tag = DATA_TAG; /* Assume normal data unless set */ @@ -61,7 +56,6 @@ NC_new_var(const char *name, nc_type type, int ndims, const int *dims) ret->is_ragged = FALSE; ret->created = FALSE; /* This is set in SDcreate() if it's a new SDS */ ret->set_length = FALSE; /* This is set in SDwritedata() if the data needs its length set */ -#endif return (ret); alloc_err: @@ -107,11 +101,8 @@ NC_free_var(NC_var *var) * 'compile' the shape and len of a variable * return -1 on error */ -#ifndef HDF -static -#endif - int - NC_var_shape(NC_var *var, NC_array *dims) +int +NC_var_shape(NC_var *var, NC_array *dims) { unsigned long *shape, *dsizes; int ii; @@ -120,11 +111,7 @@ static NC_dim **dp; size_t xszof; -#ifdef HDF xszof = var->HDFsize; -#else - xszof = NC_xtypelen(var->type); -#endif /* Fixed memory leaks reported in bug# 418. BMR - Apr 8, 01 */ @@ -202,10 +189,8 @@ static } out: -/* don't round-up for HDF-encoded files */ -#ifdef HDF + /* don't round-up for HDF-encoded files */ if (var->cdf->file_type != HDF_FILE) -#endif switch (var->type) { case NC_BYTE: @@ -286,13 +271,9 @@ ncvardef(int cdfid, const char *name, nc_type type, int ndims, const int dims[]) if (NC_incr_array(handle->vars, (Void *)var) == NULL) return (-1); } -#ifdef HDF (*var)->cdf = handle; /* for NC_var_shape */ -#endif if (NC_var_shape(*var, handle->dims) != -1) { -#ifdef HDF (*var)->ndg_ref = Hnewref(handle->hdf_file); -#endif return (handle->vars->count - 1); } /* unwind */ @@ -319,9 +300,7 @@ NC_computeshapes(NC *handle) return (0); vbase = (NC_var **)handle->vars->values; for (vpp = vbase; vpp < &vbase[handle->vars->count]; vpp++) { -#ifdef HDF (*vpp)->cdf = handle; -#endif if (NC_var_shape(*vpp, handle->dims) == -1) return (-1); @@ -421,11 +400,7 @@ ncvarinq(int cdfid, int varid, char *name, nc_type *typep, int *ndimsp, int dims return (-1); if (name != NULL) { -#ifdef HDF (void)memcpy(name, vp->name->values, vp->name->len); -#else - (void)strncpy(name, vp->name->values, vp->name->len); -#endif name[vp->name->len] = 0; } @@ -515,182 +490,6 @@ ncvarrename(int cdfid, int varid, const char *newname) return (varid); } -#ifdef NOT_USED -/* - * Given valid handle, name string, and length of the name, get a var. - * else NULL on error - */ -static NC_var * -NC_hvarid(NC *handle, const char *name, int namelen) -{ - NC_var **dp; - int ii; - if (handle->vars == NULL) - return NULL; - dp = (NC_var **)handle->vars->values; - for (ii = 0; ii < handle->vars->count; ii++, dp++) { - if (namelen == (*dp)->name->len && strncmp(name, (*dp)->name->values, namelen) == 0) { - return (*dp); /* normal exit */ - } - } - return NULL; /* not found */ -} - -/* - * Copy the values of a variable from an input netCDF to an output netCDF. - * Input and output var assumed to have the same shape. - * return -1 on error. - * - * This function added to support the netcdf operators. The interface - * is not documented. We plan to supersede it with something more - * general in a future release. - */ -static int -ncvarcpy(int incdf, int varid, int outcdf) -{ - NC *inhandle, *outhandle; - NC_var *invp, *outvp; - int ndims; - int ii; - - cdf_routine_name = "ncvarcpy"; - - inhandle = NC_check_id(incdf); - if (inhandle == NULL) - return (-1); - - if (inhandle->flags & NC_INDEF) { - NCadvise(NC_EINDEFINE, "%s in define mode.", inhandle->path); - return (-1); - } - - outhandle = NC_check_id(outcdf); - if (outhandle == NULL) - return (-1); - - if (!(outhandle->flags & NC_RDWR)) { - /* output file isn't writable */ - NCadvise(NC_EPERM, "%s is not writable", outhandle->path); - return -1; - } - - if (outhandle->flags & NC_INDEF) { - NCadvise(NC_EINDEFINE, "%s in define mode.", outhandle->path); - return (-1); - } - - /* find the variable in the input cdf */ - if (inhandle->vars == NULL || (invp = NC_hlookupvar(inhandle, varid)) == NULL) { - NCadvise(NC_ENOTVAR, "%s: varid %d not found", inhandle->path, varid); - return (-1); - } - - /* find the variable in the output cdf */ - outvp = NC_hvarid(outhandle, invp->name->values, invp->name->len); - if (outvp == NULL) { - NCadvise(NC_ENOTVAR, "%s: variable %s not found", outhandle->path, invp->name->values); - return (-1); - } - - /* can we even attempt to copy without conversion? */ - if (outvp->type != invp->type) { - NCadvise(NC_EINVAL, "Input and output variables must be same type"); - return -1; - } - - ndims = invp->assoc->count; - - if (ndims == 0) { - /* special case scalar vars */ - if (outvp->assoc->count != 0) { - NCadvise(NC_EINVAL, "Input and output variables must be same shape"); - return -1; - } - } - else { - long end[H4_MAX_VAR_DIMS]; - memcpy(end, invp->shape, ndims * sizeof(unsigned long)); - if (IS_RECVAR(invp)) { - /* assert(*end == 0) ; */ - *end = inhandle->numrecs; - } - - for (ii = 0; ii < ndims; ii++) - end[ii]--; - /* at this point, end is the largest valid coord of invp */ - if (!NCcoordck(outhandle, outvp, end)) { - NCadvise(NC_EINVAL, "Input and output variables not conformable"); - return -1; - } - /* Fill is side effect of NCcoordck */ - } - - /* four cases, really not necessary here, left for future generalization */ - if (IS_RECVAR(invp)) { - if (IS_RECVAR(outvp)) { - long outoff, inoff; - /* both input and output are rec vars */ - /* check that input fits in output. (per record) */ - if (invp->len > outvp->len) { - NCadvise(NC_EINVALCOORDS, "Output var smaller than input"); - return -1; - } - /* copy the data */ - outoff = outhandle->begin_rec + outvp->begin; - inoff = inhandle->begin_rec + invp->begin; - outhandle->flags |= NC_NDIRTY; - for (ii = 0; ii < inhandle->numrecs; ii++) { - if (!xdr_setpos(outhandle->xdrs, outoff)) { - NCadvise(NC_EXDR, "%s: xdr_setpos", outhandle->path); - return -1; - } - if (!xdr_setpos(inhandle->xdrs, inoff)) { - NCadvise(NC_EXDR, "%s: xdr_setpos", inhandle->path); - return -1; - } - /* copy data */ - if (!NC_dcpy(outhandle->xdrs, inhandle->xdrs, invp->len)) - return (-1); - outoff += outhandle->recsize; - inoff += inhandle->recsize; - } - } - else { - NCadvise(NC_EINVAL, "Input and output variables must be same shape"); - return -1; - } - } - else { - if (IS_RECVAR(outvp)) { - /* input not rec var, output is rec var */ - NCadvise(NC_EINVAL, "Input and output variables must be same shape"); - return -1; - } - else { - /* both input and output are not rec vars */ - /* check that input fits in output. */ - if (invp->len > outvp->len) { - NCadvise(NC_EINVALCOORDS, "Output var smaller than input"); - return -1; - } - if (!xdr_setpos(outhandle->xdrs, outvp->begin)) { - NCadvise(NC_EXDR, "%s: xdr_setpos", outhandle->path); - return -1; - } - if (!xdr_setpos(inhandle->xdrs, invp->begin)) { - NCadvise(NC_EXDR, "%s: xdr_setpos", inhandle->path); - return -1; - } - /* copy data */ - outhandle->flags |= NC_NDIRTY; - if (!NC_dcpy(outhandle->xdrs, inhandle->xdrs, invp->len)) - return (-1); - } - } - return 0; -} -#endif /* NOT_USED */ - bool_t xdr_NC_var(XDR *xdrs, NC_var **vpp) { @@ -738,8 +537,6 @@ xdr_NC_var(XDR *xdrs, NC_var **vpp) if (xdrs->x_op == XDR_DECODE) (*vpp)->begin = begin; -#ifdef HDF - if (xdrs->x_op == XDR_DECODE) { (*vpp)->HDFtype = hdf_map_type((*vpp)->type); @@ -748,8 +545,6 @@ xdr_NC_var(XDR *xdrs, NC_var **vpp) (*vpp)->is_ragged = FALSE; } -#endif - return (TRUE); } diff --git a/mfhdf/ncdump/ncdump.c b/mfhdf/ncdump/ncdump.c index 008caed962..c1170aa512 100644 --- a/mfhdf/ncdump/ncdump.c +++ b/mfhdf/ncdump/ncdump.c @@ -475,7 +475,6 @@ do_ncdump(char *path, struct fspec *specp) * or if it is a record variable and at least one record has * been written. */ -#ifdef HDF /* skip the dimension vars which have dim strings only. */ { NC *handle; @@ -495,7 +494,6 @@ do_ncdump(char *path, struct fspec *specp) } } -#endif /* HDF */ if (isempty) continue; diff --git a/mfhdf/nctest/add.c b/mfhdf/nctest/add.c index 55ab798df9..46600fef4e 100644 --- a/mfhdf/nctest/add.c +++ b/mfhdf/nctest/add.c @@ -20,9 +20,7 @@ #include "testcdf.h" #include "add.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif struct netcdf test; /* * in-memory netcdf structure, kept in sync diff --git a/mfhdf/nctest/atttests.c b/mfhdf/nctest/atttests.c index e751213948..fea8d3c2b2 100644 --- a/mfhdf/nctest/atttests.c +++ b/mfhdf/nctest/atttests.c @@ -19,9 +19,7 @@ #include "emalloc.h" #include "tests.h" #include "val.h" -#ifdef HDF #include "hdf.h" -#endif #define LEN_OF(array) ((sizeof array) / (sizeof array[0])) diff --git a/mfhdf/nctest/cdftests.c b/mfhdf/nctest/cdftests.c index 70c32fe7c5..c68c34e60d 100644 --- a/mfhdf/nctest/cdftests.c +++ b/mfhdf/nctest/cdftests.c @@ -18,9 +18,7 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif #define LEN_OF(array) ((sizeof array) / (sizeof array[0])) diff --git a/mfhdf/nctest/dimtests.c b/mfhdf/nctest/dimtests.c index 08d31179e2..a8b771c7d6 100644 --- a/mfhdf/nctest/dimtests.c +++ b/mfhdf/nctest/dimtests.c @@ -18,9 +18,7 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif /* * Test ncdimdef diff --git a/mfhdf/nctest/error.h b/mfhdf/nctest/error.h index 17b44067c7..a13832d07f 100644 --- a/mfhdf/nctest/error.h +++ b/mfhdf/nctest/error.h @@ -6,9 +6,7 @@ #ifndef NCTEST_ERROR_H #define NCTEST_ERROR_H -#ifdef HDF #include "hdf.h" -#endif #ifdef __cplusplus extern "C" { diff --git a/mfhdf/nctest/rec.c b/mfhdf/nctest/rec.c index 3ddd4976ef..e34a9e6347 100644 --- a/mfhdf/nctest/rec.c +++ b/mfhdf/nctest/rec.c @@ -17,9 +17,7 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif #define VARS 100 diff --git a/mfhdf/nctest/slabs.c b/mfhdf/nctest/slabs.c index 77c80d43da..c9ab7bfa90 100644 --- a/mfhdf/nctest/slabs.c +++ b/mfhdf/nctest/slabs.c @@ -15,9 +15,7 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif #define LEN_OF(array) ((sizeof array) / (sizeof array[0])) /* dimension sizes */ diff --git a/mfhdf/nctest/testcdf.h b/mfhdf/nctest/testcdf.h index 4fd71a6ca9..ce43d9f047 100644 --- a/mfhdf/nctest/testcdf.h +++ b/mfhdf/nctest/testcdf.h @@ -14,9 +14,7 @@ */ #include -#ifdef HDF #include "mfhdf.h" -#endif #define ___ 0 /* marker for structure place-holder */ #define BAD_TYPE NC_UNSPECIFIED /* must be distinct from valid types */ diff --git a/mfhdf/nctest/vardef.c b/mfhdf/nctest/vardef.c index 69b5e8b81f..a8774f60c1 100644 --- a/mfhdf/nctest/vardef.c +++ b/mfhdf/nctest/vardef.c @@ -19,15 +19,11 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif #define LEN_OF(array) ((sizeof array) / (sizeof array[0])) -#ifdef HDF -#define EPS64 ((float64)1.0E-14) -#define EPS32 ((float32)1.0E-7) -#endif +#define EPS64 ((float64)1.0E-14) +#define EPS32 ((float32)1.0E-7) /* * Test ncvardef @@ -239,12 +235,7 @@ test_ncvardef(char *path) case NC_FLOAT: { float val, fillval = FILL_FLOAT; if (ncvarget1(cdfid, va_id[iv], where, (void *)&val) != -1) { -#ifdef HDF - if (fabs((double)(val - fillval)) > fabs((double)(fillval * EPS32))) -#else /*!HDF */ - if (val != fillval) -#endif - { + if (fabs((double)(val - fillval)) > fabs((double)(fillval * EPS32))) { error("%s: unwritten float not FILL_FLOAT", pname); nerrs++; } @@ -257,12 +248,7 @@ test_ncvardef(char *path) case NC_DOUBLE: { double val, fillval = FILL_DOUBLE; if (ncvarget1(cdfid, va_id[iv], where, (void *)&val) != -1) { -#ifdef HDF - if (fabs((double)(val - fillval)) > fabs((double)(fillval * EPS64))) -#else /* !HDF */ - if (val != fillval) -#endif /* !HDF */ - { + if (fabs((double)(val - fillval)) > fabs((double)(fillval * EPS64))) { error("%s: unwritten double not FILL_DOUBLE", pname); nerrs++; } diff --git a/mfhdf/nctest/varget.c b/mfhdf/nctest/varget.c index 3f89f38ad3..b534de5a51 100644 --- a/mfhdf/nctest/varget.c +++ b/mfhdf/nctest/varget.c @@ -17,9 +17,7 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif /* * Test ncvarget diff --git a/mfhdf/nctest/varget_unlim.c b/mfhdf/nctest/varget_unlim.c index 7223e71cdd..f11866a003 100644 --- a/mfhdf/nctest/varget_unlim.c +++ b/mfhdf/nctest/varget_unlim.c @@ -17,9 +17,7 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif float a_val[2][3] = {{1.0, 2.0, 3.0}, {4.0, 5.0, 6.0}}; int date_val[12] = {840116, 840214, 840316, 840415, 840516, 840615, diff --git a/mfhdf/nctest/vargetg.c b/mfhdf/nctest/vargetg.c index ef326e658e..a460294883 100644 --- a/mfhdf/nctest/vargetg.c +++ b/mfhdf/nctest/vargetg.c @@ -17,9 +17,7 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif /* * Test ncvargetg diff --git a/mfhdf/nctest/varput.c b/mfhdf/nctest/varput.c index 23f17cb2be..9d8303913d 100644 --- a/mfhdf/nctest/varput.c +++ b/mfhdf/nctest/varput.c @@ -18,9 +18,7 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif /* * Test ncvarput diff --git a/mfhdf/nctest/varputg.c b/mfhdf/nctest/varputg.c index ea85b823df..e479126ddc 100644 --- a/mfhdf/nctest/varputg.c +++ b/mfhdf/nctest/varputg.c @@ -18,9 +18,7 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif /* * Test ncvarputg diff --git a/mfhdf/nctest/vartests.c b/mfhdf/nctest/vartests.c index c8e8040c9f..82ae67a039 100644 --- a/mfhdf/nctest/vartests.c +++ b/mfhdf/nctest/vartests.c @@ -18,9 +18,7 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif #define LEN_OF(array) ((sizeof array) / (sizeof array[0])) #define min(A, B) ((A) < (B) ? (A) : (B)) diff --git a/mfhdf/nctest/vputget.c b/mfhdf/nctest/vputget.c index 88e2fa8d70..ea2d34495b 100644 --- a/mfhdf/nctest/vputget.c +++ b/mfhdf/nctest/vputget.c @@ -19,9 +19,7 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif #define max(A, B) ((A) > (B) ? (A) : (B)) diff --git a/mfhdf/nctest/vputgetg.c b/mfhdf/nctest/vputgetg.c index b932b362a1..171efb1910 100644 --- a/mfhdf/nctest/vputgetg.c +++ b/mfhdf/nctest/vputgetg.c @@ -19,9 +19,7 @@ #include "error.h" #include "tests.h" #include "emalloc.h" -#ifdef HDF #include "hdf.h" -#endif #define max(A, B) ((A) > (B) ? (A) : (B)) diff --git a/mfhdf/test/cdftest.c b/mfhdf/test/cdftest.c index 444daaf12d..71ca45ed1f 100644 --- a/mfhdf/test/cdftest.c +++ b/mfhdf/test/cdftest.c @@ -39,9 +39,7 @@ static char mrcsid[] = "Id: cdftest.c,v 1.11 1994/01/10 23:07:27 chouck Exp "; #include "hdf4_netcdf.h" #endif -#ifdef HDF #include "hdf.h" -#endif #define cdf_assert(ex) \ { \ diff --git a/mfhdf/test/gen_sds_szipped.c b/mfhdf/test/gen_sds_szipped.c index 191570361b..d030a15d2b 100644 --- a/mfhdf/test/gen_sds_szipped.c +++ b/mfhdf/test/gen_sds_szipped.c @@ -29,8 +29,6 @@ #include "szlib.h" #endif -#ifdef HDF - #include "hdftest.h" #define FILE_NAME "sds_szipped.dat" @@ -113,5 +111,3 @@ main() /* Return the number of errors that's been kept track of so far */ return num_errs; } /* main */ - -#endif /* HDF */ diff --git a/mfhdf/test/hdftest.c b/mfhdf/test/hdftest.c index a6a8597ca7..42e46be4a9 100644 --- a/mfhdf/test/hdftest.c +++ b/mfhdf/test/hdftest.c @@ -13,8 +13,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" #define UFOFILE "file.UFO" /* non-existing file */ @@ -1345,5 +1343,3 @@ main(void) return EXIT_FAILURE; } } - -#endif /* HDF */ diff --git a/mfhdf/test/tattributes.c b/mfhdf/test/tattributes.c index 5230587948..8f1ced6a43 100644 --- a/mfhdf/test/tattributes.c +++ b/mfhdf/test/tattributes.c @@ -23,8 +23,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" /******************************************************************** @@ -279,5 +277,3 @@ test_attributes() return num_errs; } - -#endif /* HDF */ diff --git a/mfhdf/test/tchunk.c b/mfhdf/test/tchunk.c index 5e381fce53..cbb09669f5 100644 --- a/mfhdf/test/tchunk.c +++ b/mfhdf/test/tchunk.c @@ -13,8 +13,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" #define CHKFILE "chktst.hdf" /* Chunking test file */ @@ -1383,4 +1381,3 @@ test_chunk() done: return num_errs; } /* test_chunk() */ -#endif /* HDF */ diff --git a/mfhdf/test/tcomp.c b/mfhdf/test/tcomp.c index 5c1b6a5b74..e72e5d4d45 100644 --- a/mfhdf/test/tcomp.c +++ b/mfhdf/test/tcomp.c @@ -22,8 +22,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" /******************************************************************** @@ -847,5 +845,3 @@ test_compression() return num_errs; } - -#endif /* HDF */ diff --git a/mfhdf/test/tcoordvar.c b/mfhdf/test/tcoordvar.c index f58c56e1d5..f7d2601fbe 100644 --- a/mfhdf/test/tcoordvar.c +++ b/mfhdf/test/tcoordvar.c @@ -34,8 +34,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" /******************************************************************** @@ -636,5 +634,3 @@ test_coordvar() return num_errs; } - -#endif /* HDF */ diff --git a/mfhdf/test/tdatasizes.c b/mfhdf/test/tdatasizes.c index a99da03d94..4ed227b5c9 100644 --- a/mfhdf/test/tdatasizes.c +++ b/mfhdf/test/tdatasizes.c @@ -29,8 +29,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" #define FILE_NAME "datasizes.hdf" /* data file to test empty SDSs */ @@ -634,5 +632,3 @@ test_datasizes() PASSED(); return num_errs; } - -#endif /* HDF */ diff --git a/mfhdf/test/tdim.c b/mfhdf/test/tdim.c index 35e5d5da0e..464292eee0 100644 --- a/mfhdf/test/tdim.c +++ b/mfhdf/test/tdim.c @@ -22,7 +22,6 @@ #include "mfhdf.h" -#ifdef HDF #include "hdftest.h" /******************************************************************** @@ -774,5 +773,3 @@ test_dimensions() PASSED(); return num_errs; } - -#endif /* HDF */ diff --git a/mfhdf/test/temptySDSs.c b/mfhdf/test/temptySDSs.c index 58c5316258..dc47884ea7 100644 --- a/mfhdf/test/temptySDSs.c +++ b/mfhdf/test/temptySDSs.c @@ -30,8 +30,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" #define FILE_NAME "emptySDSs.hdf" /* data file to test empty SDSs */ @@ -565,5 +563,3 @@ test_checkempty() PASSED(); return num_errs; } - -#endif /* HDF */ diff --git a/mfhdf/test/texternal.c b/mfhdf/test/texternal.c index 7976493de9..f3df772037 100644 --- a/mfhdf/test/texternal.c +++ b/mfhdf/test/texternal.c @@ -13,8 +13,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" #define EXTTST "exttst.hdf" /* main file for external file test */ @@ -1101,4 +1099,3 @@ verify_data(int32 sd_id, int32 sds_ind) CHECK(status, FAIL, "SDendaccess"); } /* verify_data */ -#endif /* HDF */ diff --git a/mfhdf/test/tfile.c b/mfhdf/test/tfile.c index b6ffbc7722..973683e98c 100644 --- a/mfhdf/test/tfile.c +++ b/mfhdf/test/tfile.c @@ -13,8 +13,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" #include "local_nc.h" @@ -452,5 +450,3 @@ test_files() PASSED(); return num_errs; } - -#endif /* HDF */ diff --git a/mfhdf/test/tmixed_apis.c b/mfhdf/test/tmixed_apis.c index 613e538e46..bc6c9bbd05 100644 --- a/mfhdf/test/tmixed_apis.c +++ b/mfhdf/test/tmixed_apis.c @@ -27,8 +27,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" #define IDTYPE_FILE "idtypes.hdf" /* data file to test ID types */ @@ -556,5 +554,3 @@ test_mixed_apis() PASSED(); return num_errs; } - -#endif /* HDF */ diff --git a/mfhdf/test/tnetcdf.c b/mfhdf/test/tnetcdf.c index 931bdea096..6c56ed34e5 100644 --- a/mfhdf/test/tnetcdf.c +++ b/mfhdf/test/tnetcdf.c @@ -13,8 +13,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" #define NETCDF_READ_TEST @@ -242,5 +240,3 @@ test_netcdf_reading() return num_errs; } /* test_netcdf_reading() */ #endif /* NETCDF_READ_TEST */ - -#endif /* HDF */ diff --git a/mfhdf/test/trank0.c b/mfhdf/test/trank0.c index a1bd9a96bd..1396194942 100644 --- a/mfhdf/test/trank0.c +++ b/mfhdf/test/trank0.c @@ -20,8 +20,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" #define FILE_NAME "trank0.hdf" /* data file to test for rank=0 */ @@ -158,5 +156,3 @@ test_rank0() PASSED(); return num_errs; } - -#endif /* HDF */ diff --git a/mfhdf/test/tsd.c b/mfhdf/test/tsd.c index 2169f9974e..c3a14a838d 100644 --- a/mfhdf/test/tsd.c +++ b/mfhdf/test/tsd.c @@ -17,8 +17,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" #include "hfile.h" @@ -84,4 +82,3 @@ test_sd() PASSED(); return num_errs; } /* test_SDAPI_ids */ -#endif /* HDF */ diff --git a/mfhdf/test/tsdsprops.c b/mfhdf/test/tsdsprops.c index 0bdec353f3..443c3afa43 100644 --- a/mfhdf/test/tsdsprops.c +++ b/mfhdf/test/tsdsprops.c @@ -30,8 +30,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" /*************************************************************************** @@ -763,5 +761,3 @@ test_SDSprops() PASSED(); return num_errs; } - -#endif /* HDF */ diff --git a/mfhdf/test/tutils.c b/mfhdf/test/tutils.c index 9e9d65e992..bc65bcf244 100644 --- a/mfhdf/test/tutils.c +++ b/mfhdf/test/tutils.c @@ -13,8 +13,6 @@ #include "mfhdf.h" -#ifdef HDF - #include "hdftest.h" /******************************************************************** @@ -382,5 +380,3 @@ verify_datasize(int32 sds_id, int32 data_size, char *sds_name) VERIFY(data_size, uncomp_size, msg); } /* verify_datasize */ - -#endif /* HDF */