Commit Graph

34 Commits

Author SHA1 Message Date
Ward Fisher
8487a0a954
Merge branch 'master' into cdf5_var_len 2018-01-25 16:30:58 -07:00
Ward Fisher
91865a3cbc Merge branch 'NC_MAX_VAR_DIMS' of https://github.com/wkliao/netcdf-c into multi-merge 2017-11-02 11:20:54 -06:00
Wei-keng Liao
2cc30c16be check against NC_MAX_VAR_DIMS (but using NC_EMAXDIMS, maybe a new error code NC_EMAXVARDIMS is needed) 2017-09-21 12:37:33 -05:00
Wei-keng Liao
b07d9701a9 move detection of NC_EVARSIZE from nc_enddef to nc_def_var 2017-09-13 11:57:19 -05:00
Wei-keng Liao
8c5956946a fix the setting of the member len of NC_var object, related to issue 463 2017-09-06 19:49:59 -05:00
Greg Sjaardema
1503013e33 Eliminate NC_MAX_VARS|DIMS|ATTRS limits 2017-07-20 09:32:29 -06:00
Ward Fisher
8dddd222a3 Merged master, DAP4 support into branch. 2017-04-19 09:29:35 -06:00
Wei-keng Liao
7aa8fc36c7 include config.h the way suggested by autoconf 2017-03-11 13:03:17 -06:00
Dennis Heimbigner
3db4f013bf Primary change: add dap4 support
Specific changes:
1. Add dap4 code: libdap4 and dap4_test.
   Note that until the d4ts server problem is solved, dap4 is turned off.
2. Modify various files to support dap4 flags:
	configure.ac, Makefile.am, CMakeLists.txt, etc.
3. Add nc_test/test_common.sh. This centralizes
   the handling of the locations of various
   things in the build tree: e.g. where is
   ncgen.exe located. See nc_test/test_common.sh
   for details.
4. Modify .sh files to use test_common.sh
5. Obsolete separate oc2 by moving it to be part of
   netcdf-c. This means replacing code with netcdf-c
   equivalents.
5. Add --with-testserver to configure.ac to allow
   override of the servers to be used for --enable-dap-remote-tests.
6. There were multiple versions of nctypealignment code. Try to
   centralize in libdispatch/doffset.c and include/ncoffsets.h
7. Add a unit test for the ncuri code because of its complexity.
8. Move the findserver code out of libdispatch and into
   a separate, self contained program in ncdap_test and dap4_test.
9. Move the dispatch header files (nc{3,4}dispatch.h) to
   .../include because they are now shared by modules.
10. Revamp the handling of TOPSRCDIR and TOPBUILDDIR for shell scripts.
11. Make use of MREMAP if available
12. Misc. minor changes e.g.
	- #include <config.h> -> #include "config.h"
	- Add some no-install headers to /include
	- extern -> EXTERNL and vice versa as needed
	- misc header cleanup
	- clean up checking for misc. unix vs microsoft functions
13. Change copyright decls in some files to point to LICENSE file.
14. Add notes to RELEASENOTES.md
2017-03-08 17:01:10 -07:00
Ward Fisher
ec526880dd Merge branch 'master' into NC_USHORT_rec_align 2017-03-02 15:22:36 -07:00
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
Wei-keng Liao
467fded268 bug fix: record size alignment for NC_USHORT is missing 2016-11-25 10:35:43 -06:00
Ward Fisher
cdf7717666 Updated OFF_T_MAX computation to avoid an undefined behavior warning reported by clang/gcc. 2016-09-26 10:14:38 -06:00
Greg Sjaardema
586e832f64 Fix variable and dimension renaming for nc3 with hashmap
The problem is that the name was being updated prior to the old
variable being removed from the hashmap. It checks whether the key and
the name of the variable being removed match, but since the name had
already been updated, the names did not match so the variable was not
removed. This patch removes the variable from the hashmap first,
then updates the name, and then adds the variable with the new name to
the hashmap.

Similar change for renaming dimensions.
2016-07-11 15:44:40 -04:00
Ward Fisher
3e24dcd575 Removed some dead assignments reported by clang. 2016-06-20 15:28:46 -06:00
Greg Sjaardema
09454cba09 Fix accessing deleted memory 2016-04-05 09:47:12 -06:00
Greg Sjaardema
1f9eb8093c Fix duplicate key issues in nc_hashmap
The addition of the nc_hashmap to facilitate quick
retrieval of var and dim by name did not take into
account key collisions -- two or more names hashed
to the same value.  If the keys matched, it assumed
that the names matched also.

This change fixes this incorrect assumption and
checks both the key (which is the hash of the name)
and if the keys match, it also checks that the names
match.

While there have been no instances of duplicate keys,
they are certain to occur and cause difficult to
debug issues. This fix eliminates that defect.
2016-04-05 09:07:40 -06:00
Greg Sjaardema
43ef27a407 Revert array geometric growth option 2016-03-24 06:44:41 -06:00
Greg Sjaardema
a248e0dfbe Free hashmap to eliminate memory leaks 2016-03-24 06:38:45 -06:00
Greg Sjaardema
d5cb4b9e3e Add hashmap for quick retrieval of dim and var 2016-03-24 06:38:45 -06:00
Greg Sjaardema
3bb86e417d Update var.c 2016-03-22 07:52:41 -06:00
Greg Sjaardema
362e28948d Add hashmap for quick retrieval of dim and var 2016-03-22 07:29:00 -06:00
dmh
49597a64af merge-squash 2015-10-09 10:12:11 -06:00
Ward Fisher
8515ece987 Corrected a dead-code issue reported by Coverity (that I introduced). 2015-09-24 11:32:41 -06:00
Ward Fisher
a8df681331 Addressed a potential null dereference bug reported by Coverity static analysis. 2015-09-22 15:31:48 -06:00
Ward Fisher
8c70437580 Added a check for a null pointer based on the bug fix documented in [NCF-340]. 2015-09-11 12:29:35 -06:00
Ward Fisher
dffaff8406 Further progress on [NCF-340], capturing previously-lost error code NC_EGLOBAL 2015-09-10 15:55:06 -06:00
Ward Fisher
9f9de5a493 Added a fix for a 'garbage/undefined value' bug reported by clang. in var.c, when varp->shape was being allocated, it was not being initialized properly and as a result, in some circustances, could potentially be dereferenced and evaluated without having a proper value. It is now initialized to 0. Hopefully this does not cause a problem. All the tests continue to pass, but I'm leaving a verbose comment here in case there is a knock-on problem discovered somewhere down the line. 2014-11-06 14:43:09 -07:00
Ward Fisher
461c96cdbe Fixed a clang-reported NULL pointer dereference issue. 2014-09-30 11:30:00 -06:00
Ward Fisher
ae927f3c84 Fixed a dereference issue where ndims was greater than 0 but the allocation for dimids would fail. Identified by clang static analysis. 2014-07-09 12:45:06 -06:00
Ward Fisher
76e5e0f1fa Addressed several minor issues revealed by static analysis (coverity, clang). Mostly to do with extreme corner cases in which a null pointer would be dereferenced, or dereferencing a non-null (but non-initialized) pointer would result in garbage. 2014-03-28 17:11:26 -06: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
0790f81cf9 Merged var/dim name hashing for fast lookups into my branch. 2010-07-28 21:42:03 +00:00
Ed Hartnett
18f4bca367 moving to trunk subdir 2010-06-03 13:24:43 +00:00