Commit Graph

59 Commits

Author SHA1 Message Date
Dennis Heimbigner
47daf33074 Resolves Github issue https://github.com/Unidata/netcdf-c/issues/349.
Update utf8proc.[ch] to use the version now
maintained by the Julia Language project
(https://github.com/JuliaLang/utf8proc/blob/master/LICENSE.md).
The license for the previous version was
unacceptable for the Debian and Ubuntu release
systems. The new version both updates the code
and addresses the license issue.

It turns out that the utf8proc software we are using
was turned over to the Julia Language developers
and the license terms changed to allow modification.
(https://github.com/JuliaLang/utf8proc/blob/master/LICENSE.md).

So the fix here is as follows:
1. Wrap the library with a fixed interface: libdispatch/dutf8.c
   and include/ncutf8.h.
2. Replace the existing utf8proc code with the new version
   from https://github.com/JuliaLang/utf8proc.
3. Add a couple more test cases: nc_test/tst_utf8_validate.c
   and nc_test_utf8_phrases.c.  If/when I can find a usable
   normalization test, I will incorporate that later.
2017-02-16 14:27:54 -07:00
Ward Fisher
767a5b372c Corrected an issue reported as part of the pull request at https://github.com/Unidata/netcdfic/pull/328 2016-11-28 13:31:43 -07:00
Greg Sjaardema
a55d96eba1 Clean-up build after changes -- remove unused variables 2016-11-16 08:45:28 -07:00
Greg Sjaardema
d16f5a8842 Whitespace cleanup 2016-11-16 08:45:19 -07:00
Greg Sjaardema
8698e57424 Compile with c89 -- eliminate init in for-loop 2016-11-16 08:45:15 -07:00
Greg Sjaardema
c84b475ccf Remove var linked list 2016-11-16 08:45:10 -07:00
Greg Sjaardema
dee1baca8e Store vars in array instead of linked list (linked list still active) 2016-11-16 08:45:06 -07: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
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
Greg Sjaardema
1a84a6a99e Add hash field to dim and var to facilitate fast name compare
In non-classic netcdf-4 models, it is allowable to have
large numbers of dims and vars.  In many operations, the
entire list of dims or vars is searched for a dim/var matching
a specific name which results in *lots* of strncmp or strcmp
calls.

If we add a hash field to the var and dim structs similar to what
has already been done for the netcdf-3 formats, then we can hash the
name being searched for and numerically compare that value with
the var/dim hash value.  If they match, then do a more expensive
strncmp call to ensure that the names truly match.
2016-03-03 13:18:31 -07:00
Ward Fisher
d8b65ccea1 Fix for https://github.com/Unidata/netcdf-c/issues/223 2016-02-19 15:05:39 -07:00
Dennis Heimbigner
b5ba424793 Clean up the handling of hdf5 initialization by
creating an nc4_hdf5_initialize(void) function
plus nc4_hdf5_initialized flag.
Also fix potential null exception in nc4internal.c
2016-01-28 16:19:38 -07:00
Ward Fisher
999f4e5720 Additional debugging, modified the LOGGING functions somewhat. Also modified ncdump to print 'native' endianness. This may be removed before merging back into trunk. 2015-05-14 17:22:07 -06:00
Ward Fisher
dd2ae92a48 Corrected a potential dereference of a null pointer. 2015-02-11 13:13:39 -07:00
Russ Rew
72c3e5809a Fix comment, small memory leak 2015-02-05 16:33:42 -07:00
Ward Fisher
296928ffc7 Identified a potential null pointer dereference introduced in pull request, added check for null pointer. 2014-12-28 21:04:48 -08:00
Quincey Koziol
8769d58b1d Initial fix for further rename issue. 2014-11-24 09:36:58 -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
Quincey Koziol
e1fc13b215 Many changes to address NCF-177 (renaming dimensions and variables). Also
many cleanups to fix compiler warnings, streamline iteration over objects
in HDF5 file when opening the file, and generally straightening out the code
to be cleaner and simpler.

Tested on Mac OS/X with gcc 4.8 and OpenMPI (which uses clang).
2013-11-30 23:20:28 -06:00
Quincey Koziol
a7ecaeb327 Work in progress on NCF-177. 2013-08-17 12:53:29 -05:00
Ward Fisher
f43bf8f1da Addressed a handful of issues identified by
Coverity static analysis.
2013-08-05 20:36:33 +00:00
Ward Fisher
1c23ec06b8 Merging latest from netcdf-cmake branch. Includes a handful
of fixes for coverity-identified errors.
2013-07-19 21:32:27 +00: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
Russ Rew
58a63708cc Fix contributed by Nath Gopalaswamy to large file problem reading
netCDF classic or 64-bit offset files that have a UINT32_MAX flag for
large last record size of a variable that has values larger than 1
byte.  This problem had previously been fixed for *writing* such data,
but was only tested with an ncbyte variable.  Fixed test to
demonstrate problem and the fix.

More updates to chunking documentation, cosmetic fixes for some
"--option=" documentation that doxygen turns into mdash.
2013-06-25 17:04:10 +00:00
Dennis Heimbigner
c583f91992 merge with trunk and fix conflicts 2013-05-10 17:04:28 +00:00
Ward Fisher
b113f6f8b6 Merged a handful of changes from netcdf-cmake branch.
Addressed the following coverity issues:

711762
711763
711766
711788
711933
711934
711935
2013-04-16 23:02:54 +00:00
Ward Fisher
4a274b9870 Merged latest changes from cmake development branch.
Addressed a number of memory-related problems
reported by Coverity.
2013-04-02 22:09:31 +00:00
Ward Fisher
9f187a1484 Merged the fix for NCF-29 from Quincy into the trunk. 2013-03-26 18:57:26 +00:00
Dennis Heimbigner
c659633d2e merge from trunk 2013-03-26 16:45:02 +00:00
Dennis Heimbigner
4e41843740 1) fix some minor bugs when pnetcdf is enabled 2)Comment out some apparently unused procedures 2013-03-25 17:12:50 +00:00
Dennis Heimbigner
8d993d58d8 undo a conversion to static 2013-03-25 16:29:19 +00:00
Dennis Heimbigner
9b4db7a039 Make some things static that do not need to be externally visible 2013-03-24 17:33:17 +00:00
Dennis Heimbigner
dea3c726c8 merge trunk into this branch 2013-03-15 20:31:07 +00:00
Koziol
0f29dd60c0 Description:
Fix Jira issue NCF-29 (https://bugtracking.unidata.ucar.edu/browse/NCF-29):
making the netCDF-4 library ignore HDF5 datasets and attributes which have
datatypes (such as references) that it doesn't understand.

Tested on:
    Mac OSX/64 10.8.2 (amazon) w/--enable-netcdf-4 --enable-extra-tests --enable-extra-example-tests
        --disable-shared --enable-logging
2013-03-01 08:10:28 +00:00
Ward Fisher
19dcece866 Merged latest trunk, addressed NC_MAX_DIMS dependence in libsrc4 2013-01-28 18:31:02 +00:00
Dennis Heimbigner
0d8c0b9276 more pnetcdf fixes 2013-01-18 02:25:12 +00:00
Russ Rew
22b411a17c Merged in pnetcdf fixes from Greg Sjardema, to make set_fill_mode work
with parallel-netcdf, to fully implement parallel-netcdf support for
other functions, and to prevent a hang in hdf5 from an eary return in
an nc4_put_vara() call.  Also fixed an nccopy bug when
nc_inq_var_deflate() returns defalate_level of 0, but says the variable
is deflated.
2013-01-15 03:46:46 +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
c6f399c731 Fix non-portable test that depends on nonstandardized floating-point format using e+08, not e+008. Fixes for some problems reported in scan-build static analysis. 2012-04-23 23:59:24 +00:00
Ed Hartnett
d58c18c623 added diskless files API, subsetting not working, classic model only 2011-08-16 21:04:33 +00:00
Ed Hartnett
94210cb492 fixed HDF4 build memory problem 2010-12-06 16:27:08 +00:00
Ed Hartnett
03f63a5f1c many changes for memory fixes 2010-11-29 22:23:16 +00:00
Dennis Heimbigner
b2c05fa4d0 fixed:
ncgen: nan bug
       made semicolons optional after type decls
libncdap{3,4}: revamped the NC surrogate to better match
       with libsrc
libdispatch: Added a new_nc function to the dispatch table; its purpose
                 is to allow hierarchical use of NC compatible data structures.
libsrc: cleaned up the NC structure by removing drno field
general: removed --with-oc options
2010-11-09 22:53:03 +00:00
Ed Hartnett
105fe5fed1 fixed extra-test bug, return code from nc_inq_var_* functions with bad ncids, bumped version to beta2 2010-09-24 15:55:54 +00:00
Ed Hartnett
1aedb82327 fixed some memory problems, more progress towards nc_inq_path 2010-08-19 17:37:29 +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
a106e959bc removed more memory use for netcdf-4 performance 2010-07-01 16:02:10 +00:00