Eliminated (undefined) signed integer overflow

clang ubsan warned running some of the 'EnSightBlow' tests:

IO/EnSight/vtkEnSight6BinaryReader.cxx:2823:15: runtime error: signed integer overflow: -1358823424 * 4 cannot be represented in type 'int'

I just upcast to 64 bit so that the multiplication doesn't overflow.
The tests now pass with the ubsan check.

I have subtly changed the behaviour here, but believe the
intent is preserved.

Change-Id: I0a35789c169204f04d2a683a029e992e9b20ca65
Initialize ivars to 0 to prevent access of uninitialized data

With -fsanitize=signed-integer-overflow, the test
'vtkIOXMLPython-TestEmptyXML' gives:

IO/XML/vtkXMLPStructuredDataReader.cxx:62:35: runtime error: signed integer overflow: 591396864 * -536868871 cannot be represented in type 'int'

The reason being that 'PointDimensions' was never set and so contained
random values that happened to be pretty big. There probably should
be some better error checking somewhere, but it seems a good
defence to zero these things anyway, in case a client of the class
(incorrectly) invokes a method that accesses the uninitialized data,
at least we'll get consistent results.

Change-Id: I77f5ac68d4edad632931667ddf5e87f930f48b3f
Changed computations to uint64 to prevent signed overflow

With clang's -fsanitize=signed-integer-overflow, the test
'vtkFiltersGeneralCxx-TestYoungsMaterialInterface' gives:

IO/Geometry/vtkAVSucdReader.cxx:302:34: runtime error: signed integer overflow: 16 * 504823808 cannot be represented in type 'int'
IO/Geometry/vtkAVSucdReader.cxx:302:60: runtime error: signed integer overflow: 4 * 2019295232 cannot be represented in type 'int'
IO/Geometry/vtkAVSucdReader.cxx:303:35: runtime error: signed integer overflow: 12 * -1340538880 cannot be represented in type 'int'
IO/Geometry/vtkAVSucdReader.cxx:313:35: runtime error: signed integer overflow: 369098752 * 2019295248 cannot be represented in type 'int'

This code tries to guess endianness, and when it's wrong it
ends up multiplying large numbers, resulting in signed overflow.
Fix is to do computations as uint64, which may still overflow,
but at least unsigned overflow is defined to wrap.

Did other misc cleanup too. Notably, the code could go into an
infinite loop trying big then little endianness over and over
again if a file is corrupt.

Change-Id: I2b7d84dae275386dcd87fa496b7916945284bc30
Eliminated (undefined) negation of INT_MIN

clang ubsan warned running vtkRenderingAnnotationCxx-TestCubeAxes2DMode:

Rendering/Annotation/vtkCubeAxesActor.cxx:1315:30: runtime error: negation of -2147483648 cannot be represented in type 'int'

This happens when 'range' is exactly 0.0, and so log10() gives -infinity,
which when cast to int (apparently) becomes INT_MIN which cannot
be negated due to the asymmetry of two's compliment representation.

Now, check log10() result with newly-created vtkMath::IsFinite API.
If the result is not finite, return 0 from vtkCubeAxesActor::Digits(),
which I'm not sure is the correct thing to return.

Change-Id: I36fc832df98ccb96c1fdc951c42e7e2c6de9d4b4
Merge topic 'sanitize-signed-integer-overflow' into master

38f76b82 Eliminated (undefined) negation of INT_MIN
07cd3906 Changed computations to uint64 to prevent signed overflow
743dc8aa Initialize ivars to 0 to prevent access of uninitialized data
e29cc816 Eliminated (undefined) signed integer overflow
Module macros cleanup.

Projects sometimes want to add modules directly i.e. have the vtk_module(..) and
vtk_module_library(..) calls directly added in the same CMakeLists.txt file
without using a module.cmake at all. This is needed especially for modules that
tend to depend on "all enabled" modules. This change ensures that
vtkModuleMacros work even when module.cmake is missing.

Change-Id: I11122a330cb31b3f8785435fddd44d44df9bd236
Merge topic 'extend_modules' into master

8a045b49 Module macros cleanup.
Fixed isnan compile error on some platforms

Add #include <math.h> to find C99 functions.
Thanks to David Gobbi.

Change-Id: Ia88708ab43fa5b4f26801449bbd910013077868f
Merge topic 'isnan-compile-fix' into master

ed8e013e Fixed isnan compile error on some platforms
Fixed (undefined) use of null object.

Added test against null, which was already being done
in the 'enabling' branch.

Caught by clang's ubsan.

Change-Id: I6ecb400103020b54dda18bd7062f43ba82854ac3
Fixed (undefined) use of null object.

Changed a probable typo from: newLines to newPolys

Caught by clang's ubsan.

Change-Id: I9a4a2aefb2d118d23bd0adb54a3332abc1eb500e
Merge topic 'sanitize-null' into master

fb8c7848 Fixed (undefined) use of null object.
6ffd3241 Fixed (undefined) use of null object.