Commit 3b89e771 authored by Brad King's avatar Brad King
Browse files

Drop support for compilers without `long long`

VTK no longer supports any compilers that do not provide this type.
Therefore all code conditional on VTK_TYPE_USE_LONG_LONG can be made
unconditional.  Leave the macro defined to tell dependent projects that
APIs using the type are available in case they still support versions of
VTK that make it conditional.
parent 36bb09a7
......@@ -7,16 +7,8 @@ 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)
# 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()
IF(NOT DEFINED VTK_TYPE_CHAR_IS_SIGNED)
MESSAGE(STATUS "Checking signedness of char")
TRY_RUN(VTK_TYPE_CHAR_IS_SIGNED VTK_TYPE_CHAR_IS_SIGNED_COMPILED
......
......@@ -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
......@@ -395,13 +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()
# 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)
......
......@@ -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,11 +44,6 @@
#include "vtkNew.h"
#include "vtkUnicodeString.h" // for vtkSuperExtraExtendedTemplateMacro
#if defined(VTK_TYPE_USE_LONG_LONG)
# include "vtkLongLongArray.h"
# include "vtkUnsignedLongLongArray.h"
#endif
#include <algorithm>
#include <iterator>
#include <set>
......@@ -354,13 +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
case VTK_FLOAT:
return vtkFloatArray::New();
......
......@@ -89,12 +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
case VTK_FLOAT:
return vtkDenseArray<float>::New();
case VTK_DOUBLE:
......@@ -133,12 +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
case VTK_FLOAT:
return vtkSparseArray<float>::New();
case VTK_DOUBLE:
......
......@@ -240,15 +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
#undef VTK_BYTE_SWAP_IMPL
#if VTK_SIZEOF_SHORT == 2
......
......@@ -49,15 +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
#undef VTK_BYTE_SWAP_DECL
//ETX
......
......@@ -87,7 +87,7 @@
#endif
/* Whether type "long long" is enabled as a unique fundamental type. */
#cmakedefine VTK_TYPE_USE_LONG_LONG
#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,10 +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
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);
......@@ -1284,10 +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
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,7 +79,6 @@ vtkLargeInteger::vtkLargeInteger(unsigned long long n)
this->Sig = BIT_INCREMENT - 1;
this->Contract(); // remove leading 0s
}
#endif
vtkLargeInteger::vtkLargeInteger(long n)
{
......
......@@ -29,10 +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
~vtkLargeInteger(void);
......
......@@ -2851,16 +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 the range, scale or shift are decimal number, just browse
......
......@@ -65,17 +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
VTKOSTREAM_OPERATOR_FUNC(void (*a)(void*));
VTKOSTREAM_OPERATOR_FUNC(void* (*a)(void*));
VTKOSTREAM_OPERATOR_FUNC(int (*a)(void*));
......
......@@ -72,16 +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
vtkOStreamWrapper& operator << (bool);
// Work-around for IBM Visual Age bug in overload resolution.
......
......@@ -672,8 +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(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); \
......@@ -704,8 +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(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); \
......@@ -719,8 +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(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); \
......@@ -766,8 +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(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); \
......@@ -781,23 +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
//----------------------------------------------------------------------------
// 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,7 +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
static int vtkSortDataArrayComponentCompare_VTK_ID_TYPE( const void* a, const void* b )
{
......@@ -431,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()),
......@@ -444,7 +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
case VTK_ID_TYPE:
qsort(static_cast<void*>(arr->GetVoidPointer(0)),
static_cast<size_t>(arr->GetNumberOfTuples()),
......
......@@ -75,21 +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
// 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(LONG_LONG, call); \
vtkTemplateAliasMacroCase(UNSIGNED_LONG_LONG, call); \
vtkTemplateAliasMacroCase(ID_TYPE, call); \
vtkTemplateAliasMacroCase(LONG, call); \
vtkTemplateAliasMacroCase(UNSIGNED_LONG, call); \
......
......@@ -41,7 +41,6 @@
#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
......@@ -195,7 +194,7 @@ typedef signed long vtkTypeInt32;
#endif
/* Select a 64-bit integer type. */
#if defined(VTK_TYPE_USE_LONG_LONG) && VTK_SIZEOF_LONG_LONG == 8
#if VTK_SIZEOF_LONG_LONG == 8
typedef unsigned long long vtkTypeUInt64;
typedef signed long long vtkTypeInt64;
# define VTK_TYPE_UINT64 VTK_UNSIGNED_LONG_LONG
......@@ -229,13 +228,13 @@ typedef double vtkTypeFloat64;
/* Choose an implementation for vtkIdType. */
#define VTK_HAS_ID_TYPE
#ifdef VTK_USE_64BIT_IDS
# if defined(VTK_TYPE_USE_LONG_LONG) && VTK_SIZEOF_LONG_LONG == 8
# if VTK_SIZEOF_LONG_LONG == 8
typedef long long vtkIdType;
# define VTK_ID_TYPE_IMPL VTK_LONG_LONG
# define VTK_SIZEOF_ID_TYPE VTK_SIZEOF_LONG_LONG
# define VTK_ID_MIN VTK_LONG_LONG_MIN
# define VTK_ID_MAX VTK_LONG_LONG_MAX
# elif defined(VTK_SIZEOF_LONG) && VTK_SIZEOF_LONG == 8
# elif VTK_SIZEOF_LONG == 8
typedef long vtkIdType;
# define VTK_ID_TYPE_IMPL VTK_LONG
# define VTK_SIZEOF_ID_TYPE VTK_SIZEOF_LONG
......
......@@ -120,21 +120,19 @@ VTK_TYPE_TRAITS(unsigned long, UNSIGNED_LONG, 0, UInt64, unsigned long, "%lu");
#endif
// Define traits for long long types if they are enabled.
#if defined(VTK_TYPE_USE_LONG_LONG)
# define VTK_TYPE_NAME_LONG_LONG long long
# define VTK_TYPE_NAME_UNSIGNED_LONG_LONG unsigned long long
# if VTK_SIZEOF_LONG_LONG == 8
# define VTK_TYPE_SIZED_LONG_LONG INT64
# define VTK_TYPE_SIZED_UNSIGNED_LONG_LONG UINT64
# define VTK_TYPE_LONG_LONG_FORMAT "%ll"
#define VTK_TYPE_NAME_LONG_LONG long long
#define VTK_TYPE_NAME_UNSIGNED_LONG_LONG unsigned long long
#if VTK_SIZEOF_LONG_LONG == 8
# define VTK_TYPE_SIZED_LONG_LONG INT64
# define VTK_TYPE_SIZED_UNSIGNED_LONG_LONG UINT64
# define VTK_TYPE_LONG_LONG_FORMAT "%ll"
VTK_TYPE_TRAITS(long long, LONG_LONG, 1, Int64, long long,
VTK_TYPE_LONG_LONG_FORMAT "d");
VTK_TYPE_TRAITS(unsigned long long, UNSIGNED_LONG_LONG, 0, UInt64,
unsigned long long, VTK_TYPE_LONG_LONG_FORMAT "u");
# undef VTK_TYPE_LONG_LONG_FORMAT
# else
# error "Type long long is not 8 bytes in size."
# endif
# undef VTK_TYPE_LONG_LONG_FORMAT
#else
# error "Type long long is not 8 bytes in size."
#endif
// Define traits for vtkIdType. The template specialization is
......
......@@ -103,13 +103,11 @@ bool vtkVariantStrictWeakOrder::operator()(const vtkVariant& s1, const vtkVarian
case VTK_UNSIGNED_LONG:
return (s1.Data.UnsignedLong < s2.Data.UnsignedLong);
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_LONG_LONG:
return (s1.Data.LongLong < s2.Data.LongLong);
case VTK_UNSIGNED_LONG_LONG:
return (s1.Data.UnsignedLongLong < s2.Data.UnsignedLongLong);
#endif
case VTK_FLOAT:
return (s1.Data.Float < s2.Data.Float);
......@@ -189,13 +187,11 @@ vtkVariantStrictEquality::operator()(const vtkVariant &s1, const vtkVariant &s2)
case VTK_UNSIGNED_LONG:
return (s1.Data.UnsignedLong == s2.Data.UnsignedLong);
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_LONG_LONG:
return (s1.Data.LongLong == s2.Data.LongLong);
case VTK_UNSIGNED_LONG_LONG:
return (s1.Data.UnsignedLongLong == s2.Data.UnsignedLongLong);
#endif
case VTK_FLOAT:
return (s1.Data.Float == s2.Data.Float);
......@@ -318,7 +314,6 @@ vtkVariant::vtkVariant(const vtkVariant &s2, unsigned int type)
this->Data.UnsignedLong = s2.ToUnsignedLong(&valid);
break;
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_LONG_LONG:
this->Data.LongLong = s2.ToLongLong(&valid);
break;
......@@ -326,7 +321,6 @@ vtkVariant::vtkVariant(const vtkVariant &s2, unsigned int type)
case VTK_UNSIGNED_LONG_LONG:
this->Data.UnsignedLongLong = s2.ToUnsignedLongLong(&valid);
break;
#endif
case VTK_FLOAT:
this->Data.Float = s2.ToFloat(&valid);
......@@ -478,7 +472,6 @@ vtkVariant::vtkVariant(unsigned long value)
this->Type = VTK_UNSIGNED_LONG;
}
#if defined(VTK_TYPE_USE_LONG_LONG)
vtkVariant::vtkVariant(long long value)
{
this->Data.LongLong = value;
......@@ -492,7 +485,6 @@ vtkVariant::vtkVariant(unsigned long long value)
this->Valid = 1;
this->Type = VTK_UNSIGNED_LONG_LONG;
}
#endif
vtkVariant::vtkVariant(float value)
{
......@@ -782,7 +774,6 @@ vtkStdString vtkVariant::ToString() const
ostr << this->Data.UnsignedLong;
return vtkStdString(ostr.str());
}
#if defined(VTK_TYPE_USE_LONG_LONG)
if (this->IsLongLong())
{
std::ostringstream ostr;
......@@ -797,7 +788,6 @@ vtkStdString vtkVariant::ToString() const
ostr << this->Data.UnsignedLongLong;
return vtkStdString(ostr.str());
}
#endif
if (this->IsArray())
{
vtkAbstractArray* arr = vtkAbstractArray::SafeDownCast(this->Data.VTKObject);
......@@ -940,11 +930,8 @@ vtkVariantToNumericInstantiateMacro(int);
vtkVariantToNumericInstantiateMacro(unsigned int);
vtkVariantToNumericInstantiateMacro(long);
vtkVariantToNumericInstantiateMacro(unsigned long);
#if defined(VTK_TYPE_USE_LONG_LONG)
vtkVariantToNumericInstantiateMacro(long long);
vtkVariantToNumericInstantiateMacro(unsigned long long);
#endif
#endif
......@@ -1006,7 +993,6 @@ unsigned long vtkVariant::ToUnsignedLong(bool *valid) const
return this->ToNumeric(valid, static_cast<unsigned long *>(0));
}
#if defined(VTK_TYPE_USE_LONG_LONG)
long long vtkVariant::ToLongLong(bool *valid) const
{
return this->ToNumeric(valid, static_cast<long long *>(0));
......@@ -1016,7 +1002,6 @@ unsigned long long vtkVariant::ToUnsignedLongLong(bool *valid) const
{
return this->ToNumeric(valid, static_cast<unsigned long long *>(0));
}
#endif
vtkTypeInt64 vtkVariant::ToTypeInt64(bool *valid) const
{
......@@ -1095,14 +1080,12 @@ ostream& operator << ( ostream& os, const vtkVariant& val )
case VTK_UNSIGNED_LONG:
os << val.Data.UnsignedLong;
break;
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_LONG_LONG:
os << val.Data.LongLong;
break;
case VTK_UNSIGNED_LONG_LONG:
os << val.Data.UnsignedLongLong;
break;
#endif
case VTK_OBJECT:
if ( val.Data.VTKObject )
{
......
......@@ -124,7 +124,6 @@ public:
// Create an unsigned long variant.
vtkVariant(unsigned long value);
#if defined(VTK_TYPE_USE_LONG_LONG)
// Description:
// Create a long long variant.
vtkVariant(long long value);
......@@ -132,7 +131,6 @@ public:
// Description:
// Create an unsigned long long variant.
vtkVariant(unsigned long long value);
#endif
// Description:
// Create a float variant.
......@@ -307,14 +305,12 @@ public:
unsigned long ToUnsignedLong(bool *valid) const;
unsigned long ToUnsignedLong() const {
return this->ToUnsignedLong(0); };
#if defined(VTK_TYPE_USE_LONG_LONG)
long long ToLongLong(bool *valid) const;
long long ToLongLong() const {
return this->ToLongLong(0); };
unsigned long long ToUnsignedLongLong(bool *valid) const;
unsigned long long ToUnsignedLongLong() const {
return this->ToUnsignedLongLong(0); };
#endif
vtkTypeInt64 ToTypeInt64(bool *valid) const;
vtkTypeInt64 ToTypeInt64() const {
return this->ToTypeInt64(0); };
......@@ -401,10 +397,8 @@ private:
unsigned int UnsignedInt;
long Long;
unsigned long UnsignedLong;
#if defined(VTK_TYPE_USE_LONG_LONG)
long long LongLong;
unsigned long long UnsignedLongLong;
#endif
vtkObjectBase* VTKObject;
} Data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment