diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 35f4de9beb..bfa8c58c81 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,6 +7,7 @@ This file contains a high-level description of this package's evolution. Release ## 4.9.3 - TBD +* Refactor macro `_FillValue` to `NC_FillValue` to avoid conflict with libc++ headers. See [Github #2858](https://github.com/Unidata/netcdf-c/issues/2858) for more information. * Changed `cmake` build options to be prefaced with `NETCDF`, to bring things in to line with best practices. This will permit a number of overall quality of life improvements to netCDF, in terms of allowing it to be more easily integrated with upstream projects via `FetchContent()`, `subdirectory()`, etc. Currently, the naming convention in use thus far will still work, but will result in warning messages about deprecation, and instructions on how to update your workflow. See [Github #2895](https://github.com/Unidata/netcdf-c/pull/2895) for more information. * Fix some problems in handling S3 urls with missing regions. See [Github #2819](https://github.com/Unidata/netcdf-c/pull/2819). * Incorporate a more modern look and feel to user documentation generated by Doxygen. See [Doxygen Awesome CSS](https://github.com/jothepro/doxygen-awesome-css) and [Github #2864](https://github.com/Unidata/netcdf-c/pull/2864) for more information. diff --git a/include/netcdf.h b/include/netcdf.h index d29a134558..5b856d2799 100644 --- a/include/netcdf.h +++ b/include/netcdf.h @@ -110,7 +110,7 @@ extern "C" { * the same type as the variable and this reserved name. The value you * give the attribute will be used as the fill value for that * variable. */ -#define _FillValue "_FillValue" +#define NC_FillValue "_FillValue" #define NC_FILL 0 /**< Argument to nc_set_fill() to clear NC_NOFILL */ #define NC_NOFILL 0x100 /**< Argument to nc_set_fill() to turn off filling of data. */ diff --git a/libhdf5/hdf5attr.c b/libhdf5/hdf5attr.c index 795bce81f9..e8c80fc174 100644 --- a/libhdf5/hdf5attr.c +++ b/libhdf5/hdf5attr.c @@ -564,7 +564,7 @@ nc4_put_att(NC_GRP_INFO_T* grp, int varid, const char *name, nc_type file_type, * Since fill mismatch is no longer required, we need to convert the * att's type to the vars's type as part of storing. */ - if (!strcmp(att->hdr.name, _FillValue) && varid != NC_GLOBAL) + if (!strcmp(att->hdr.name, NC_FillValue) && varid != NC_GLOBAL) { /* Fill value must have exactly one value */ if (len != 1) diff --git a/libhdf5/hdf5var.c b/libhdf5/hdf5var.c index aaf48140e9..4ba7fa5cfb 100644 --- a/libhdf5/hdf5var.c +++ b/libhdf5/hdf5var.c @@ -673,17 +673,17 @@ nc_def_var_extra(int ncid, int varid, int *shuffle, int *unused1, var->hdr.name)); /* If there's a _FillValue attribute, delete it. */ - retval = NC4_HDF5_del_att(ncid, varid, _FillValue); + retval = NC4_HDF5_del_att(ncid, varid, NC_FillValue); if (retval && retval != NC_ENOTATT) return retval; /* Create a _FillValue attribute; will also fill in var->fill_value */ - if ((retval = nc_put_att(ncid, varid, _FillValue, var->type_info->hdr.id, + if ((retval = nc_put_att(ncid, varid, NC_FillValue, var->type_info->hdr.id, 1, fill_value))) return retval; } else if (var->fill_value && no_fill && (*no_fill)) { /* Turning off fill value? */ /* If there's a _FillValue attribute, delete it. */ - retval = NC4_HDF5_del_att(ncid, varid, _FillValue); + retval = NC4_HDF5_del_att(ncid, varid, NC_FillValue); if (retval && retval != NC_ENOTATT) return retval; if((retval = NC_reclaim_data_all(h5->controller,var->type_info->hdr.id,var->fill_value,1))) return retval; var->fill_value = NULL; diff --git a/libnczarr/zattr.c b/libnczarr/zattr.c index 23fbb04281..29d8e693fb 100644 --- a/libnczarr/zattr.c +++ b/libnczarr/zattr.c @@ -581,7 +581,7 @@ ncz_put_att(NC_GRP_INFO_T* grp, int varid, const char *name, nc_type file_type, * copy the value to the fill_value pointer of the NC_VAR_INFO_T * struct for this var. (But ignore a global _FillValue * attribute). Also kill the cache fillchunk as no longer valid */ - if (!strcmp(att->hdr.name, _FillValue) && varid != NC_GLOBAL) + if (!strcmp(att->hdr.name, NC_FillValue) && varid != NC_GLOBAL) { /* Fill value must have exactly one value */ if (len != 1) @@ -991,12 +991,12 @@ ncz_create_fillvalue(NC_VAR_INFO_T* var) /* Make sure _FillValue does not exist */ for(i=0;iatt);i++) { fv = (NC_ATT_INFO_T*)ncindexith(var->att,i); - if(strcmp(fv->hdr.name,_FillValue)==0) break; + if(strcmp(fv->hdr.name,NC_FillValue)==0) break; fv = NULL; } if(fv == NULL) { /* Create it */ - if((stat = ncz_makeattr((NC_OBJ*)var,var->att,_FillValue,var->type_info->hdr.id,1,var->fill_value,&fv))) + if((stat = ncz_makeattr((NC_OBJ*)var,var->att,NC_FillValue,var->type_info->hdr.id,1,var->fill_value,&fv))) goto done; } } diff --git a/libnczarr/zvar.c b/libnczarr/zvar.c index b10df70c02..eb26eb7eda 100644 --- a/libnczarr/zvar.c +++ b/libnczarr/zvar.c @@ -727,19 +727,19 @@ ncz_def_var_extra(int ncid, int varid, int *shuffle, int *unused1, var->hdr.name)); /* If there's a _FillValue attribute, delete it. */ - retval = NCZ_del_att(ncid, varid, _FillValue); + retval = NCZ_del_att(ncid, varid, NC_FillValue); if (retval && retval != NC_ENOTATT) goto done; /* Create a _FillValue attribute; will also fill in var->fill_value */ - if ((retval = nc_put_att(ncid, varid, _FillValue, var->type_info->hdr.id, + if ((retval = nc_put_att(ncid, varid, NC_FillValue, var->type_info->hdr.id, 1, fill_value))) goto done; /* Reclaim any existing fill_chunk */ if((retval = NCZ_reclaim_fill_chunk(zvar->cache))) goto done; } else if (var->fill_value && no_fill && (*no_fill)) { /* Turning off fill value? */ /* If there's a _FillValue attribute, delete it. */ - retval = NCZ_del_att(ncid, varid, _FillValue); + retval = NCZ_del_att(ncid, varid, NC_FillValue); if (retval && retval != NC_ENOTATT) return retval; if((retval = NCZ_reclaim_fill_value(var))) return retval; } diff --git a/libsrc/nc3internal.c b/libsrc/nc3internal.c index f6968dc463..3fced4746a 100644 --- a/libsrc/nc3internal.c +++ b/libsrc/nc3internal.c @@ -1726,7 +1726,7 @@ NC3_inq_var_fill(const NC_var *varp, void *fill_value) /* * find fill value */ - attrpp = NC_findattr(&varp->attrs, _FillValue); + attrpp = NC_findattr(&varp->attrs, NC_FillValue); if ( attrpp != NULL ) { const void *xp; /* User defined fill value */ diff --git a/libsrc/putget.m4 b/libsrc/putget.m4 index c8d713880e..927ec854f9 100644 --- a/libsrc/putget.m4 +++ b/libsrc/putget.m4 @@ -156,7 +156,7 @@ fill_NC_var(NC3_INFO* ncp, const NC_var *varp, long long varsize, size_t recno) /* * Set up fill value */ - attrpp = NC_findattr(&varp->attrs, _FillValue); + attrpp = NC_findattr(&varp->attrs, NC_FillValue); if( attrpp != NULL ) { /* User defined fill value */ diff --git a/libsrc/var.c b/libsrc/var.c index 6b636e1cdb..ea126359ac 100644 --- a/libsrc/var.c +++ b/libsrc/var.c @@ -720,7 +720,7 @@ NC3_inq_var(int ncid, if (no_fillp != NULL) *no_fillp = varp->no_fill; if (fill_valuep != NULL) { - status = nc_get_att(ncid, varid, _FillValue, fill_valuep); + status = nc_get_att(ncid, varid, NC_FillValue, fill_valuep); if (status != NC_NOERR && status != NC_ENOTATT) return status; if (status == NC_ENOTATT) { @@ -854,12 +854,12 @@ NC3_def_var_fill(int ncid, if (fill_value != NULL && !varp->no_fill) { /* If there's a _FillValue attribute, delete it. */ - status = NC3_del_att(ncid, varid, _FillValue); + status = NC3_del_att(ncid, varid, NC_FillValue); if (status != NC_NOERR && status != NC_ENOTATT) return status; /* Create/overwrite attribute _FillValue */ - status = NC3_put_att(ncid, varid, _FillValue, varp->type, 1, fill_value, varp->type); + status = NC3_put_att(ncid, varid, NC_FillValue, varp->type, 1, fill_value, varp->type); if (status != NC_NOERR) return status; } diff --git a/nc_test/t_nc.c b/nc_test/t_nc.c index 064335d98c..27301a4555 100644 --- a/nc_test/t_nc.c +++ b/nc_test/t_nc.c @@ -147,7 +147,7 @@ static const char * const reqattr[] = { "SCALEMIN", "SCALEMAX", "FIELDNAM", - _FillValue + NC_FillValue }; #define NUM_RATTRS 6 @@ -399,9 +399,9 @@ main(int argc, char *argv[]) { int ifill = -1; double dfill = -9999; assert( nc_put_att_int(id, Long_id, - _FillValue, NC_INT, 1, &ifill) == NC_NOERR); + NC_FillValue, NC_INT, 1, &ifill) == NC_NOERR); assert( nc_put_att_double(id, Double_id, - _FillValue, NC_DOUBLE, 1, &dfill) == NC_NOERR); + NC_FillValue, NC_DOUBLE, 1, &dfill) == NC_NOERR); } #ifdef REDEF diff --git a/nc_test4/tst_elatefill.c b/nc_test4/tst_elatefill.c index 9b24747732..acdddc4887 100644 --- a/nc_test4/tst_elatefill.c +++ b/nc_test4/tst_elatefill.c @@ -36,7 +36,7 @@ main(int argc, char **argv) /* try put attribute _FillValue and expect NC_ELATEFILL */ fillv = 9; - err = nc_put_att_int(ncid, varid, _FillValue, NC_INT, 1, &fillv); + err = nc_put_att_int(ncid, varid, NC_FillValue, NC_INT, 1, &fillv); if (err != NC_ELATEFILL) printf("line %d expecting NC_ELATEFILL but got %d\n",__LINE__,err); err = nc_close(ncid); ERR_CHK; diff --git a/nc_test4/tst_h_scalar.c b/nc_test4/tst_h_scalar.c index c21b0ecb45..cfeed9f280 100644 --- a/nc_test4/tst_h_scalar.c +++ b/nc_test4/tst_h_scalar.c @@ -360,14 +360,14 @@ main() /* Write to the variable's fill-value */ vlstr = NULL; - if (nc_put_att(ncid, varid, _FillValue, NC_STRING, 1, &vlstr)) ERR; + if (nc_put_att(ncid, varid, NC_FillValue, NC_STRING, 1, &vlstr)) ERR; vlstr = malloc(10); *vlstr = '\0'; - if (nc_put_att(ncid, varid, _FillValue, NC_STRING, 1, &vlstr)) ERR; + if (nc_put_att(ncid, varid, NC_FillValue, NC_STRING, 1, &vlstr)) ERR; strcpy(vlstr, "foo"); - if (nc_put_att(ncid, varid, _FillValue, NC_STRING, 1, &vlstr)) ERR; + if (nc_put_att(ncid, varid, NC_FillValue, NC_STRING, 1, &vlstr)) ERR; free(vlstr); diff --git a/nc_test4/tst_quantize.c b/nc_test4/tst_quantize.c index b788c9514f..ce4bda713d 100644 --- a/nc_test4/tst_quantize.c +++ b/nc_test4/tst_quantize.c @@ -1005,9 +1005,9 @@ main(int argc, char **argv) if (nc_create(FILE_NAME, mode, &ncid)) ERR; if (nc_def_dim(ncid, DIM_NAME_1, DIM_LEN_5, &dimid)) ERR; if (nc_def_var(ncid, VAR_NAME_1, NC_FLOAT, NDIM1, &dimid, &varid1)) ERR; - if (nc_put_att_float(ncid, varid1, _FillValue, NC_FLOAT, 1, &custom_fill_float)) ERR; + if (nc_put_att_float(ncid, varid1, NC_FillValue, NC_FLOAT, 1, &custom_fill_float)) ERR; if (nc_def_var(ncid, VAR_NAME_2, NC_DOUBLE, NDIM1, &dimid, &varid2)) ERR; - if (nc_put_att_double(ncid, varid2, _FillValue, NC_DOUBLE, 1, &custom_fill_double)) ERR; + if (nc_put_att_double(ncid, varid2, NC_FillValue, NC_DOUBLE, 1, &custom_fill_double)) ERR; /* Turn on quantize for both vars. */ if (nc_def_var_quantize(ncid, varid1, quantize_mode[q], NSD_3)) ERR; diff --git a/nc_test4/tst_strings.c b/nc_test4/tst_strings.c index 5aa78a681d..5fe87baeaf 100644 --- a/nc_test4/tst_strings.c +++ b/nc_test4/tst_strings.c @@ -450,7 +450,7 @@ main(int argc, char **argv) /* Create a scalar variable for the empty string. */ if (nc_def_var(ncid, VAR_NAME2, NC_STRING, 0, NULL, &varid2)) ERR; if (dim_combo == 3) - if (nc_put_att(ncid, varid, _FillValue, NC_STRING, 1, my_string_fill)) ERR; + if (nc_put_att(ncid, varid, NC_FillValue, NC_STRING, 1, my_string_fill)) ERR; /* Check some stuff. */ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR; diff --git a/nc_test4/tst_vars.c b/nc_test4/tst_vars.c index f7aef6881c..3bf174b3b5 100644 --- a/nc_test4/tst_vars.c +++ b/nc_test4/tst_vars.c @@ -1080,9 +1080,9 @@ main(int argc, char **argv) if (nc_def_var(ncid, VAR7_NAME, NC_USHORT, NDIMS, dimids, &varid)) ERR; if (nc_def_var(ncid, VAR8_NAME, NC_USHORT, NDIMS, dimids, &varid2)) ERR; if (nc_def_var(ncid, VAR9_NAME, NC_USHORT, NDIMS, dimids, &varid3)) ERR; - if (nc_put_att(ncid, varid3, _FillValue, NC_USHORT, 1, &my_fill_value2)) ERR; + if (nc_put_att(ncid, varid3, NC_FillValue, NC_USHORT, 1, &my_fill_value2)) ERR; if (nc_def_var(ncid, VAR10_NAME, NC_USHORT, NDIMS, dimids, &varid4)) ERR; - if (nc_put_att(ncid, varid4, _FillValue, NC_USHORT, 1, &my_fill_value2)) ERR; + if (nc_put_att(ncid, varid4, NC_FillValue, NC_USHORT, 1, &my_fill_value2)) ERR; /* Check stuff. */ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, diff --git a/nc_test4/tst_vars2.c b/nc_test4/tst_vars2.c index 0f9cee6983..a8603b12f0 100644 --- a/nc_test4/tst_vars2.c +++ b/nc_test4/tst_vars2.c @@ -87,11 +87,11 @@ main(int argc, char **argv) if (nc_create(FILE_NAME2, cmode, &ncid)) ERR; if (nc_def_dim(ncid, VAR_NAME, TEST_VAL_42, &dimid)) ERR; if (nc_def_var(ncid, VAR_NAME, NC_BYTE, 1, &dimid, &varid)) ERR; - if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR; + if (nc_put_att_schar(ncid, varid, NC_FillValue, NC_BYTE, 1, &fill_value)) ERR; if (nc_enddef(ncid)) ERR; if (nc_put_var1(ncid, varid, index, &schar_data)) ERR; if (nc_redef(ncid)) ERR; - if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, + if (nc_put_att_schar(ncid, varid, NC_FillValue, NC_BYTE, 1, &fill_value) != expected_ret) ERR; if (nc_close(ncid)) ERR; @@ -101,9 +101,9 @@ main(int argc, char **argv) if (nvars_in != 1 || varids_in[0] != 0) ERR; if (nc_inq_varname(ncid, 0, name_in)) ERR; if (strcmp(name_in, VAR_NAME)) ERR; - if (nc_inq_att(ncid, varid, _FillValue, &xtype_in, &len_in)) ERR; + if (nc_inq_att(ncid, varid, NC_FillValue, &xtype_in, &len_in)) ERR; if (xtype_in != NC_BYTE || len_in != 1) ERR; - if (nc_get_att(ncid, varid, _FillValue, &fill_value_in)) ERR; + if (nc_get_att(ncid, varid, NC_FillValue, &fill_value_in)) ERR; if (fill_value_in != fill_value) ERR; if (nc_close(ncid)) ERR; } @@ -119,7 +119,7 @@ main(int argc, char **argv) if (nc_create(FILE_NAME, cmode, &ncid)) ERR; if (nc_def_dim(ncid, DIM1_NAME, DIM1_LEN, &dimids[0])) ERR; if (nc_def_var(ncid, VAR_NAME, NC_BYTE, NUM_DIMS, dimids, &varid)) ERR; - if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR; + if (nc_put_att_schar(ncid, varid, NC_FillValue, NC_BYTE, 1, &fill_value)) ERR; if (nc_enddef(ncid)) ERR; /* Write the second record. */ @@ -154,9 +154,9 @@ main(int argc, char **argv) if (strcmp(name_in, VAR_NAME)) ERR; /* Check fill value att. */ - if (nc_inq_att(ncid, varid, _FillValue, &xtype_in, &len_in)) ERR; + if (nc_inq_att(ncid, varid, NC_FillValue, &xtype_in, &len_in)) ERR; if (xtype_in != NC_BYTE || len_in != 1) ERR; - if (nc_get_att(ncid, varid, _FillValue, &fill_value_in)) ERR; + if (nc_get_att(ncid, varid, NC_FillValue, &fill_value_in)) ERR; if (fill_value_in != fill_value) ERR; /* Read the first record, it should be the fill value. */ @@ -185,7 +185,7 @@ main(int argc, char **argv) if (nc_def_dim(ncid, DIM1_NAME, DIM1_LEN, &dimids[0])) ERR; if (nc_def_var(ncid, VAR_NAME, NC_BYTE, NUM_DIMS, dimids, &varid)) ERR; if (nc_put_att_int(ncid, varid, LOSSES_NAME, NC_INT, 1, &losses_value)) ERR; - if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR; + if (nc_put_att_schar(ncid, varid, NC_FillValue, NC_BYTE, 1, &fill_value)) ERR; if (nc_close(ncid)) ERR; /* Open the file and check. */ @@ -194,13 +194,13 @@ main(int argc, char **argv) if (xtype_in != NC_INT || len_in != 1) ERR; if (nc_get_att(ncid, 0, LOSSES_NAME, &losses_value_in)) ERR; if (losses_value_in != losses_value) ERR; - if (nc_inq_att(ncid, 0, _FillValue, &xtype_in, &len_in)) ERR; + if (nc_inq_att(ncid, 0, NC_FillValue, &xtype_in, &len_in)) ERR; if (xtype_in != NC_BYTE || len_in != 1) ERR; - if (nc_get_att(ncid, 0, _FillValue, &fill_value_in)) ERR; + if (nc_get_att(ncid, 0, NC_FillValue, &fill_value_in)) ERR; if (fill_value_in != fill_value) ERR; if (nc_inq_attid(ncid, 0, LOSSES_NAME, &attnum_in)) ERR; if (attnum_in != 0) ERR; - if (nc_inq_attid(ncid, 0, _FillValue, &attnum_in)) ERR; + if (nc_inq_attid(ncid, 0, NC_FillValue, &attnum_in)) ERR; if (attnum_in != 1) ERR; if (nc_close(ncid)) ERR; } @@ -223,7 +223,7 @@ main(int argc, char **argv) if (nc_def_var(ncid, VAR_NAME, NC_BYTE, NUM_DIMS, dimids, &varid)) ERR; for (a = 0; a < NUM_LEADERS; a++) if (nc_put_att_short(ncid, varid, leader[a], NC_SHORT, 1, &hair_length[a])) ERR; - if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR; + if (nc_put_att_schar(ncid, varid, NC_FillValue, NC_BYTE, 1, &fill_value)) ERR; if (nc_close(ncid)) ERR; /* Open the file. */ @@ -241,9 +241,9 @@ main(int argc, char **argv) } /* Check our fill value attribute. */ - if (nc_inq_att(ncid, 0, _FillValue, &xtype_in, &len_in)) ERR; + if (nc_inq_att(ncid, 0, NC_FillValue, &xtype_in, &len_in)) ERR; if (xtype_in != NC_BYTE || len_in != 1) ERR; - if (nc_get_att(ncid, 0, _FillValue, &fill_value_in)) ERR; + if (nc_get_att(ncid, 0, NC_FillValue, &fill_value_in)) ERR; if (fill_value_in != fill_value) ERR; if (nc_close(ncid)) ERR; @@ -302,7 +302,7 @@ main(int argc, char **argv) /* Now add a fill value. This will acutually cause HDF5 to * destroy the dataset and recreate it, recreating also the * three attributes that are attached to it. */ - if (nc_put_att(ncid, varid, _FillValue, NC_FLOAT, + if (nc_put_att(ncid, varid, NC_FillValue, NC_FLOAT, 1, &fill_value)) ERR; /* Check to ensure the atts have their expected attnums. */ @@ -319,7 +319,7 @@ main(int argc, char **argv) if (attnum_in != 0) ERR; if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR; if (attnum_in != 1) ERR; - if (nc_inq_attid(ncid, 0, _FillValue, &attnum_in)) ERR; + if (nc_inq_attid(ncid, 0, NC_FillValue, &attnum_in)) ERR; if (attnum_in != 2) ERR; if (nc_close(ncid)) ERR; @@ -388,14 +388,14 @@ main(int argc, char **argv) /* Now add a fill value. This will acutually cause HDF5 to * destroy the dataset and recreate it, recreating also the * three attributes that are attached to it. */ - ncattput(ncid, varid, _FillValue, NC_FLOAT, 1, &fill_value); + ncattput(ncid, varid, NC_FillValue, NC_FLOAT, 1, &fill_value); /* Check to ensure the atts have their expected attnums. */ if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR; if (attnum_in != 0) ERR; if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR; if (attnum_in != 1) ERR; - if (nc_inq_attid(ncid, 0, _FillValue, &attnum_in)) ERR; + if (nc_inq_attid(ncid, 0, NC_FillValue, &attnum_in)) ERR; if (attnum_in != 2) ERR; ncclose(ncid); @@ -406,7 +406,7 @@ main(int argc, char **argv) if (attnum_in != 0) ERR; if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR; if (attnum_in != 1) ERR; - if (nc_inq_attid(ncid, 0, _FillValue, &attnum_in)) ERR; + if (nc_inq_attid(ncid, 0, NC_FillValue, &attnum_in)) ERR; if (attnum_in != 2) ERR; ncclose(ncid); } diff --git a/ncdump/ncdump.c b/ncdump/ncdump.c index 15bc9d01c5..b9407a925d 100644 --- a/ncdump/ncdump.c +++ b/ncdump/ncdump.c @@ -779,7 +779,7 @@ pr_att( printf ("\t\t"); #ifdef USE_NETCDF4 if (is_user_defined_type(att.type) || att.type == NC_STRING - || (formatting_specs.xopt_filltype && varid != NC_GLOBAL && strcmp(_FillValue,att.name)==0)) + || (formatting_specs.xopt_filltype && varid != NC_GLOBAL && strcmp(NC_FillValue,att.name)==0)) #else if (is_user_defined_type(att.type)) #endif @@ -1511,11 +1511,11 @@ get_fill_info(int ncid, int varid, ncvar_t *vp) vp->has_fillval = 1; /* by default, but turn off for bytes */ /* get _FillValue attribute */ - nc_status = nc_inq_att(ncid,varid,_FillValue,&att.type,&att.len); + nc_status = nc_inq_att(ncid,varid,NC_FillValue,&att.type,&att.len); fillvalp = ecalloc(vp->tinfo->size + 1); if(nc_status == NC_NOERR && att.type == vp->type && att.len == 1) { - NC_CHECK(nc_get_att(ncid, varid, _FillValue, fillvalp)); + NC_CHECK(nc_get_att(ncid, varid, NC_FillValue, fillvalp)); } else { switch (vp->type) { case NC_BYTE: diff --git a/ncdump/tst_nans.c b/ncdump/tst_nans.c index 0e3efdd488..46a7bf103a 100644 --- a/ncdump/tst_nans.c +++ b/ncdump/tst_nans.c @@ -16,7 +16,7 @@ #include "isnan.h" #define FILE8_NAME "tst_nans.nc" -#define FV_NAME _FillValue /* defined in netcdf.h */ +#define FV_NAME NC_FillValue /* defined in netcdf.h */ #define FV_NVALS 1 #define ATT_NAME "att" #define NDIMS 1 diff --git a/ncgen3/ncgeny.c b/ncgen3/ncgeny.c index 8a4b51104c..99a2ed64fc 100644 --- a/ncgen3/ncgeny.c +++ b/ncgen3/ncgeny.c @@ -2264,13 +2264,13 @@ void equalatt(void) /* shrink space down to what was really needed */ att_space = erealloc(att_space, valnum*nctypesize(valtype)); atts[natts].val = att_space; - if (STREQ(atts[natts].name, _FillValue) && + if (STREQ(atts[natts].name, NC_FillValue) && atts[natts].var != NC_GLOBAL) { nc_putfill(atts[natts].type,atts[natts].val, &vars[atts[natts].var].fill_value); if(atts[natts].type != vars[atts[natts].var].type) { derror("variable %s: %s type mismatch", - vars[atts[natts].var].name, _FillValue); + vars[atts[natts].var].name, NC_FillValue); } } natts++;