Commit fcd6444a authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'simplify-integer-type-selection'

3b89e771 Drop support for compilers without `long long`
36bb09a7 Drop support for compilers with `__int64` as the only 64-bit int
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Berk Geveci's avatarBerk Geveci <berk.geveci@kitware.com>
Merge-request: !981
parents 912eb02f 3b89e771
......@@ -7,94 +7,7 @@ CHECK_TYPE_SIZE(char VTK_SIZEOF_CHAR)
CHECK_TYPE_SIZE(short VTK_SIZEOF_SHORT)
CHECK_TYPE_SIZE(float VTK_SIZEOF_FLOAT)
CHECK_TYPE_SIZE(double VTK_SIZEOF_DOUBLE)
CHECK_TYPE_SIZE("long long" VTK_SIZEOF_LONG_LONG)
CHECK_TYPE_SIZE("__int64" VTK_SIZEOF___INT64)
IF(VTK_SIZEOF___INT64)
# In CMake 2.6 and above the type __int64 may have been found only
# due to inclusion of a system header. Further try-compiles using
# the type should include the header too.
SET(_HAVE_DEFS)
FOREACH(def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H)
IF(${def})
LIST(APPEND _HAVE_DEFS -D${def})
ENDIF()
ENDFOREACH()
IF(NOT DEFINED VTK_TYPE_SAME_LONG_AND___INT64)
MESSAGE(STATUS "Checking whether long and __int64 are the same type")
TRY_COMPILE(VTK_TYPE_SAME_LONG_AND___INT64
${VTK_BINARY_DIR}/CMakeTmp
${VTK_CMAKE_DIR}/vtkTestCompareTypes.cxx
COMPILE_DEFINITIONS
-DVTK_TEST_COMPARE_TYPE_1=long
-DVTK_TEST_COMPARE_TYPE_2=__int64
${_HAVE_DEFS}
OUTPUT_VARIABLE OUTPUT)
IF(VTK_TYPE_SAME_LONG_AND___INT64)
MESSAGE(STATUS "Checking whether long and __int64 are the same type -- yes")
SET(VTK_TYPE_SAME_LONG_AND___INT64 1 CACHE INTERNAL "Whether long and __int64 are the same type")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
"Determining whether long and __int64 are the same type "
"passed with the following output:\n"
"${OUTPUT}\n")
ELSE()
MESSAGE(STATUS "Checking whether long and __int64 are the same type -- no")
SET(VTK_TYPE_SAME_LONG_AND___INT64 0 CACHE INTERNAL "Whether long and __int64 are the same type")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Determining whether long and __int64 are the same type "
"failed with the following output:\n"
"${OUTPUT}\n")
ENDIF()
ENDIF()
IF(VTK_SIZEOF_LONG_LONG)
IF(NOT DEFINED VTK_TYPE_SAME_LONG_LONG_AND___INT64)
MESSAGE(STATUS "Checking whether long long and __int64 are the same type")
TRY_COMPILE(VTK_TYPE_SAME_LONG_LONG_AND___INT64
${VTK_BINARY_DIR}/CMakeTmp
${VTK_CMAKE_DIR}/vtkTestCompareTypes.cxx
COMPILE_DEFINITIONS
-DVTK_TEST_COMPARE_TYPE_1=TYPE_LONG_LONG
-DVTK_TEST_COMPARE_TYPE_2=__int64
${_HAVE_DEFS}
OUTPUT_VARIABLE OUTPUT)
IF(VTK_TYPE_SAME_LONG_LONG_AND___INT64)
MESSAGE(STATUS "Checking whether long long and __int64 are the same type -- yes")
SET(VTK_TYPE_SAME_LONG_LONG_AND___INT64 1 CACHE INTERNAL "Whether long long and __int64 are the same type")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
"Determining whether long long and __int64 are the same type "
"passed with the following output:\n"
"${OUTPUT}\n")
ELSE()
MESSAGE(STATUS "Checking whether long long and __int64 are the same type -- no")
SET(VTK_TYPE_SAME_LONG_LONG_AND___INT64 0 CACHE INTERNAL "Whether long long and __int64 are the same type")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Determining whether long long and __int64 are the same type "
"failed with the following output:\n"
"${OUTPUT}\n")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
# Enable the "long long" type if it is available. It is standard in
# C99 and C++03 but not in earlier standards.
SET(VTK_TYPE_USE_LONG_LONG)
IF(VTK_SIZEOF_LONG_LONG)
SET(VTK_TYPE_USE_LONG_LONG 1)
ENDIF()
# Enable the "__int64" type if it is available and unique. It is not
# standard.
SET(VTK_TYPE_USE___INT64)
IF(VTK_SIZEOF___INT64)
IF(NOT VTK_TYPE_SAME_LONG_AND___INT64)
IF(NOT VTK_TYPE_SAME_LONG_LONG_AND___INT64)
SET(VTK_TYPE_USE___INT64 1)
ENDIF()
ENDIF()
ENDIF()
IF(NOT DEFINED VTK_TYPE_CHAR_IS_SIGNED)
MESSAGE(STATUS "Checking signedness of char")
......
......@@ -193,6 +193,7 @@ SET(Module_SRCS
vtkIntArray.cxx
vtkLargeInteger.cxx
vtkLongArray.cxx
vtkLongLongArray.cxx
vtkLookupTable.cxx
vtkMappedDataArray.txx
vtkMath.cxx
......@@ -231,6 +232,7 @@ SET(Module_SRCS
vtkUnsignedCharArray.cxx
vtkUnsignedIntArray.cxx
vtkUnsignedLongArray.cxx
vtkUnsignedLongLongArray.cxx
vtkUnsignedShortArray.cxx
vtkVariantArray.cxx
vtkVariant.cxx
......@@ -300,14 +302,6 @@ if(vtkCommonDataModel_ENABLED)
PROPERTY COMPILE_DEFINITIONS vtkCommonDataModel_ENABLED)
endif()
# __int64 seems to be platform specific, turning on if
if(HAVE_VTK_SIZEOF__INT64)
list(APPEND Module_SRCS
vtkUnsigned__Int64Array.cxx
vtk__Int64Array.cxx
)
endif()
if(WIN32)
# TODO: VTK_USE_X was once tested here but is now in another module
list(APPEND Module_SRCS
......@@ -403,18 +397,6 @@ set_source_files_properties(
OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vtkUnicodeCaseFoldData.h
)
if(VTK_TYPE_USE_LONG_LONG)
list(APPEND Module_SRCS
vtkLongLongArray.cxx
vtkUnsignedLongLongArray.cxx
)
endif()
if(VTK_TYPE_USE___INT64)
list(APPEND Module_SRCS vtk__Int64Array.cxx)
list(APPEND Module_SRCS vtkUnsigned__Int64Array.cxx)
endif()
# Configure data arrays for platform-independent fixed-size types.
# Match the type selection here to that in vtkType.h.
if(VTK_TYPE_CHAR_IS_SIGNED)
......@@ -435,11 +417,6 @@ else()
if(VTK_SIZEOF_LONG MATCHES "^8$")
set(VTK_TYPE_NATIVE_Int64 Long)
set(VTK_TYPE_NATIVE_UInt64 UnsignedLong)
else()
if(VTK_SIZEOF___INT64 MATCHES "^8$")
set(VTK_TYPE_NATIVE_Int64 __Int64)
set(VTK_TYPE_NATIVE_UInt64 Unsigned__Int64)
endif()
endif()
endif()
set(VTK_TYPE_NATIVE_Float32 Float)
......
......@@ -23,6 +23,7 @@
#include "vtkInformation.h"
#include "vtkIntArray.h"
#include "vtkLongArray.h"
#include "vtkLongLongArray.h"
#include "vtkMath.h"
#include "vtkMinimalStandardRandomSequence.h"
#include "vtkShortArray.h"
......@@ -32,6 +33,7 @@
#include "vtkUnsignedCharArray.h"
#include "vtkUnsignedIntArray.h"
#include "vtkUnsignedLongArray.h"
#include "vtkUnsignedLongLongArray.h"
#include "vtkUnsignedShortArray.h"
#include "vtkVariantArray.h"
#include "vtkInformationVector.h"
......@@ -42,16 +44,6 @@
#include "vtkNew.h"
#include "vtkUnicodeString.h" // for vtkSuperExtraExtendedTemplateMacro
#if defined(VTK_TYPE_USE_LONG_LONG)
# include "vtkLongLongArray.h"
# include "vtkUnsignedLongLongArray.h"
#endif
#if defined(VTK_TYPE_USE___INT64)
# include "vtk__Int64Array.h"
# include "vtkUnsigned__Int64Array.h"
#endif
#include <algorithm>
#include <iterator>
#include <set>
......@@ -359,21 +351,11 @@ vtkAbstractArray* vtkAbstractArray::CreateArray(int dataType)
case VTK_UNSIGNED_LONG:
return vtkUnsignedLongArray::New();
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_LONG_LONG:
return vtkLongLongArray::New();
case VTK_UNSIGNED_LONG_LONG:
return vtkUnsignedLongLongArray::New();
#endif
#if defined(VTK_TYPE_USE___INT64)
case VTK___INT64:
return vtk__Int64Array::New();
case VTK_UNSIGNED___INT64:
return vtkUnsigned__Int64Array::New();
#endif
case VTK_FLOAT:
return vtkFloatArray::New();
......
......@@ -89,18 +89,10 @@ vtkArray* vtkArray::CreateArray(int StorageType, int ValueType)
return vtkDenseArray<long>::New();
case VTK_UNSIGNED_LONG:
return vtkDenseArray<unsigned long>::New();
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_LONG_LONG:
return vtkDenseArray<long long>::New();
case VTK_UNSIGNED_LONG_LONG:
return vtkDenseArray<unsigned long long>::New();
#endif
#if defined(VTK_TYPE_USE___INT64)
case VTK___INT64:
return vtkDenseArray<__int64>::New();
case VTK_UNSIGNED___INT64:
return vtkDenseArray<unsigned __int64>::New();
#endif
case VTK_FLOAT:
return vtkDenseArray<float>::New();
case VTK_DOUBLE:
......@@ -139,18 +131,10 @@ vtkArray* vtkArray::CreateArray(int StorageType, int ValueType)
return vtkSparseArray<long>::New();
case VTK_UNSIGNED_LONG:
return vtkSparseArray<unsigned long>::New();
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_LONG_LONG:
return vtkSparseArray<long long>::New();
case VTK_UNSIGNED_LONG_LONG:
return vtkSparseArray<unsigned long long>::New();
#endif
#if defined(VTK_TYPE_USE___INT64)
case VTK___INT64:
return vtkSparseArray<__int64>::New();
case VTK_UNSIGNED___INT64:
return vtkSparseArray<unsigned __int64>::New();
#endif
case VTK_FLOAT:
return vtkSparseArray<float>::New();
case VTK_DOUBLE:
......
......@@ -240,19 +240,13 @@ VTK_BYTE_SWAP_IMPL(char)
VTK_BYTE_SWAP_IMPL(short)
VTK_BYTE_SWAP_IMPL(int)
VTK_BYTE_SWAP_IMPL(long)
VTK_BYTE_SWAP_IMPL(long long)
VTK_BYTE_SWAP_IMPL(signed char)
VTK_BYTE_SWAP_IMPL(unsigned char)
VTK_BYTE_SWAP_IMPL(unsigned short)
VTK_BYTE_SWAP_IMPL(unsigned int)
VTK_BYTE_SWAP_IMPL(unsigned long)
#if defined(VTK_TYPE_USE_LONG_LONG)
VTK_BYTE_SWAP_IMPL(long long)
VTK_BYTE_SWAP_IMPL(unsigned long long)
#endif
#if defined(VTK_TYPE_USE___INT64)
VTK_BYTE_SWAP_IMPL(__int64)
VTK_BYTE_SWAP_IMPL(unsigned __int64)
#endif
#undef VTK_BYTE_SWAP_IMPL
#if VTK_SIZEOF_SHORT == 2
......
......@@ -49,19 +49,13 @@ public:
VTK_BYTE_SWAP_DECL(short);
VTK_BYTE_SWAP_DECL(int);
VTK_BYTE_SWAP_DECL(long);
VTK_BYTE_SWAP_DECL(long long);
VTK_BYTE_SWAP_DECL(signed char);
VTK_BYTE_SWAP_DECL(unsigned char);
VTK_BYTE_SWAP_DECL(unsigned short);
VTK_BYTE_SWAP_DECL(unsigned int);
VTK_BYTE_SWAP_DECL(unsigned long);
#if defined(VTK_TYPE_USE_LONG_LONG)
VTK_BYTE_SWAP_DECL(long long);
VTK_BYTE_SWAP_DECL(unsigned long long);
#endif
#if defined(VTK_TYPE_USE___INT64)
VTK_BYTE_SWAP_DECL(__int64);
VTK_BYTE_SWAP_DECL(unsigned __int64);
#endif
#undef VTK_BYTE_SWAP_DECL
//ETX
......
......@@ -85,16 +85,9 @@
#else
#cmakedefine VTK_SIZEOF_LONG_LONG 8
#endif
#cmakedefine VTK_SIZEOF___INT64 @VTK_SIZEOF___INT64@
/* Whether types "long long" and "__int64" are enabled. If a type is
enabled then it is a unique fundamental type. */
#cmakedefine VTK_TYPE_USE_LONG_LONG
#cmakedefine VTK_TYPE_USE___INT64
/* Some properties of the available types. */
#cmakedefine VTK_TYPE_SAME_LONG_AND___INT64
#cmakedefine VTK_TYPE_SAME_LONG_LONG_AND___INT64
/* Whether type "long long" is enabled as a unique fundamental type. */
#define VTK_TYPE_USE_LONG_LONG
/* Whether type "char" is signed (it may be signed or unsigned). */
#define VTK_TYPE_CHAR_IS_SIGNED @VTK_TYPE_CHAR_IS_SIGNED@
......
......@@ -1258,14 +1258,8 @@ double vtkDataArray::GetDataTypeMin(int type)
case VTK_INT: return static_cast<double>(VTK_INT_MIN);
case VTK_UNSIGNED_LONG: return static_cast<double>(VTK_UNSIGNED_LONG_MIN);
case VTK_LONG: return static_cast<double>(VTK_LONG_MIN);
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_UNSIGNED_LONG_LONG: return static_cast<double>(VTK_UNSIGNED_LONG_LONG_MIN);
case VTK_LONG_LONG: return static_cast<double>(VTK_LONG_LONG_MIN);
#endif
#if defined(VTK_TYPE_USE___INT64)
case VTK___INT64: return static_cast<double>(VTK___INT64_MIN);
case VTK_UNSIGNED___INT64: return static_cast<double>(VTK_UNSIGNED___INT64_MIN);
#endif
case VTK_FLOAT: return static_cast<double>(VTK_FLOAT_MIN);
case VTK_DOUBLE: return static_cast<double>(VTK_DOUBLE_MIN);
case VTK_ID_TYPE: return static_cast<double>(VTK_ID_MIN);
......@@ -1288,14 +1282,8 @@ double vtkDataArray::GetDataTypeMax(int type)
case VTK_INT: return static_cast<double>(VTK_INT_MAX);
case VTK_UNSIGNED_LONG: return static_cast<double>(VTK_UNSIGNED_LONG_MAX);
case VTK_LONG: return static_cast<double>(VTK_LONG_MAX);
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_UNSIGNED_LONG_LONG: return static_cast<double>(VTK_UNSIGNED_LONG_LONG_MAX);
case VTK_LONG_LONG: return static_cast<double>(VTK_LONG_LONG_MAX);
#endif
#if defined(VTK_TYPE_USE___INT64)
case VTK___INT64: return static_cast<double>(VTK___INT64_MAX);
case VTK_UNSIGNED___INT64: return static_cast<double>(VTK_UNSIGNED___INT64_MAX);
#endif
case VTK_FLOAT: return static_cast<double>(VTK_FLOAT_MAX);
case VTK_DOUBLE: return static_cast<double>(VTK_DOUBLE_MAX);
case VTK_ID_TYPE: return static_cast<double>(VTK_ID_MAX);
......
......@@ -51,7 +51,6 @@ vtkLargeInteger::vtkLargeInteger(void)
this->Sig = 0;
}
#if defined(VTK_TYPE_USE_LONG_LONG)
vtkLargeInteger::vtkLargeInteger(long long n)
{
this->Negative = n < 0 ? 1 : 0;
......@@ -80,38 +79,6 @@ vtkLargeInteger::vtkLargeInteger(unsigned long long n)
this->Sig = BIT_INCREMENT - 1;
this->Contract(); // remove leading 0s
}
#endif
#if defined(VTK_TYPE_USE___INT64)
vtkLargeInteger::vtkLargeInteger(__int64 n)
{
this->Negative = n < 0 ? 1 : 0;
n = n < 0 ? -n : n; // strip of sign
this->Number = new char[BIT_INCREMENT];
for (unsigned int i = 0; i < BIT_INCREMENT; i++)
{
this->Number[i] = n & 1;
n >>= 1;
}
this->Max = BIT_INCREMENT - 1;
this->Sig = BIT_INCREMENT - 1;
this->Contract(); // remove leading 0s
}
vtkLargeInteger::vtkLargeInteger(unsigned __int64 n)
{
this->Negative = 0;
this->Number = new char[BIT_INCREMENT];
for (unsigned int i = 0; i < BIT_INCREMENT; i++)
{
this->Number[i] = n & 1;
n >>= 1;
}
this->Max = BIT_INCREMENT - 1;
this->Sig = BIT_INCREMENT - 1;
this->Contract(); // remove leading 0s
}
#endif
vtkLargeInteger::vtkLargeInteger(long n)
{
......
......@@ -29,14 +29,8 @@ public:
vtkLargeInteger(int n);
vtkLargeInteger(unsigned int n);
vtkLargeInteger(const vtkLargeInteger& n);
#if defined(VTK_TYPE_USE_LONG_LONG)
vtkLargeInteger(long long n);
vtkLargeInteger(unsigned long long n);
#endif
#if defined(VTK_TYPE_USE___INT64)
vtkLargeInteger(__int64 n);
vtkLargeInteger(unsigned __int64 n);
#endif
~vtkLargeInteger(void);
......
......@@ -2851,26 +2851,13 @@ int vtkMath::GetScalarTypeFittingRange(
static_cast<double>(VTK_LONG_MAX) },
{ VTK_UNSIGNED_LONG,
static_cast<double>(VTK_UNSIGNED_LONG_MIN),
static_cast<double>(VTK_UNSIGNED_LONG_MAX) }
#if defined(VTK_TYPE_USE_LONG_LONG)
,
static_cast<double>(VTK_UNSIGNED_LONG_MAX) },
{ VTK_LONG_LONG,
static_cast<double>(VTK_LONG_LONG_MIN),
static_cast<double>(VTK_LONG_LONG_MAX) },
{ VTK_UNSIGNED_LONG_LONG,
static_cast<double>(VTK_UNSIGNED_LONG_LONG_MIN),
static_cast<double>(VTK_UNSIGNED_LONG_LONG_MAX) }
#endif
#if defined(VTK_TYPE_USE___INT64)
,
{ VTK___INT64,
static_cast<double>(VTK___INT64_MIN),
static_cast<double>(VTK___INT64_MAX) }
,
{ VTK_UNSIGNED___INT64,
static_cast<double>(VTK_UNSIGNED___INT64_MIN),
static_cast<double>(VTK_UNSIGNED___INT64_MAX) }
#endif
};
// If the range, scale or shift are decimal number, just browse
......
......@@ -65,21 +65,15 @@ VTKOSTREAM_OPERATOR(char);
VTKOSTREAM_OPERATOR(short);
VTKOSTREAM_OPERATOR(int);
VTKOSTREAM_OPERATOR(long);
VTKOSTREAM_OPERATOR(long long);
VTKOSTREAM_OPERATOR(unsigned char);
VTKOSTREAM_OPERATOR(unsigned short);
VTKOSTREAM_OPERATOR(unsigned int);
VTKOSTREAM_OPERATOR(unsigned long);
VTKOSTREAM_OPERATOR(unsigned long long);
VTKOSTREAM_OPERATOR(float);
VTKOSTREAM_OPERATOR(double);
VTKOSTREAM_OPERATOR(bool);
#if defined(VTK_TYPE_USE_LONG_LONG)
VTKOSTREAM_OPERATOR(long long);
VTKOSTREAM_OPERATOR(unsigned long long);
#endif
#if defined(VTK_TYPE_USE___INT64)
VTKOSTREAM_OPERATOR(__int64);
VTKOSTREAM_OPERATOR(unsigned __int64);
#endif
VTKOSTREAM_OPERATOR_FUNC(void (*a)(void*));
VTKOSTREAM_OPERATOR_FUNC(void* (*a)(void*));
VTKOSTREAM_OPERATOR_FUNC(int (*a)(void*));
......
......@@ -72,20 +72,14 @@ public:
vtkOStreamWrapper& operator << (short);
vtkOStreamWrapper& operator << (int);
vtkOStreamWrapper& operator << (long);
vtkOStreamWrapper& operator << (long long);
vtkOStreamWrapper& operator << (unsigned char);
vtkOStreamWrapper& operator << (unsigned short);
vtkOStreamWrapper& operator << (unsigned int);
vtkOStreamWrapper& operator << (unsigned long);
vtkOStreamWrapper& operator << (unsigned long long);
vtkOStreamWrapper& operator << (float);
vtkOStreamWrapper& operator << (double);
#if defined(VTK_TYPE_USE_LONG_LONG)
vtkOStreamWrapper& operator << (long long);
vtkOStreamWrapper& operator << (unsigned long long);
#endif
#if defined(VTK_TYPE_USE___INT64)
vtkOStreamWrapper& operator << (__int64);
vtkOStreamWrapper& operator << (unsigned __int64);
#endif
vtkOStreamWrapper& operator << (bool);
// Work-around for IBM Visual Age bug in overload resolution.
......
......@@ -672,10 +672,8 @@ virtual double *Get##name() \
#define vtkTemplateMacro(call) \
vtkTemplateMacroCase(VTK_DOUBLE, double, call); \
vtkTemplateMacroCase(VTK_FLOAT, float, call); \
vtkTemplateMacroCase_ll(VTK_LONG_LONG, long long, call) \
vtkTemplateMacroCase_ll(VTK_UNSIGNED_LONG_LONG, unsigned long long, call) \
vtkTemplateMacroCase_si64(VTK___INT64, __int64, call) \
vtkTemplateMacroCase_ui64(VTK_UNSIGNED___INT64, unsigned __int64, call) \
vtkTemplateMacroCase(VTK_LONG_LONG, long long, call); \
vtkTemplateMacroCase(VTK_UNSIGNED_LONG_LONG, unsigned long long, call); \
vtkTemplateMacroCase(VTK_ID_TYPE, vtkIdType, call); \
vtkTemplateMacroCase(VTK_LONG, long, call); \
vtkTemplateMacroCase(VTK_UNSIGNED_LONG, unsigned long, call); \
......@@ -706,10 +704,8 @@ virtual double *Get##name() \
#define vtkTemplate2Macro(call) \
vtkTemplate2MacroCase1(VTK_DOUBLE, double, call); \
vtkTemplate2MacroCase1(VTK_FLOAT, float, call); \
vtkTemplate2MacroCase1_ll(VTK_LONG_LONG, long long, call) \
vtkTemplate2MacroCase1_ll(VTK_UNSIGNED_LONG_LONG, unsigned long long, call) \
vtkTemplate2MacroCase1_si64(VTK___INT64, __int64, call) \
vtkTemplate2MacroCase1_ui64(VTK_UNSIGNED___INT64, unsigned __int64, call) \
vtkTemplate2MacroCase1(VTK_LONG_LONG, long long, call); \
vtkTemplate2MacroCase1(VTK_UNSIGNED_LONG_LONG, unsigned long long, call); \
vtkTemplate2MacroCase1(VTK_ID_TYPE, vtkIdType, call); \
vtkTemplate2MacroCase1(VTK_LONG, long, call); \
vtkTemplate2MacroCase1(VTK_UNSIGNED_LONG, unsigned long, call); \
......@@ -723,10 +719,8 @@ virtual double *Get##name() \
#define vtkTemplate2MacroCase1(type1N, type1, call) \
vtkTemplate2MacroCase2(type1N, type1, VTK_DOUBLE, double, call); \
vtkTemplate2MacroCase2(type1N, type1, VTK_FLOAT, float, call); \
vtkTemplate2MacroCase2_ll(type1N, type1, VTK_LONG_LONG, long long, call) \
vtkTemplate2MacroCase2_ll(type1N, type1, VTK_UNSIGNED_LONG_LONG, unsigned long long, call) \
vtkTemplate2MacroCase2_si64(type1N, type1, VTK___INT64, __int64, call) \
vtkTemplate2MacroCase2_ui64(type1N, type1, VTK_UNSIGNED___INT64, unsigned __int64, call) \
vtkTemplate2MacroCase2(type1N, type1, VTK_LONG_LONG, long long, call); \
vtkTemplate2MacroCase2(type1N, type1, VTK_UNSIGNED_LONG_LONG, unsigned long long, call); \
vtkTemplate2MacroCase2(type1N, type1, VTK_ID_TYPE, vtkIdType, call); \
vtkTemplate2MacroCase2(type1N, type1, VTK_LONG, long, call); \
vtkTemplate2MacroCase2(type1N, type1, VTK_UNSIGNED_LONG, unsigned long, call); \
......@@ -772,10 +766,8 @@ virtual double *Get##name() \
#define vtkArrayIteratorTemplateMacro(call) \
vtkArrayIteratorTemplateMacroCase(VTK_DOUBLE, double, call); \
vtkArrayIteratorTemplateMacroCase(VTK_FLOAT, float, call); \
vtkArrayIteratorTemplateMacroCase_ll(VTK_LONG_LONG, long long, call); \
vtkArrayIteratorTemplateMacroCase_ll(VTK_UNSIGNED_LONG_LONG, unsigned long long, call);\
vtkArrayIteratorTemplateMacroCase_si64(VTK___INT64, __int64, call); \
vtkArrayIteratorTemplateMacroCase_ui64(VTK_UNSIGNED___INT64, unsigned __int64, call); \
vtkArrayIteratorTemplateMacroCase(VTK_LONG_LONG, long long, call); \
vtkArrayIteratorTemplateMacroCase(VTK_UNSIGNED_LONG_LONG, unsigned long long, call); \
vtkArrayIteratorTemplateMacroCase(VTK_ID_TYPE, vtkIdType, call); \
vtkArrayIteratorTemplateMacroCase(VTK_LONG, long, call); \
vtkArrayIteratorTemplateMacroCase(VTK_UNSIGNED_LONG, unsigned long, call); \
......@@ -789,57 +781,6 @@ virtual double *Get##name() \
vtkArrayIteratorTemplateMacroCase(VTK_STRING, vtkStdString, call); \
vtkTemplateMacroCase(VTK_BIT, vtkBitArrayIterator, call);
// Add "long long" to the template macro if it is enabled.
#if defined(VTK_TYPE_USE_LONG_LONG)
# define vtkTemplateMacroCase_ll(typeN, type, call) \
vtkTemplateMacroCase(typeN, type, call);
# define vtkTemplate2MacroCase1_ll(type1N, type1, call) \
vtkTemplate2MacroCase1(type1N, type1, call);
# define vtkTemplate2MacroCase2_ll(type1N, type1, type2N, type2, call) \
vtkTemplate2MacroCase2(type1N, type1, type2N, type2, call);
# define vtkArrayIteratorTemplateMacroCase_ll(typeN, type, call) \
vtkArrayIteratorTemplateMacroCase(typeN, type, call)
#else
# define vtkTemplateMacroCase_ll(typeN, type, call)
# define vtkTemplate2MacroCase1_ll(type1N, type1, call)
# define vtkTemplate2MacroCase2_ll(type1N, type1, type2N, type2, call)
# define vtkArrayIteratorTemplateMacroCase_ll(typeN, type, call)
#endif
// Add "__int64" to the template macro if it is enabled.
#if defined(VTK_TYPE_USE___INT64)
# define vtkTemplateMacroCase_si64(typeN, type, call) \
vtkTemplateMacroCase(typeN, type, call);
# define vtkTemplate2MacroCase1_si64(type1N, type1, call) \
vtkTemplate2MacroCase1(type1N, type1, call);
# define vtkTemplate2MacroCase2_si64(type1N, type1, type2N, type2, call) \
vtkTemplate2MacroCase2(type1N, type1, type2N, type2, call);
# define vtkArrayIteratorTemplateMacroCase_si64(typeN, type, call) \
vtkArrayIteratorTemplateMacroCase(typeN, type, call)
#else
# define vtkTemplateMacroCase_si64(typeN, type, call)
# define vtkTemplate2MacroCase1_si64(type1N, type1, call)
# define vtkTemplate2MacroCase2_si64(type1N, type1, type2N, type2, call)
# define vtkArrayIteratorTemplateMacroCase_si64(typeN, type, call)
#endif
// Add "unsigned __int64" to the template macro if it is enabled.
#if defined(VTK_TYPE_USE___INT64)
# define vtkTemplateMacroCase_ui64(typeN, type, call) \
vtkTemplateMacroCase(typeN, type, call);
# define vtkTemplate2MacroCase1_ui64(type1N, type1, call) \
vtkTemplate2MacroCase1(type1N, type1, call);
# define vtkTemplate2MacroCase2_ui64(type1N, type1, type2N, type2, call) \
vtkTemplate2MacroCase2(type1N, type1, type2N, type2, call);
# define vtkArrayIteratorTemplateMacroCase_ui64(typeN, type, call) \
vtkArrayIteratorTemplateMacroCase(typeN, type, call);
#else
# define vtkTemplateMacroCase_ui64(typeN, type, call)
# define vtkTemplate2MacroCase1_ui64(type1N, type1, call)
# define vtkTemplate2MacroCase2_ui64(type1N, type1, type2N, type2, call)
# define vtkArrayIteratorTemplateMacroCase_ui64(typeN, type, call)
#endif
//----------------------------------------------------------------------------
// Setup legacy code policy.
......
......@@ -290,7 +290,6 @@ static int vtkSortDataArrayComponentCompare_VTK_FLOAT( const void* a, const void
(((float*)a)[vtkSortDataArrayComp] == ((float*)b)[vtkSortDataArrayComp] ? 0 : 1);
}
#ifdef VTK_TYPE_USE_LONG_LONG
static int vtkSortDataArrayComponentCompare_VTK_LONG_LONG( const void* a, const void* b )
{
return ((long long*)a)[vtkSortDataArrayComp] < ((long long*)b)[vtkSortDataArrayComp] ? -1 :
......@@ -302,21 +301,6 @@ static int vtkSortDataArrayComponentCompare_VTK_UNSIGNED_LONG_LONG( const void*
return ((unsigned long long*)a)[vtkSortDataArrayComp] < ((unsigned long long*)b)[vtkSortDataArrayComp] ? -1 :
(((unsigned long long*)a)[vtkSortDataArrayComp] == ((unsigned long long*)b)[vtkSortDataArrayComp] ? 0 : 1);
}
#endif // VTK_TYPE_USE_LONG_LONG
#ifdef VTK_TYPE_USE___INT64
static int vtkSortDataArrayComponentCompare_VTK___INT64( const void* a, const void* b )
{
return ((vtkTypeInt64*)a)[vtkSortDataArrayComp] < ((vtkTypeInt64*)b)[vtkSortDataArrayComp] ? -1 :
(((vtkTypeInt64*)a)[vtkSortDataArrayComp] == ((vtkTypeInt64*)b)[vtkSortDataArrayComp] ? 0 : 1);
}
static int vtkSortDataArrayComponentCompare_VTK_UNSIGNED___INT64( const void* a, const void* b )
{
return ((vtkTypeUInt64*)a)[vtkSortDataArrayComp] < ((vtkTypeUInt64*)b)[vtkSortDataArrayComp] ? -1 :
(((vtkTypeUInt64*)a)[vtkSortDataArrayComp] == ((vtkTypeUInt64*)b)[vtkSortDataArrayComp] ? 0 : 1);
}
#endif // VTK_TYPE_USE___INT64
static int vtkSortDataArrayComponentCompare_VTK_ID_TYPE( const void* a, const void* b )
{
......@@ -445,7 +429,6 @@ void vtkSortDataArray::SortArrayByComponent( vtkAbstractArray* arr, int k )
static_cast<size_t>(arr->GetDataTypeSize()*nc),
vtkSortDataArrayComponentCompare_VTK_FLOAT);
break;
#ifdef VTK_TYPE_USE_LONG_LONG
case VTK_LONG_LONG:
qsort(static_cast<void*>(arr->GetVoidPointer(0)),
static_cast<size_t>(arr->GetNumberOfTuples()),
......@@ -458,21 +441,6 @@ void vtkSortDataArray::SortArrayByComponent( vtkAbstractArray* arr, int k )
static_cast<size_t>(arr->GetDataTypeSize()*nc),
vtkSortDataArrayComponentCompare_VTK_UNSIGNED_LONG_LONG);
break;
#endif // VTK_TYPE_USE_LONG_LONG
#ifdef VTK_TYPE_USE___INT64
case VTK___INT64:
qsort(static_cast<void*>(arr->GetVoidPointer(0)),
static_cast<size_t>(arr->GetNumberOfTuples()),
static_cast<size_t>(arr->GetDataTypeSize()*nc),
vtkSortDataArrayComponentCompare_VTK___INT64);
break;
case VTK_UNSIGNED___INT64:
qsort(static_cast<void*>(arr->GetVoidPointer(0)),
static_cast<size_t>(arr->GetNumberOfTuples()),
static_cast<size_t>(arr->GetDataTypeSize()*nc),
vtkSortDataArrayComponentCompare_VTK_UNSIGNED___INT64);
break;
#endif // VTK_TYPE_USE___INT64
case VTK_ID_TYPE:
qsort(static_cast<void*>(arr->GetVoidPointer(0)),
static_cast<size_t>(arr->GetNumberOfTuples()),
......
......@@ -75,31 +75,13 @@
typedef vtkTypeTraits<VTK_TYPE_NAME_##typeN>::SizedType VTK_TT; call; \
}; break
// Add "long long" to the template macro if it is enabled.
#if defined(VTK_TYPE_USE_LONG_LONG)
# define vtkTemplateAliasMacroCase_ll(typeN, call) \
vtkTemplateAliasMacroCase(typeN, call);
#else
# define vtkTemplateAliasMacroCase_ll(typeN, call)
#endif
// Add "__int64" to the template macro if it is enabled.
#if defined(VTK_TYPE_USE___INT64)
# define vtkTemplateAliasMacroCase_i64(typeN, call) \
vtkTemplateAliasMacroCase(typeN, call);
#else
# define vtkTemplateAliasMacroCase_i64(typeN, call)
#endif
// Define a macro to dispatch calls to a template instantiated over
// the aliased scalar types.
#define vtkTemplateAliasMacro(call) \
vtkTemplateAliasMacroCase(DOUBLE, call); \
vtkTemplateAliasMacroCase(FLOAT, call); \
vtkTemplateAliasMacroCase_ll(LONG_LONG, call) \
vtkTemplateAliasMacroCase_ll(UNSIGNED_LONG_LONG, call) \
vtkTemplateAliasMacroCase_i64(__INT64, call) \
vtkTemplateAliasMacroCase_i64(UNSIGNED___INT64, call) \
vtkTemplateAliasMacroCase(LONG_LONG, call); \
vtkTemplateAliasMacroCase(UNSIGNED_LONG_LONG, call); \
vtkTemplateAliasMacroCase(ID_TYPE, call); \
vtkTemplateAliasMacroCase(LONG, call); \
vtkTemplateAliasMacroCase(UNSIGNED_LONG, call); \
......
......@@ -41,14 +41,13 @@
#define VTK_STRING 13
#define VTK_OPAQUE 14
/* These types are enabled if VTK_TYPE_USE_LONG_LONG is defined. */
#define VTK_LONG_LONG 16
#define VTK_UNSIGNED_LONG_LONG 17
/* This type is enabled if VTK_TYPE_USE___INT64 is defined. */
/* Legacy. This type is never enabled. */
#define VTK___INT64 18
/* This type is enabled if VTK_TYPE_USE___INT64 is defined. */
/* Legacy. This type is never enabled. */
#define VTK_UNSIGNED___INT64 19
/* These types are required by vtkVariant and vtkVariantArray */
......@@ -145,24 +144,6 @@
# define VTK_UNSIGNED_LONG_LONG_MIN VTK_TYPE_CAST(unsigned long long, 0ull)
# define VTK_UNSIGNED_LONG_LONG_MAX VTK_TYPE_CAST(unsigned long long, ~0ull)
#endif
#if defined(VTK_SIZEOF___INT64)
# if defined(VTK_TYPE_SAME_LONG_AND___INT64)
# define VTK___INT64_MIN VTK_TYPE_CAST(__int64, ~(~0ul >> 1))
# define VTK___INT64_MAX VTK_TYPE_CAST(__int64, ~0ul >> 1)
# define VTK_UNSIGNED___INT64_MIN VTK_TYPE_CAST(unsigned __int64, 0ul)
# define VTK_UNSIGNED___INT64_MAX VTK_TYPE_CAST(unsigned __int64, ~0ul)
# elif defined(VTK_TYPE_SAME_LONG_LONG_AND___INT64)
# define VTK___INT64_MIN VTK_TYPE_CAST(__int64, ~(~0ull >> 1))
# define VTK___INT64_MAX VTK_TYPE_CAST(__int64, ~0ull >> 1)
# define VTK_UNSIGNED___INT64_MIN VTK_TYPE_CAST(unsigned __int64, 0ull)
# define VTK_UNSIGNED___INT64_MAX VTK_TYPE_CAST(unsigned __int64, ~0ull)