Commit Graph

18 Commits

Author SHA1 Message Date
Ed Hartnett
0e0482bc05 fixed warnings 2017-11-09 06:24:18 -07:00
Greg Sjaardema
1503013e33 Eliminate NC_MAX_VARS|DIMS|ATTRS limits 2017-07-20 09:32:29 -06:00
Wei-keng Liao
7aa8fc36c7 include config.h the way suggested by autoconf 2017-03-11 13:03:17 -06: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
Ward Fisher
029cbd7aeb Another tweak for a rushed fix. 2017-01-09 12:01:17 -07:00
Ward Fisher
7d75fd3731 Updated code, location of variable declarations in support of https://github.com/Unidata/netcdf-c/issues/304 2017-01-09 11:37:35 -07: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
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
a248e0dfbe Free hashmap to eliminate memory leaks 2016-03-24 06:38:45 -06:00
Greg Sjaardema
362e28948d Add hashmap for quick retrieval of dim and var 2016-03-22 07:29:00 -06:00
Dennis Heimbigner
d15f277252 The max dimension sizes do not take CDF-5 format into account.
NetCDF-c Github issue #185

The code in libsrc/dim.c has not been upgraded to support
CDF-5 format.

Rule we are implementing sets the max dimension sizes as follows:

Classic:	CDF-1	NC_MAX_INT - 3    = 2147483647 - 3
64 bit Offset:	CDF-2	NC_MAX_UINT - 3	  =  4294967295 - 3
64 bit Data:	CDF-5	NC_MAX_UINT64 - 3 = 18446744073709551615 - 3

The -3 is to handle rounding.
2016-01-05 21:26:25 -07: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
Ed Hartnett
03f63a5f1c many changes for memory fixes 2010-11-29 22:23:16 +00:00
Ed Hartnett
8cc0fd982f fixed valgrind problems 2010-11-29 21:07:09 +00:00
Russ Rew
23307ac97b Fix bug in name/hash code for renaming a dimension. 2010-11-23 18:10:51 +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