Commit Graph

559 Commits

Author SHA1 Message Date
Wei-keng Liao
8b3d32ca1e throw NC_EVARSIZE when detecting a variable larger then X_INT64_MAX - 3 for CDF-5 files 2017-09-13 00:41:04 -05:00
Wei-keng Liao
49226bb76b remove checking against UINT32_MAX 2017-09-11 19:13:13 -05:00
Wei-keng Liao
680a6edd29 reset to original ncp->begin_var, instead of 0 2017-09-08 02:18:00 -05:00
Wei-keng Liao
52bfe51188 fix error code returned from nc_close while a failed nc__enddef occurs 2017-09-07 20:23:17 -05:00
Wei-keng Liao
752f31a3d3 add handling for writing vsize to header for large variable sizes, following the CDF format specification 2017-09-07 16:56:42 -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
Dennis Heimbigner
d8d4ed627a master merge 2017-08-29 18:05:46 -06:00
Dennis Heimbigner
ed44fd7306 Add szip support via libaec 2017-08-27 13:35:20 -06:00
Wei-keng Liao
8b6d131cbe Because ncx.c and putget.c are to be released with the package in case users do not have m4, the generation of the two C files cannot depend on the configure option of --enable-erange-fill. This commit fixes this problem by replacing m4 conditional define with C conditional preprocess. 2017-08-20 14:32:57 -05:00
Wei-keng Liao
64af659fae fix vpath build for regenerating c files from m4 files 2017-08-20 13:53:25 -05:00
Wei-keng Liao
2a68d58433 avoid calling NC3_inq_var_fill when ERANGE_FILL is enabled 2017-08-20 02:04:29 -05:00
Dennis Heimbigner
7e8bd784cc Merge branch 'master' into filters.dmh 2017-08-17 14:29:34 -06:00
Dennis Heimbigner
86fc8745dc merge master and resolve conflicts 2017-08-12 15:50:31 -06:00
Lars Pastewka
bd33076424 Fixed computation of recsize for NC_64BIT_DATA files. 2017-08-09 21:47:08 +02:00
Greg Sjaardema
1503013e33 Eliminate NC_MAX_VARS|DIMS|ATTRS limits 2017-07-20 09:32:29 -06:00
Dennis Heimbigner
715a6fe5eb The files libdispatch/dwinpath.c and include/ncwinpath.h
were added to provide a path name converter from e.g. cygwin
paths to e.g. windows paths. This is necessary because
the shell scripts may produce cygwin paths, but the code
may have been compiled with Visual Studio. Similar issues
arise with Mingw.

At appropriate places, and if using Visual Studio or Mingw,
I added calls to the path conversion code.
Apparently I forgot to find all the places where this
conversion was needed. So this pr does the following:
1. Push the calls to the converter to the various libXXX
   directories and out of libdispatch/dfile.c.
2. Add conversion calls to other parts of the code like oc2.

I also turns out that conversion code in dapcvt.c
had a bug when handling DAP Byte type under visual studio.

Notes:
1. there may still be places I missed that need to do path conversion.
2. need to make sure that calls to e.g. H5open also use converted path.
2017-07-13 10:40:07 -06:00
Even Rouault
4779c8278f Fix undefined left shift in get_ix_int()
Getting the value of the x variable on the file corresponding to the below ncdump output
with -fsanitize=undefined raises

ncx.c:1034:14: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'

This is due to *cp being promoted to int before doing the left shift, instead
of the intended unsigned. So do the cast to unsigned internally rather than
externally

ncdump file to reproduce:

netcdf temp {
dimensions:
	x = 2 ;
	y = 2 ;
	v = 2 ;
variables:
	int x(v) ;
	byte y(y, x) ;
data:

 x = _, _ ;

 y =
  -127, -127,
  -127, -127 ;
}

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2356

Credit to OSS Fuzz
2017-06-23 12:16:53 +02:00
Even Rouault
b3418d2cd6 Fix undefined left shift in ncx_get_size_t()
Running a build on the .nc file corresponding to the below ncdump output
with -fsanitize=undefined raises

libsrc/ncx.c:4722:26: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'

This is due to *cp being promoted to int before doing the left shift, instead
of the intended unsigned. So do the cast to unsigned internally rather than
externally

ncdump file to reproduce:

netcdf temp {
dimensions:
	y = UNLIMITED ; // (0 currently)
	x = 109067 ;
variables:
	byte t(y, x, x) ;
data:
}

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2265

Credit to OSS Fuzz
2017-06-15 12:46:37 +02:00
Ward Fisher
92270070d5 Merge branch 'nc_get_filelen' of https://github.com/wkliao/netcdf-c into v4.5.0-release-branch 2017-06-09 12:50:11 -06:00
Wei-keng Liao
308c2f764e struct stat.st_size is of type off_t 2017-06-09 02:51:06 -05:00
Wei-keng Liao
6b85d54d94 typedef schar to signed char 2017-06-08 23:55:25 -05:00
Ward Fisher
b73c81697c Removed a line in configure.ac that is potentially redundant and throws an error on some systems. In support of https://github.com/Unidata/netcdf-c/issues/413 2017-06-08 12:38:43 -06:00
Wei-keng Liao
29ae0b72fe X_INT64_MIN, X_INT64_MAX, and X_UINT64_MAX should be used internally 2017-06-06 18:20:26 -05:00
Ward Fisher
f4151c97f2 Reverted changes to X_get_size_t, in order to correct an issue 2017-05-31 09:40:59 -06:00
Dennis Heimbigner
c834d4af12 merge from master 2017-05-10 12:33:03 -06:00
Ward Fisher
051bd3b81a Merge branch 'master' into open_check_vlens 2017-05-05 17:02:36 -06:00
Dennis Heimbigner
6dc6cf65ba re: issue https://github.com/Unidata/netcdf-c/issues/401
It turns out that the chunksize used in the
ncio-related code must be a multiple of eight in
size.  Both memio.c and mmapio.c were
potentially violating this constraint.

See also pr https://github.com/Unidata/netcdf-c/pull/400
2017-05-02 21:22:54 -06:00
Dennis Heimbigner
7c3164577e Finalize the compression support.
This relies on the HDF5 capability to
dynamically load compression filters.
Note that a compression filter is just
a subcase of filters.

The primary user-visible changes are as follows:
1. Add a standard header "netcdf_filter.h" that defines
   the necessary API extensions
2. Modify ncgen to support two new special attributes
   "_Filter_ID" and "_Filter_Parameters" so that compression
   can be turned on when creating a file using ncgen.
4. Add a detailed description of filtering support
   to the user's guide; see the file filters.md
5. Add a test case directory for this: nc_test4/filter_test.
   It is fragile and a ./configure flags (-enable-filter-test)
   is defined (default disabled) to shut this off this test
   to avoid spurious 'make check' failures.

Note that the HDF5 documentation is not up-to-date, so
much of what is encoded here comes from examining the
actual code in the file H5PL.c in the HDF5 source code.
2017-04-27 13:01:59 -06:00
Ward Fisher
8dddd222a3 Merged master, DAP4 support into branch. 2017-04-19 09:29:35 -06:00
Ward Fisher
b5b99cbebb Merge branch 'master' into ghpull-375 2017-04-05 16:24:55 -06:00
Wei-keng Liao
68a57832d6 enable nc_open to check the number of large variables allowed in CDF-1 and CDF-2 files 2017-04-03 22:07:36 -05:00
Dennis Heimbigner
5f15c9e777 1) master merge 2)fix uname -o problem 2017-03-30 16:21:31 -06:00
Wei-keng Liao
73ccb364a9 To solve NC_ELATEFILL error for NetCDF-4 files, mark all variables written at enddef. 2017-03-24 20:55:00 -05:00
Ward Fisher
80d2b914a1 Updates for Visual-Studio-based builds. 2017-03-16 14:34:33 -06:00
Wei-keng Liao
08aef9af5d remove special treatments for arm architecture 2017-03-11 13:33:58 -06:00
Wei-keng Liao
7aa8fc36c7 include config.h the way suggested by autoconf 2017-03-11 13:03:17 -06:00
Wei-keng Liao
af258dcec9 update for arm to use char as much as possible, instead of signed char 2017-03-10 12:00:59 -06:00
Ward Fisher
8e3790f7ce Merged master. 2017-03-09 12:53:28 -07: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
Ward Fisher
1a8e7891f0 Merge branch 'master' into master 2017-03-02 13:34:51 -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
Ward Fisher
a257db6670 Merge branch 'ghpull-319' into ghpull-319-arm 2017-02-14 10:51:53 -07:00
Ward Fisher
eec0a81437 Merge branch 'issue258' of https://github.com/wkliao/netcdf-c into ghpull-319 2017-02-14 10:51:21 -07:00
Wei-keng Liao
fc40f92fca bug fix: values stored in NC_attr.xvalue are in external representation, may need byte-swap when retrieved to a memory buffer (internal representation) 2017-02-10 17:46:26 -06:00
Ward Fisher
20721cc46b Additional work in trying to diagnose failures in nc_test. 2017-02-07 15:16:32 -07:00
Ward Fisher
e100aaf6b0 We cannot assume char is signed or unsigned. 2017-02-07 14:20:59 -07:00
Ward Fisher
6689d7a63f Adjusted behavior when casting from a signed char pointer to an unsigned type. 2017-02-03 12:21:54 -07:00
Ward Fisher
fe17747261 Corrected missing endif stanza. 2017-02-03 11:29:59 -07:00
Ward Fisher
7edb08977a Added platform checks for ARM. 2017-02-03 11:19:39 -07:00
Ward Fisher
3e5124996e Merged https://github.com/Unidata/netcdf-c/pull/319 to resolve some recently arisen conflicts, in preparation for larger merge. 2017-02-01 13:27:29 -07:00
Romero B. de S. Malaquias
dfda46a3a0 Merge branch 'master' into master 2017-01-11 09:29:40 -03:00
Romero B. de S. Malaquias
452f6e2361 Avoiding conditional directives that break statements 2017-01-10 16:46:17 -03:00
Ward Fisher
a099c974dc Deleted extraneous header file, removed extraneous . 2017-01-09 13:26:23 -07:00
Ward Fisher
5502767d98 Added code to accomodate Visual Studio 2012 in support of https://github.com/Unidata/netcdf-c/issues/304 2017-01-09 13:02:08 -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
Ward Fisher
2f3b894bec Reverted to different code in support of https://github.com/Unidata/netcdf-c/issues/344 2017-01-04 15:40:19 -07:00
Ward Fisher
59618c481b Removed stray comment. 2017-01-03 13:57:30 -07:00
Ward Fisher
c13c917835 Addressing an issue in https://github.com/Unidata/netcdf-c/issues/344 not sure if this is a fix, but why were the casts to float being used? 2017-01-03 12:21:54 -07:00
Ward Fisher
ad58e5232a Small tweak to cmakelists.txt 2017-01-03 12:10:05 -07:00
Wei-keng Liao
fe9685deb4 implement an error code precedence 2016-12-01 12:31:20 -06:00
Wei-keng Liao
340f0d2a91 Classic Format Specification says: Header padding uses null (\x00) bytes 2016-11-28 11:54:16 -06:00
Wei-keng Liao
3889617a2a bug fix: record size alignment for NC_USHORT is missing 2016-11-28 11:50:31 -06:00
Wei-keng Liao
467fded268 bug fix: record size alignment for NC_USHORT is missing 2016-11-25 10:35:43 -06:00
Wei-keng Liao
2081ae7099 add configure option --enable-relax-coord-bound for issue #243 2016-11-12 23:58:09 -06:00
Wei-keng Liao
5137be27d1 add configure/cmake option to disable erange_fill 2016-11-03 15:14:14 -05:00
Wei-keng Liao
06c1f744e8 silence gcc compile warnings when using -Wconversion 2016-10-30 00:44:28 -05:00
Wei-keng Liao
7572e1cbbf add sizeof checks for unsigned data types 2016-10-28 18:16:49 -05:00
Wei-keng Liao
309303e34e remove argument fillv for get APIs as we use default fill values for fillv 2016-10-28 10:34:51 -05:00
Wei-keng Liao
39ea0963e1 make ERANGE_FILL default 2016-10-25 15:10:25 -05:00
Wei-keng Liao
7fbde1b5bc add a new option ERANGE_FILL to use fill values when NC_ERANGE occurs; sync ncx.m4 with PnetCDF 2016-10-25 15:09:52 -05:00
Wei-keng Liao
c282d18080 add two fill value inquiry subroutines 2016-10-25 13:14:03 -05:00
Wei-keng Liao
0d24dccbd3 copy ncx.m4 from PnetCDF 2016-10-13 02:15:45 -05:00
Wei-keng Liao
df91c19f3c add NULL name check 2016-10-12 13:45:41 -05:00
Wei-keng Liao
125ca43cfb add NULL name check 2016-10-12 13:33:44 -05:00
Wei-keng Liao
8bf99abe77 silence compile warning from -Wsign-conversion 2016-10-10 00:07:24 -05:00
Wei-keng Liao
dbb9be59d2 temporally disable __arm__ for testing 2016-10-09 22:21:32 -05:00
Wei-keng Liao
f336af5474 now ncx.m4 is the same as PnetCDF's except PNETCDF is not defined 2016-10-09 21:58:43 -05:00
Wei-keng Liao
1f32277afb use ncx_get_uint32 instead of ncx_get_int_int 2016-10-06 00:43:40 -05:00
Wei-keng Liao
f6804fc5c0 handle special case when calling _uchar APIs to access NC_BYTE variables in CDF-2 file format 2016-10-06 00:42:55 -05:00
Wei-keng Liao
688ad6d218 handle special case when calling _uchar APIs to access NC_BYTE attributes in CDF-2 file format 2016-10-06 00:41:53 -05:00
Wei-keng Liao
c277853af3 use ncx_get_uint64 instead of ncx_get_int64 2016-10-06 00:39:16 -05:00
Wei-keng Liao
4b7d9fec19 add 4 new subroutines defined in ncx.m4 2016-10-06 00:37:58 -05:00
Wei-keng Liao
39b47f6d78 borrow ncx.m4 from PnetCDF 2016-10-06 00:36:54 -05: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
Dennis Heimbigner
b4dc1dca19 More cmake fixes 2016-05-07 14:32:07 -06:00
Ward Fisher
00eaa53e0b Corrected an issue preventing gcc-4.4 from compiling netcdf. 2016-04-26 21:09:41 +00:00
Ward Fisher
3c820589b7 Fixed a divide by zero error. 2016-04-12 11:04:41 -06:00
Ward Fisher
9d91a9684a Merge branch 'gh252' 2016-04-12 10:03:40 -06:00
Ward Fisher
baec7157a3 Clean up lingering 'make distcheck' errors. 2016-04-12 09:48:21 -06:00
Ward Fisher
3f773258bd Corrected an issue with hashmap and missing random() function on Windows using Visual Studio 2013 2016-04-11 16:07:27 -06:00
Ward Fisher
cc803f5c00 Merge branch 'nc3-hashmap-fix' of https://github.com/gsjaardema/netcdf-c into merge-gh246 2016-04-05 15:31:06 -06:00
Ward Fisher
33e43e15f1 Merge branch 'master' into gh240 in preparation for final merge. 2016-04-05 20:28:03 +00:00
Ward Fisher
6409b11640 Modified nc_inq_type so that it will return valid information for valid data types even if the associated ncid doesn't have access to those data types. See https://github.com/Unidata/netcdf-c/issues/240 for more information. 2016-04-05 20:13:42 +00: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
Ward Fisher
fb2ff0c24b Refactored old ENOERR code into NC_NOERR error code in libsrc. This is done in support of https://github.com/Unidata/netcdf-c/issues/213. 2016-03-07 10:58:02 -07:00
Ward Fisher
e10ad6bed8 Removing duplicated errors, in support of https://github.com/Unidata/netcdf-c/issues/213 2016-03-07 10:48:04 -07:00
Ward Fisher
b19b807e8b Working around a couple of problematic calls to fstat in support of https://github.com/Unidata/netcdf-c/issues/188 . No idea why these were a problem in VS14 (Visual Studio 2015) and not in VS12 (Visual Studio 2013). It's possible there are other, similar issues out there. We'll see what turns up when we run all the tests. These changes were tested against nc_test4/tst_large2.c 2016-03-02 13:03:29 -07:00
Ward Fisher
a81f150e88 Modified fstat call in fgrow2 to use filelengthi64 on Windows, where available. 2016-03-02 10:51:11 -07:00
Ward Fisher
fbdea5c4a0 Working in support of https://github.com/Unidata/netcdf-c/issues/188 . Exploratory work. 2016-02-29 15:08:09 -07:00
Ward Fisher
0ee9a4f59e Further cleanup of generated files. 2016-01-22 12:04:43 -07: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
Ward Fisher
023356ba9b Fixed typos. 2015-12-29 12:39:35 -07:00
Ward Fisher
cee769cc1e Converting CHAR_IS_SIGNED over to autoconf-style __CHAR_UNSIGNED__ 2015-12-28 21:27:27 +00:00
Ward Fisher
8e4a8f4225 Chasing down implicit char cast which rounds a value to 0 when a negative value is cast to a different unsigned type. 2015-12-28 20:24:56 +00:00
Ward Fisher
bd92caa176 More changes towards fixing the issue where the file is read incorrectly. 2015-12-28 17:36:05 +00:00
Ward Fisher
103863ca24 More architecture-specific fenceposting. 2015-12-24 16:42:54 +00:00
Ward Fisher
d71e9ed5f6 Fenceposting the bug fixes with __arm__ ifdefs. 2015-12-24 09:35:32 -07:00
Ward Fisher
925da14d2a Some additional errors reared up after fixing the main frustrating one. Working towards fixing them. 2015-12-24 01:37:42 +00:00
Ward Fisher
6eec405e13 Added explit cast from signed in ncx.m4 to address https://github.com/Unidata/netcdf-c/issues/159. It is likely overly broad; I will refine it once I've had a chance to read up on m4. 2015-12-23 22:16:49 +00:00
Ward Fisher
612b35a84c Merge branch 'master' into cdf-5, in preparation for merging the CDF-5 functionality into the master branch. This will be the key new feature for netcdf 4.4.0. 2015-11-05 13:40:35 -07:00
Ward Fisher
bf02ded6f4 Merge branch 'ncf344' of https://github.com/Unidata/netcdf-c into ncf344 2015-11-02 12:15:19 -07:00
Ward Fisher
acc4993b19 Changes to modified files. 2015-11-02 12:14:19 -07:00
Ward Fisher
c87d792cfc Applied the patch provided by Wei-keng Liao in support of [NCF-344]. 2015-10-30 16:45:32 +00:00
Ward Fisher
f7b7996f7e Added brackets for clarity around some code in question. 2015-10-28 11:04:34 -06:00
Ward Fisher
7c8ce85a5f Removing a couple of generated files from version control. 2015-10-22 13:03:31 -06:00
Ward Fisher
36b6230b3d Working on debugging cdf-5 branch on Windows. Currently, nctest fails. 2015-10-21 16:13:31 -06:00
Ward Fisher
5e9fe31ae7 Updating .m4 file. 2015-10-21 15:04:59 -06:00
Ward Fisher
0d1f013bb7 Removed generated ncx.c file from version control. 2015-10-21 13:41:50 -06:00
Ward Fisher
adbdf84fdb Regenerated ncx.c 2015-10-21 13:34:20 -06:00
Ward Fisher
225050c4b7 Tweaked .m4 file for a specific case. 2015-10-21 19:11:22 +00:00
Ward Fisher
4aca5795ac Regenerated source files from m4 to make things work on Windows. 2015-10-21 11:27:41 -06:00
Ward Fisher
519a56019f Merge branch 'fix-typos' of https://github.com/tbeu/netcdf-c into tbeu-fix-typos 2015-10-16 14:16:09 -06:00
Dennis Heimbigner
cd7a06b193 pull request 2015-10-12 17:09:37 -06:00
dmh
39ccdc5ee3 conflicts 2015-10-11 13:43:19 -06:00
dmh
ed57a337ec add ptrdiff_t checks 2015-10-11 13:35:44 -06:00
Ward Fisher
76621d3ae2 Regenerated files. 2015-10-09 13:06:41 -06:00
Ward Fisher
ef586766e3 Added STDIO option to CMake-based build. 2015-10-09 13:06:32 -06:00
Dennis Heimbigner
554034b712 1. Added temporary work-around for cygwin where
AC_CHECK_SIZEOF is not working because anti-virus
   will not allow very rapid creation/deletion of a
   file with same name.
2. modified some test baselines to attempt to fix
   Ward's issue
2015-10-09 10:33:40 -06:00
dmh
9f65c3b808 cleanup and squash changes vav master 2015-10-09 10:26:49 -06:00
dmh
8fc86035b2 merge-squash 2015-10-09 10:22:00 -06:00
Dennis Heimbigner
dccbc87d24 1. Added temporary work-around for cygwin where
AC_CHECK_SIZEOF is not working because anti-virus
   will not allow very rapid creation/deletion of a
   file with same name.
2. modified some test baselines to attempt to fix
   Ward's issue
2015-10-09 10:14:45 -06:00
dmh
087ae58ffd cleanup and squash changes vav master 2015-10-09 10:12:11 -06:00
dmh
49597a64af merge-squash 2015-10-09 10:12:11 -06:00
Ward Fisher
163b6575a5 Fixed a bug in 'make dist'. 2015-10-06 15:29:18 -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
720fe78ea2 Coverity: 1302444, addressed a potential negative argument being passed to memory allocation routine. 2015-09-22 15:42:52 -06:00
Ward Fisher
f1d2470776 Corrected minor null check issue reported by Coverity: 1302448 2015-09-22 15:35:30 -06:00
Ward Fisher
a8df681331 Addressed a potential null dereference bug reported by Coverity static analysis. 2015-09-22 15:31:48 -06:00
Dennis Heimbigner
a1be2456eb 1. Added temporary work-around for cygwin where
AC_CHECK_SIZEOF is not working because anti-virus
   will not allow very rapid creation/deletion of a
   file with same name.
2. modified some test baselines to attempt to fix
   Ward's issue
2015-09-15 15:18:59 -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
7aa22d275b Turned search back on in developer documentation. Applied part of fix for [NCF-340] in putget.m4 2015-09-10 15:35:14 -06:00
tbeu
e2820e4d8a Fix common typos
Detected by https://github.com/vlajos/misspell_fixer
2015-08-20 11:42:05 +02:00
dmh
b8f0522c91 add experimental stdio based ncio module 2015-08-19 17:14:13 -06:00
dmh
2bfe9bba32 cleanup and squash changes vav master 2015-08-16 21:44:18 -06:00
dmh
859f105005 merge-squash 2015-08-15 16:26:35 -06:00
dmh
fab66699d1 Moved libsrc5 to libsrcp
because pnetcdf is used for
more than CDF-5 files.
2015-08-14 20:39:56 -06:00
Russ Rew
6a6cbf4005 More clang warnings eliminated. 2015-08-02 17:19:35 -06:00
Russ Rew
ec89eb5806 Fix ncdump clang warnings. Fix invalid encodings for some non-ascii strings in tests. 2015-08-02 16:09:47 -06:00
Ward Fisher
1f5e6379e4 Fixed a memory corruption. Coverity issue: 1265729: Out-of-bounds access. 2015-07-29 14:58:34 -06:00
Ward Fisher
95cbe52b37 Additional changes to hopefully get autotools and tst_swap4b working together in service of addressing [NCF-338] 2015-07-28 13:43:15 -06:00
Ward Fisher
8f2bf0089e Some tweaks, trying to debug autotools-based build. 2015-07-28 12:38:52 -06:00
Ward Fisher
ac18154e98 Added test for function swap4b. 2015-07-27 15:31:23 -06:00
Ward Fisher
1ea348ce3d Applied patch suggested for in-place big-little-endian conversion. [NCF-338] 2015-07-27 11:09:01 -06:00
Ward Fisher
8bda7fdf67 Fleshed out comments a little more, added a specific check for older systems which return -1 instead of bytes read when the read() call is interrupted and errno is EINTR. 2015-07-21 14:08:44 -06:00
Ward Fisher
7164a99cbc Added some comments. 2015-07-21 14:00:37 -06:00
Ward Fisher
382b24c2c9 Addressing a signal-interrupted read which sets errno to EINTR [NCF-337] 2015-07-21 13:55:59 -06:00
Ward Fisher
39c9d10ede Removed a stray debugging message. 2015-06-18 14:37:31 -06:00
Ward Fisher
952b73e51e Modified how m4 is detected/handled, made it less a straight platform check. 2015-06-11 14:28:39 -06:00
Ward Fisher
bb42e4639e Addressed conflict between master, mem2. 2015-06-02 15:03:12 -06:00
Dennis Heimbigner
0d082d79ea synch oc 2015-05-29 17:31:42 -06:00
dmh
dbc7215063 1. fix nc_open_mem doxygen description
2. fix some bugs wrt to cygwin vs linux.
3. add to RELEASE_NOTES
4. try to fix tst_inmemory fd error by putting the first
   arg to dotest in quotes.
2015-05-28 19:23:33 -06:00
Ward Fisher
64e0d2a44e Added a new test for h4 endianness. [NCF332] 2015-05-28 17:13:15 -06:00
dmh
3dd807a155 The original mem branch somehow got
hosed, so I rebuilt it as a new mem2 branch.
2015-05-28 15:10:10 -06:00
Ward Fisher
6ed4770e0a Added a typedef int pid_t for Windows platforms, solves a unix compatibility issue. 2015-05-28 10:14:45 -06:00
dmh
c2f880f0f3 conflicts 2015-05-16 15:53:48 -06:00
dmh
ab5022256d need to set -e many of the .sh programs 2015-05-16 15:46:39 -06:00
Ward Fisher
fa1d61b980 Additional debugging for [NCF-331] 2015-05-12 13:52:52 -06:00
Ward Fisher
0d8be16398 Removed some debugging stanzas. 2015-05-08 14:02:11 -06:00
Ward Fisher
b7289cdfa4 Further debugging for [NCF-330]. Making decent progress using the debug flags Microsoft provides. See JIRA issue for links to documentation describing these flags. 2015-05-08 14:02:11 -06:00
Ward Fisher
211806b89f Merge branch 'master' of https://github.com/posophe/netcdf-c into posophe-master 2015-04-22 14:37:28 -06:00
Ward Fisher
c366bec8b3 Activated a couple new tests on MSVC builds when bash is available. 2015-04-20 16:06:20 -06:00
posophe
327731852e correct casting 2015-04-18 13:09:46 +02:00
Ward Fisher
6009ccef7e Trimmed some unnecessary files. 2015-04-13 01:42:49 -06:00
Ward Fisher
9043ae3644 Corrected several static-analysis reported issues. 2015-03-11 14:48:43 -06:00
Ward Fisher
017f196628 Added the [NCF-326] test to CMake build system. 2015-03-10 09:53:13 -06:00
dmh
06a11e51df 1. Allow for the user specified rc file via the env variable
NCRCFILE.  Note that the value of this environment
   variable should be the absolute path of the rc file, not
   the path to its containing directory.
2015-03-03 20:17:27 -07:00
Ward Fisher
9c87a7466b Corrected a sloppy error on my part. 2015-02-23 15:58:30 -07:00
Ward Fisher
a8494773f8 Addressed an 'unallocated memory' warning generated by clang. 2015-02-23 13:38:18 -07:00
dmh
f423f27693 Sync with oc project.
This supports better authorization
handling for DAP requests, especially redirection
based authorization. I also added a new test case
ncdap_tests/testauth.sh.

Specifically, suppose I have a netrc file /tmp/netrc
containing this.
    machine uat.urs.earthdata.nasa.gov login xxxxxx password yyyyyy
Also suppose I have a .ocrc file containing these lines
    HTTP.COOKIEJAR=/tmp/cookies
    HTTP.NETRC=/tmp/netrc
Assume that .ocrc is in the local directory or HOME.

Then this command should work (assuming a valid login and password).
    ncdump -h "https://54.86.135.31/opendap/data/nc/fnoc1.nc"
2014-12-24 10:22:47 -07:00
Ward Fisher
f9fa4793c2 Revert "Corrected several static analysis issues related to potential null pointer dereferences and memory leaks."
This caused problems with large file support.  Reverting, will examine more closely and attempt a different fix.

This reverts commit 074603293f.
2014-12-09 11:49:32 -07:00
Rob Latham
af4eb0fb1d sync lines for generated C files
m4 can emit 'sync lines' which tell the toolchain "hey, this code
actually came from this other file over here".  Should help prevent
anyone accidentally editing a generated file.
2014-12-05 12:55:49 -06:00
Rob Latham
3b61804ff7 fix m4 dealing with split lines
Wei-keng Liao fixed this for pnetcdf. See pnetcdf revision 1904.
2014-12-05 12:55:38 -06:00
Ward Fisher
074603293f Corrected several static analysis issues related to potential null pointer dereferences and memory leaks. 2014-11-11 15:05:55 -07: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
52189b7725 Corrected an an issue where memcpy might be passed a NULL destination buffer. 2014-10-01 16:31:57 -06:00
Ward Fisher
461c96cdbe Fixed a clang-reported NULL pointer dereference issue. 2014-09-30 11:30:00 -06:00
Ward Fisher
9b1eb01923 Modified comment to adhere to doxygen format. 2014-09-18 13:31:30 -06:00
Ward Fisher
056de3f69d Corrected a logic error introduced in previous commit. 2014-08-27 15:40:41 -06:00
Ward Fisher
dac65bdab8 Removed a commented-out block of code. 2014-08-27 14:40:40 -06:00
Ward Fisher
4286822b91 Moved lseek call out of assert statement into an explicit check. JIRA NCF-312. 2014-08-27 14:26:54 -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
7f812b367e Manual merge of pull request https://github.com/Unidata/netcdf-c/pull/64 contributed by nschloe. Assorted CMake improvements. 2014-06-11 15:51:31 -06:00
Ward Fisher
05aaa4b376 Renamed man4 directory to docs. 2014-05-21 14:40:39 -06:00
Ward Fisher
44fae42214 Cleaned up indentation, white space in multiple CMakeLists.txt files. 2014-04-21 11:15:33 -06:00
Russ Rew
4a90e9a888 Change assertions that indicate file corruption into error status return. 2014-04-16 08:04:00 -06:00
Dennis Heimbigner
576cd84754 Merge branch 'master' of https://github.com/Unidata/netcdf-c 2014-03-29 13:36:02 -06:00
Dennis Heimbigner
4e68a3b8d3 add some jna personal scripts 2014-03-29 13:35:52 -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
Quincey Koziol
4bfd9b27a0 Merge remote-tracking branch 'upstream/master'
Conflicts:
	libdap2/common34.c
	oc2/ocutil.c
2014-02-11 17:26:09 -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
Ward Fisher
5600bd327e Updated CMake file. 2014-02-06 11:35:35 -07:00
Ward Fisher
7786b78cfc Reorganized Windows includes. 2014-02-04 11:10:27 -07:00
Ward Fisher
c1407c3239 Removed stray debugging message. 2014-02-03 14:42:56 -07: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
dmh
582410a407 [NCF-273]/HZY-708311
Add a new function called nc_inq_format_extended that
returns more detailed format information (vis-a-vis
nc_inq_format) about an open dataset.

Note that the netcdf API will present the file as if it had
the format specified by nc_inq_format.  The true file
format, however, may not even be a netcdf file; it might be
DAP, HDF4, or PNETCDF, for example. This function returns
that true file type.  It also returns the effective mode for
the file.

signature: nc_inq_format_extended(int ncid, int* formatp, int* modep)
where
* ncid is the NetCDF ID from a previous call to nc_open() or
  nc_create().
* formatp is a pointer to a location for returned true format.
* modep is a pointer to a location for returned mode flags.

Refer to the actual list in the file netcdf.h to see the
currently defined set.

Also added test cases (tst_formatx*).
2013-12-22 12:53:20 -07:00
Ward Fisher
b3388178b4 Corrected a double-free issue reported by Coverity. 2013-12-17 15:54:14 -07: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
Ward Fisher
5566cbb772 Added a check for _filelengthi64 in configuration. When found, this will be used instead of fstat when computing file length. 2013-11-04 12:58:33 -07:00
Ward Fisher
bda59030cb Replaced call to fstat with call to filelength, on apropriate system. 2013-11-01 16:30:33 -06:00
Ward Fisher
3a4d8252c3 Corrected an issue on OSX 'Mavericks'. 2013-10-21 17:39:13 -06:00
Ward Fisher
e636881aa7 Debugging an issue with LFS tests on Windows. 2013-09-03 14:22:55 -06:00
Ward Fisher
dae5e2f697 Added a short copyright message at head of a couple CMakeLists files; this will be propegated to the others.
Updated version in configure.ac to 4.3.1-rc2.
2013-08-15 09:43:59 -06:00
Ward Fisher
85465d8c10 Added stanza to only invoke m4 in non-MSVC environments. 2013-08-13 15:57:53 -06:00
Ward Fisher
43532c4193 Updated revision to rc2.
Refactored CMakeLists.txt in libsrc to generate, install netcdf.3 man page.
2013-08-13 15:42:45 -06:00
Ward Fisher
d91aa28110 Corrected a couple resource leak issues reported by Coverity static analysis. 2013-08-09 16:19:45 -06:00
Dennis Heimbigner
b85d3568ec Added the necessary code to support
group renaming. The primary API
is 'nc_rename_grp(int grpid, const char* name)'.
No test cases provided yet.
This also required adding a rename_grp entry
to the dispatch tables.
2013-07-19 21:48:37 +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
Ward Fisher
33d3d06971 Added initial 'make dist', 'make distcheck' support to
CMake-based builds.
2013-06-03 16:42:04 +00:00
Russ Rew
946a7ab8b5 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-05-31 20:18:18 +00:00
Ward Fisher
da16fc1cde Fixed an issue with Windows builds
not compiling due to how
ssize_t was being detected/defined.
2013-05-24 21:19:07 +00:00
Dennis Heimbigner
c659633d2e merge from trunk 2013-03-26 16:45:02 +00:00
Dennis Heimbigner
4b7817e69e Return EACCES instead of NC_EMETADATA when failing to create an HDF5 file 2013-03-26 16:31:56 +00:00
Ward Fisher
89ea9a4631 Added include for Windows in order to make use of alloca. 2013-03-25 21:02:11 +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
Ward Fisher
f26a4a559a Merged latest from netcdf-cmake branch.
Addressed several cmake-related issues, in terms of
building on Windows.  Also added XGetopt.c to 
EXTRA_dist in Makefile.am files.
2013-03-19 22:40:15 +00:00
Dennis Heimbigner
dea3c726c8 merge trunk into this branch 2013-03-15 20:31:07 +00:00
Dennis Heimbigner
9eaac2a595 Apply Wei-Keng's fix
for JIRA issue NCF-241.
This is only temporary
until I can make pnetcdf
operate as a separate dispatch table.

Also, fix nc_test4/tst_pnetcdf
to open with nc_open_par;
this is necessary because a pnetcdf
created file cannot be opened
as a netcdf classic file.
2013-03-13 17:34:47 +00:00
Dennis Heimbigner
c18c90b012 removed some unused local variables 2013-03-12 20:45:58 +00:00
Ward Fisher
c23a97dd7f Fixed a windows-related issue (required malloc.h include),
update documentation related to netcdf for Windows.
2013-03-11 22:45:26 +00:00
Russ Rew
4b89b3c392 Applied Wei-keng Liao's patch for fixing bug NCF-234, fixing variable offsets in files created by pnetcdf but rewritten by calling nc_enddef. 2013-03-10 01:09:06 +00:00
Dennis Heimbigner
80cf3a2c75 fix typo in previous checkin 2013-03-08 18:27:45 +00:00
Dennis Heimbigner
841f7c7148 Move onstack.h from libsrc
to include because it is used
both in libsrc and libdispatch
2013-03-08 18:08:11 +00:00
Ward Fisher
0444a6c711 Fixed a couple of tests on Windows,
Fixed some compile errors on Windows.
2013-02-21 23:56:15 +00:00
Ward Fisher
ddf3c31bb0 Corrected a handful of syntax issues in CMake config files,
probably introduced more.  

Added CMake-related files to Makefile.am files for inclusion
when creating a distribution package.
2013-02-20 23:28:28 +00:00
Ward Fisher
21523c8582 Merged changes from cmake branch. oc2 changes are just
'file property' changes, not sure what exactly.
2012-12-20 21:50:45 +00:00
Dennis Heimbigner
5f2eb8afbf Fix a number of potential problems by changing calls to nc_XXX to NC3/4_XXX 2012-12-12 20:05:06 +00:00
Ward Fisher
81280c7878 Merge from latest netcdf-cmake branch.
- Fixes for Windows.
- CMake-based changes (functionality, tests).
- Smattering of coverity-informed bug-fixes.
2012-12-05 18:35:42 +00:00
Russ Rew
f8ec45d20d Fix NCF-209, bug causing netcdf-fortran build to get assertion violation in 'make check' 2012-12-03 21:15:30 +00:00
Dennis Heimbigner
a53682fc66 fix Jira NCF-207: double call to del_from_NCLIST 2012-11-21 17:52:49 +00:00