netcdf 4.1.2 (reduced)

Extract upstream netcdf using the following shell code.

v=4.1.2 &&
sha1=ef42419b2afd99364e470813bc5b922a1a72a6de &&
sha1sum netcdf-$v.tar.gz |grep $sha1 &&
tar xvzf netcdf-$v.tar.gz &&
paths='
 COPYRIGHT
 README
 RELEASE_NOTES
 config.h.in
 cxx
 include
 libdispatch
 liblib
 libsrc
 libsrc4
' &&
excludes='
  --exclude=Makefile.*
' &&
mkdir netcdf-$v-reduced &&
(cd netcdf-$v && tar $excludes -c $paths) |
(cd netcdf-$v-reduced && tar x && chmod a-x */*.c */*.h)

Change-Id: Iddd737ab336b4d90e40024dabea3dd237eeec7bc
vtknetcdf: Prepare for new netcdf source import

Remove netcdf sources to make room for new import.  Add .gitattributes
to tell Git not to check whitespace in the third-party sources of
NetCDF.  Empty the "vtk_netcdf_mangle.h" symbol list.  Rename our
README.txt to README-VTK.txt to clarify its purpose.

Change-Id: Ic41d4576199a2957d20f2bac2c0d6da388eada0b
Merge branch 'netcdf-upstream' into vtknetcdf-cleanup

Change-Id: Id2f5e04f6416615bfe979763c8d6caad31870455
vtknetcdf: Update README-VTK instructions to update NetCDF

Add instructions to update from upstream NetCDF by using the
netcdf-upstream snapshot branch to merge the changes cleanly.

Change-Id: Icc80a46513d1b14798dfb6d3f8cffd3903d752ca
vtknetcdf: Put public interface configuration in dedicated header

Configure a "vtk_netcdf_config.h" header with the information needed in
the public interface headers.  Leave private (build-only) configuration
values in "config.h" and make sure its location comes first in the
include path.

Change-Id: Ia7084488e00703c319e95793121f1f2683af7595
vtknetcdf: Fix size_t v. long usage in C++ bindings

Port fix from commit 6223f230 (NetCDF cpp bindings have mixed long and
size_t usage, 2010-12-21) forward to the new netcdf import.

Change-Id: I1ec536c7d23f9bedbfadae8ce5892b8be59aa93d
vtknetcdf: Suppress warnings on GNU, Borland, and MSVC

Port warning suppression pragma changes from

 commit 2a9006cb (Silence some very common Borland compiler warnings, 2007-08-28)
 commit 6c9ad7e1 (Suppress 2 warnings on MSVC7.1 and eliminate the rest, 2007-08-30)
 commit 3d2799ce (Suppress warning generated by string constant in assertion, 2007-08-31)
 commit b427d72b (Eliminate warnings. Suppress warning about string constant in an assert, 2007-08-31)
 commit 4c746576 (Suppress warnings for multiple versions of the compiler, 2007-09-01)
 commit 2a9183c6 (Eliminate compiler warnings on the 64-bit Windows, 2008-04-25)
 commit 6a3e9cb8 (Cleanup many warnings reported by gcc, 2010-08-18)
 commit a0178524 (Backport compiler and warnings fixes from old netcdf, 2011-11-29)

forward to new netcdf import.

Change-Id: Ie6d278a5e2eb3005bed13ffdc99a41ce0bca749f
vtknetcdf: Add missing POSIX permission bits for Borland

Port fix from commit 1840b1d9 (Define POSIX permission bits when they
aren't otherwise, 2006-11-29) forward to new netcdf import.

Change-Id: Icb9ade4225f9114e36d49452b0f094dfcf9db18f
vtknetcdf: Add DLL export markup to C++ interface

Port dllexport markup changes from

 commit be660f46 (Try to fix MSVC8 link errors, 2007-08-28)
 commit 891bd2cb (Try again to get ncerr, ncopt working on Windows, 2007-08-28)
 commit 5c10a46e (Add dll exports for C++ version of netcdf, 2010-08-16)

forward to new netcdf import.

Change-Id: I3dd4894213adb60b38f87061172253802599b5dc
vtknetcdf: Define 'uint' for internal use by netcdf sources

Move the typedef out of the public "netcdf.h" header where it is not
needed and was defined only for DLLs on Windows.  Add it to the
private "ncx.h" header instead.  This makes the type available for
use by "putget.c" and "ncx.c".

Change-Id: Iedbc3e007db74aa39f429667685bb9c7e125e68a
vtknetcdf: Fix a few errors and warnings from MSVC

Avoid including headers not available under MSVC.  Use alternative
definitions for fixed-size integer types.  Do not declare a new variable
after a statement in C code.  Do not specify 'extern' linkage for
definition of NC4_inq_grpname_full.  Include sys/types.h and nc.h before
netcdf.h.

Port these fixes from

 commit e8981b99 (Include nc.h in v2c.i for case when sizeof(size_t)!=size(long), 2006-12-06)
 commit 26cb3a8c (Reorder includes to avoid MSVC problems, 2006-12-06)
 commit 30e8a553 (Try to placate MSVC again, this time Win64-Vista-MSVC8, 2007-09-01)
 commit 97a3321d (Add try compiles for stdint.h inttypes.h and stdbool.h, 2010-08-13)
 commit 6562eaae (Add a definition for SIZE_MAX if not defined, 2010-08-23)
 commit 9ddcd35c (Make it compile on VisStudio2008 express, 2011-11-29)

to new netcdf import.

Change-Id: Ia56f55e8e8487156604272214d6c8629eaf381e2
vtknetcdf: Restore fix for obscure netcdf4 bug in 64-bit build

Port fix from commit f9305772 (Fix obscure bug in 64 bit netcdf4,
2011-12-19) forward to new import.

Change-Id: Id903c0b3b28d5d18a430c7f17ad32a83aaddffed
vtknetcdf: Include vtk_hdf5.h instead of hdf5.h

This ensures we get the same HDF5 that VTK uses.

Change-Id: I3181b82ead7bba4dc7219b19ed9a0156a45c5bac
vtknetcdf: Remove unused 'found' variable from NC4_inq

Change-Id: Ie45e4e9b8a0f3b02a49a3f99c3c27b6f6552f071
vtknetcdf: Use curlys to make if/if/else unambiguous

Change-Id: I8d0f210f7e53defdfe9bc15c800de29360cb6498
vtknetcdf: Use casts for lossy conversions in ncx get/put

Port casts added by

 commit 68116f59 (Cleanup warnings on Windows, 2010-08-17)
 commit f5d8c3a1 (Eliminate beleriand (nmake71) warnings, 2007-08-29)
 commit 6c9ad7e1 (Suppress 2 warnings on MSVC7.1 and eliminate the rest, 2007-08-30)

to the new netcdf import.

Change-Id: I590d414ed8b4220cfab148f1dedbccdbf0ff6ef6
vtknetcdf: Fix includes and warnings from Borland

Port fixes from

 commit 4965c8be (Eliminate warnings from dashboard builds, 2006-11-30)
 commit a0178524 (Backport compiler and warnings fixes from old netcdf, 2011-11-29)

to new netcdf import.

Change-Id: If7d414a592933a3586378368815e73d4799e8882
vtknetcdf: Fix size_t consistency

Fix local variable types and add casts to avoid size_t conversion
warnings.  Port fixes from

 commit 68116f59 (Cleanup warnings on Windows, 2010-08-17)

to new netcdf import.

Change-Id: Ifd0eb842f464cdb192c1d7786e8b34e438f56289
vtknetcdf: Handle all enumeration values in switch

Port one fix from commit be243252 (Fixed a bunch of "enumerant not
handled in switch statement" warnings, 2006-11-29) to new netcdf import.

Change-Id: Ib5410540b2ae72f34235b5063edab6af7a849478
vtknetcdf: Fix NULL filename case in NC_check_file_type

Port fix from commit 1ed55f13 (Handle case of null filename, 2011-12-08)
to new netcdf import.

Change-Id: I00fc17789feb22adacce2fd762034ec32dfdcf49