Commit Graph

35 Commits

Author SHA1 Message Date
Dennis Heimbigner
0cf1e2c49f re: Github issue netcdf-c 300
Modified provenance code to allocate the minimal space
needed for _NCProperties attribute in file.  Basically
required using malloc in the provenance code and in ncdump.
Otherwise should cause no externally visible effects.
Also removed the ENABLE_FILEINFO from configure.ac since
the provenance code is no longer optional.
2016-08-08 09:24:19 -06:00
Ward Fisher
1ebb104f74 Tentatively fixed https://github.com/Unidata/netcdf-c/issues/239 but the test needs to be extended. 2016-06-10 17:03:08 -06:00
Dennis Heimbigner
835511eaeb HDF5 is generating unnecessary error messages when netcdf4 logging is enabled
re: github netcdf-c issue #271

This occurs for several reasons, including:
1. using H5Aopen_name instead of H5Aexists to test if attribute exists.
2. using H5Eset_auto instead of H5Eset_auto2.
There are probably others that will have to be extinguished as encountered.
p.s Hope I did not overdo this and kill too much.
2016-05-27 10:08:01 -06:00
Ward Fisher
fcca7ae57d Merge branch 'master' into provfix 2016-05-16 12:39:15 -06:00
Dennis Heimbigner
4fa1470241 re: github issue https://github.com/Unidata/netcdf-c/issues/265
Charlie Zender noted that we forgot to define what happens for
various netcdf API attribute operations, notably nc_inq_att()
and nc_get_att().
So, I added a list of legal and illegal api calls for the provenance
attributes in docs/attribute_conventions.md.
I also added more test cases to ncdump/tst_fileinfo.c to verify
and fixed resultant errors.
2016-05-15 18:03:04 -06:00
Dennis Heimbigner
7e0db68dce Finally get around to removing all that
obsolete pnetcdf related code in libsrc4.
2016-05-14 22:31:41 -06:00
Dennis Heimbigner
11a259ad86 Add provenance info for netcdf-4 files.
This consists of a persistent attribute named
_NCProperties plus two computed attributes
_IsNetcdf4 and _SuperblockVersion.
See the 'Provenance Attributes' section
of docs/attribute_conventions.md for details.
2016-05-07 14:32:07 -06:00
Ward Fisher
473259b772 Corrected issue where overwriting an attribute of type NC_CHAR with NC_STRING would result in dangling data. 2015-11-11 11:32:12 -07:00
Quincey Koziol
aede522766 Mark dataset attributes dirty when one is renamed. 2015-02-25 09:25:40 -06:00
Quincey Koziol
2917a6a123 Interim checkpoint of working code. 2014-12-01 08:52:53 -06:00
Quincey Koziol
8769d58b1d Initial fix for further rename issue. 2014-11-24 09:36:58 -06:00
Ward Fisher
03ce4c9761 Cast malloc return to appropriate type. 2014-10-01 17:04:56 -06:00
Quincey Koziol
b98a475f37 Minor tweaks to comments and LOG messages. 2014-02-17 13:34:05 -06:00
Quincey Koziol
fd981824c1 Correct handling of variablen-length sequences for attributes, plus uncomment a
bunch of tests that stress this area of the library.

Also clean up some compiler warnings in the dispatch code.
2014-02-14 08:07:14 -06:00
Quincey Koziol
b2dfacbcfa Big clean up to type handling in libsrc4, which makes fill-values work
correctly for variables with string datatype, plus a few other minor changes.
2014-02-11 17:12:08 -06:00
Quincey Koziol
cd71eb525c Corrected "BAIL" macros to avoid infinite loop when logging is disabled and an
error occurs after an "exit:" label.

Corrected a dozen Coverity errors (mainly allocation issues, along with a few
    other things):
        711711, 711802, 711803, 711905, 970825, 996123, 996124, 1025787,
        1047274, 1130013, 1130014, 1139538

Refactored internal fill-value code to correctly handle string types, and
    especially to allow NULL pointers and null strings (ie. "") to be
    distinguished.  The code now avoids partially aliasing the two together
    (which only happened on the 'write' side of things and wasn't reflected on
    the 'read' side, adding to the previous confusion).

    Probably still weak on handling fill-values of variable-length and compound
    datatypes.

Refactored the recursive metadata reads a bit more, to process HDF5 named
    datatypes and datasets immediately, avoiding chewing up memory for those
    types of objects, etc.

Finished uncommenting and updating the nc_test4/tst_fills2.c code (as I'm
    proceeding alphabetically through the nc_test4 code files).
2013-12-29 01:12:43 -06:00
Quincey Koziol
b3044de434 Refactored read_scale(), memio_new(), var_create_dataset() and makespecial()
to clean up resources properly on failure.

Refactored doubly-linked list code for objects in the libsrc4 directory,
    cleaning up the add/del routines, breaking out the common next/prev
    pointers into a struct and extracting the add/del operations on them,
    changed the list of dims to add new dims in the same order as the other
    types, made all add routines able to optionally return a pointer to the
    newly created object.

Removed some dead code (pg_var(), nc4_pg_var1(), nc4_pg_varm(), misc. small
    routines, etc)

Fixed fill value handling for string types in nc4_get_vara().

Changed many malloc()+strcpy() pairs into calls to strdup().

Cleaned up misc. other minor Coverity issues.
2013-12-08 03:29:26 -06:00
Russ Rew
e4f9350c23 Quincey's fixes for NCF-56, "netcdf-4 can't read HDF5 scalar atts".
Also added ability capability for netCDF-4 to write and read NIL
values for string type attributes and variables, so these can be read
if used in HDF5 files.

Include are additions to CMakeLists files to reflect new tests.
2013-07-10 20:09:31 +00:00
Dennis Heimbigner
c583f91992 merge with trunk and fix conflicts 2013-05-10 17:04:28 +00:00
Ward Fisher
67f96188ff Merged latest from netCDF-cmake branch in preparation for 4.3.0 release. 2013-04-23 21:50:07 +00:00
Dennis Heimbigner
dea3c726c8 merge trunk into this branch 2013-03-15 20:31:07 +00:00
Ward Fisher
57084316de Merging changes from netCDF branch. 2013-02-28 21:50:55 +00:00
Dennis Heimbigner
0d8c0b9276 more pnetcdf fixes 2013-01-18 02:25:12 +00:00
Ward Fisher
85382f21bc Fixed a handful of issues identified by Coverity. 2012-12-06 00:06:32 +00:00
Ward Fisher
ff631c8156 Merged latest changes from cmake branch.
o Improved CMake support.
o Cmake module compatibility (netcdf-config*.cmake.in).
2012-11-19 21:43:12 +00:00
Dennis Heimbigner
5ca78309cc The effect of this change is to make the struct NC structure
contain as little file-type specific info as possible.  It
modifies especially libsrc so that all of the netcdf-3 data
that used to be in struct NC is now kept in a separate chunk
of data pointed to by the struct NC. This makes all of
current protocols consistent: netcdf-3, netcdf-4, and dap.
2012-09-06 19:44:03 +00:00
Russ Rew
8d53da4826 Fixed bug "adding a bad _FillValue" bug (NCF-190). Fixed minor bugs
reported by static analysis, including memory leak in ncdump, missing
size_t cast for chunk cache.  Fixed various doc problems, including
byte vs. char issues, missing NC_UBYTE in type list, needed link to
"Building with Windows" page.
2012-08-16 18:31:48 +00:00
Russ Rew
d412686ec3 Fix Jeff Whittaker's bug NCF-156 2012-03-09 19:19:43 +00:00
Ed Hartnett
7b47adf3a1 removed executable permissions from all code files 2011-10-04 16:05:11 +00:00
Ed Hartnett
ff498d2c3a changed permissions 2011-09-26 13:46:43 +00:00
Ed Hartnett
03f63a5f1c many changes for memory fixes 2010-11-29 22:23:16 +00:00
Dennis Heimbigner
dd4fe6d25c dispatch.h->ncdispatch.h to avoid visualstudio filename conflict 2010-08-05 02:44:59 +00:00
Dennis Heimbigner
c5cb1104b7 removed USE_DISPATCH and most uses of nc3 from libsrc4 2010-07-30 19:20:22 +00:00
Ed Hartnett
ad5466af24 reduced memory use for attributes 2010-07-01 13:08:28 +00:00
Ed Hartnett
18f4bca367 moving to trunk subdir 2010-06-03 13:24:43 +00:00