Commit Graph

430 Commits

Author SHA1 Message Date
Ward Fisher
db8d23b986 Removed a potential double-free identified by static analysis. 2018-05-31 15:09:11 -06:00
Ward Fisher
3f83cc4926 Merge branch 'master' into inmem2.dmh 2018-05-16 14:24:19 -06:00
Ward Fisher
27ca221bdb Merge branch 'master' into appveyor.wif 2018-05-14 13:19:17 -06:00
Dennis Heimbigner
3c7ffcc6d1 Fix https://github.com/Unidata/netcdf-c/issues/963
Fix https://github.com/Unidata/netcdf-c/issues/962

1. remove the --disable-diskless option since it is no
   longer needed. Similarly for CMakeLists.txt.
2. Fixed nc4files.c where BAIL and return were mixed
   leading to situation where cleanup code was not
   being invoked. This probably occurs elsewhere,
   but I did not find any specifically.
2018-05-11 15:30:19 -06:00
Ward Fisher
94cbded134 Merge branch 'ejh_fix_n3' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-consolidate.wif 2018-05-08 11:43:19 -06:00
Ed Hartnett
c175a302da fixed some issues 2018-05-08 11:39:37 -06:00
Ward Fisher
544c0994c9 Merge branch 'msvc-vs2013-support' of https://github.com/mathstuf/netcdf-c into pr-consolidate.wif 2018-05-08 11:12:19 -06:00
Dennis Heimbigner
9aa1e9a14e master merge 2018-05-03 21:02:12 -06:00
Ward Fisher
fa81457d18
Merge branch 'master' into msvc-vs2013-support 2018-05-02 16:27:59 -06:00
luz.paz
b4d0fe651a Follow-up trivial typos 2018-04-26 23:04:01 -04:00
Ward Fisher
28ce3e4a8c Added fenceposts around bash scripts, excluding the bash.exe included with Windows 10 (for now) when searching to see if bash is available. 2018-04-26 14:38:56 -06:00
Ward Fisher
eb34e3ab85
Merge branch 'master' into msvc-vs2013-support 2018-04-23 13:38:00 -06:00
Dennis Heimbigner
0a44d9ae3a Merge branch 'master' into inmemory.dmh 2018-04-23 11:30:14 -06:00
Ward Fisher
46e39c3647 Merge branch 'err_endef_close' of https://github.com/wkliao/netcdf-c into gh479-conflict-resolution 2018-04-18 10:22:53 -06:00
Dennis Heimbigner
4739cd3225 Master merge and conflict resolution 2018-04-12 21:51:17 -06:00
Ward Fisher
5ff3bb34ca
Merge branch 'master' into msvc-vs2013-support 2018-04-12 15:57:30 -05:00
Ward Fisher
28082c283b
Merge branch 'master' into index.dmh 2018-03-26 23:47:43 -06:00
Ward Fisher
7b86b4d3d3
Merge branch 'master' into issue899.dmh 2018-03-26 22:31:29 -06:00
Dennis Heimbigner
efe2fa727e Fix bug: Index exceeds dimension bound
Fix github issue https://github.com/Unidata/netcdf-c/issues/899
which came from e-support UOY-859712.

The problem was that the vlen_max parameter
to libsrc/var.c#NC_check_vlen was of type size_t.
However, it is being called, sometimes, with values
of size X_INT64_MAX. The resulting truncation was
causing dimension failures as noted in the e-support
report.

Fix is to change the vlen_max argument (and some
local variables in NC_check_vlen) to be of declared
as unsigned long long.
2018-03-16 13:54:33 -06:00
Dennis Heimbigner
25f062528b This completes (for now) the refactoring of libsrc4.
The file docs/indexing.dox tries to provide design
information for the refactoring.

The primary change is to replace all walking of linked
lists with the use of the NCindex data structure.
Ncindex is a combination of a hash table (for name-based
lookup) and a vector (for walking the elements in the index).
Additionally, global vectors are added to NC_HDF5_FILE_INFO_T
to support direct mapping of an e.g. dimid to the NC_DIM_INFO_T
object. These global vectors exist for dimensions, types, and groups
because they have globally unique id numbers.

WARNING:
1. since libsrc4 and libsrchdf4 share code, there are also
   changes in libsrchdf4.
2. Any outstanding pull requests that change libsrc4 or libhdf4
   are likely to cause conflicts with this code.
3. The original reason for doing this was for performance improvements,
   but as noted elsewhere, this may not be significant because
   the meta-data read performance apparently is being dominated
   by the hdf5 library because we do bulk meta-data reading rather
   than lazy reading.
2018-03-16 11:46:18 -06:00
Dennis Heimbigner
f6a45b942e Merge branch 'master' into newhash1.dmh 2018-03-01 22:13:50 -07:00
Ward Fisher
c4551856d4 Simplified fix. 2018-02-28 12:20:53 -07:00
Ward Fisher
3ccce81190 Accomodating special characters in path name. 2018-02-28 12:18:20 -07:00
Dennis Heimbigner
9240f04dc7 1. make uptodate wrt master
2. fix lgtm alert
4. fix problem in examples/C/hdf5plugins
   where a file overwrite problem occurs.
2018-02-28 11:10:35 -07:00
Dennis Heimbigner
225453f12f Fix memory leaks re utf8_normalize 2018-02-27 15:46:19 -07:00
Ward Fisher
faf1470887 Commented out the code, rather than just adding a comment block. 2018-02-27 15:20:58 -07:00
Ward Fisher
6ce110e362 Updated libsrc/attr.m4 in support of https://github.com/Unidata/netcdf-c/issues/843 2018-02-27 15:15:43 -07:00
Dennis Heimbigner
25045b78ce fix lgtm alert 2018-02-26 12:18:01 -07:00
Dennis Heimbigner
ccc70d640b re: esupport MQO-415619
and https://github.com/Unidata/netcdf-c/issues/708

Expand the NC_INMEMORY capabilities to support writing and accessing
the final modified memory.

Three new functions have been added:
nc_open_memio, nc_create_mem, and nc_close_memio.

The following new capabilities were added.
1. nc_open_memio() allows the NC_WRITE mode flag
   so a chunk of memory can be passed in and be modified
2. nc_create_mem() allows the NC_INMEMORY flag to be set
   to cause the created file to be kept in memory.
3. nc_close_mem() allows the final in-memory contents to be
   retrieved at the time the file is closed.
4. A special flag, NC_MEMIO_LOCK, is provided to ensure that
   the provided memory will not be freed or reallocated.

Note the following.
1. If nc_open_memio() is called with NC_WRITE, and NC_MEMIO_LOCK is not set,
   then the netcdf-c library will take control of the incoming memory.
   This means that the original memory block should not be freed
   but the block returned by nc_close_mem() must be freed.
2. If nc_open_memio() is called with NC_WRITE, and NC_MEMIO_LOCK is set,
   then modifications to the original memory may fail if the space available
   is insufficient.

Documentation is provided in the file docs/inmemory.md.
A test case is provided: nc_test/tst_inmemory.c driven by
nc_test/run_inmemory.sh

WARNING: changes were made to the dispatch table for
the close entry. From int (*close)(int) to int (*close)(int,void*).
2018-02-25 21:45:31 -07:00
Dennis Heimbigner
199221eef6 fix memory leak 2018-02-25 20:35:24 -07:00
Dennis Heimbigner
ab96eb36ad Fix lgtm alerts 2018-02-25 11:28:06 -07:00
Dennis Heimbigner
8cb1fc4cfe This is the second step in refactoring the libsrc4 code.
The first was branch newhash0.dmh.

As with newhash0.dmh, these changes should be transparent.
2018-02-24 20:36:24 -07:00
Ward Fisher
f9f27c5ab7
Merge branch 'master' into newhash0.dmh 2018-02-21 14:19:43 -07:00
Ben Boeckel
e0f314123f ncx: use __inline with MSVC
Visual Studio 2013 and older do not support `inline` in C code.
2018-02-19 10:14:29 -05:00
Ben Boeckel
b432a527c4 c: remove __CHAR_UNSIGNED__
In C, `char`, `signed char`, and `unsigned char` are three separate,
distinct types, so just because `char` happens to be signed does not
mean it is interchangeable with `signed char`.
2018-02-14 17:24:49 -05:00
Dennis Heimbigner
727b613459 This is the initial step in moving to the new higher performance
(I hope) metadata mechanism. This mostly just adds new pieces of
code (e.g. nclistmap) and does some minor fixes.

It should be transparent to everything else.
The next set of changes will be the big step.
2018-02-08 19:53:40 -07:00
Ward Fisher
9e926410ee Added the fix suggested by @mathstuf in support of https://github.com/unidata/netcdf-c/issues/845 2018-02-07 11:23:54 -07:00
Ward Fisher
0d420fcfbb
Merge branch 'master' into cdf5_var_len 2018-02-02 10:31:46 -07:00
Ward Fisher
27693ba4a3
Merge branch 'master' into nc3-per-var-fill-v2 2018-02-01 11:45:40 -07:00
Ward Fisher
8487a0a954
Merge branch 'master' into cdf5_var_len 2018-01-25 16:30:58 -07:00
Ed Hartnett
2197d9849b merged 466 2018-01-20 06:04:08 -07:00
Wei-keng Liao
0f4a85b9f2 a clean commit for #383 2017-12-20 20:53:30 -06:00
Ed Hartnett
46d3bca8f4 removed non-working BUILD_DLL target 2017-11-30 05:40:17 -07:00
Ed Hartnett
bcfce160fb fixed warning 2017-11-30 04:56:46 -07:00
Ed Hartnett
3c5404ccf7
Merge branch 'master' into ejh_ncfunc_testing 2017-11-28 00:04:38 +00:00
Nehal J Wani
1b91bd89d4
Fix build on pre-C99 compilers
- Make sure that the variables are declared at the top of the block.
 - Add fix to enable inline for various compilers
2017-11-26 01:47:54 +05:30
Ed Hartnett
845355e91b added hdf4 test for inq_format calls 2017-11-22 08:21:24 -07:00
Ed Hartnett
d4495e8e86 more testing 2017-11-22 07:46:03 -07:00
Ed Hartnett
70c739858b fixed SEGFAULT for NULL parameter for nc_inq_format(), added testing, improved documentation 2017-11-22 06:53:23 -07:00
Ward Fisher
e97911a592 Updated v1hpg.c to make header padding with null byte checks optional. 2017-11-20 16:08:06 -07:00