1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-16 10:54:53 +03:00

0026668: Eliminate compile warnings obtained by building occt with vc14: conversion requires a narrowing conversion

Warnings "conversion requires a narrowing conversion" were eliminated: IVtk_IdType is defined via vtkIdType from now.

Check of bitness of VTK libraries is added, to ensure that OCCT and VTK use the same bitness.

HashCode() function for long long int added in Standard_Integer.hxx to handle 64-bit integers
This commit is contained in:
rkv 2015-09-30 09:36:04 +03:00 committed by bugmaster
parent 839b8d3cdf
commit ee9e67edc7
2 changed files with 40 additions and 19 deletions

View File

@ -21,11 +21,22 @@
#include <NCollection_TListIterator.hxx> #include <NCollection_TListIterator.hxx>
#include <NCollection_DataMap.hxx> #include <NCollection_DataMap.hxx>
#include <NCollection_Map.hxx> #include <NCollection_Map.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <vtkType.h>
typedef Standard_Size IVtk_IdType; #ifdef VTK_USE_64BIT_IDS
#if defined(_WIN32) && !defined(_WIN64)
#error "64-bit VTK library can not be linked for 32-bit target platform"
#endif
#else
#ifdef _WIN64
#error "32-bit VTK library can not be linked for 64-bit target platform"
#endif
#endif
typedef vtkIdType IVtk_IdType;
typedef IVtk_IdType IVtk_PointId; typedef IVtk_IdType IVtk_PointId;
typedef IVtk_IdType IVtk_FaceId; typedef IVtk_IdType IVtk_FaceId;
@ -39,6 +50,7 @@ typedef NCollection_Map <IVtk_IdType> IVtk_IdTypeMap;
typedef NCollection_List <gp_XY> IVtk_Pnt2dList; typedef NCollection_List <gp_XY> IVtk_Pnt2dList;
//! @enum IVtk_SelectionMode Selection modes for 3D shapes //! @enum IVtk_SelectionMode Selection modes for 3D shapes
//! //!
//! Enumeration that describes all supported selection modes for 3D shapes. //! Enumeration that describes all supported selection modes for 3D shapes.

View File

@ -49,6 +49,15 @@ inline Standard_Boolean IsEqual (const Standard_Integer theOne,
return theOne == theTwo; return theOne == theTwo;
} }
// ------------------------------------------------------------------
// Hascode : Computes a hascoding value for a given long long integer
// ------------------------------------------------------------------
inline Standard_Integer HashCode(const long long int theMe,
const Standard_Integer theUpper)
{
return ((theMe & 0x7fffffffffffffff) % theUpper) + 1;
}
#if (defined(_LP64) || defined(__LP64__) || defined(_WIN64)) || defined(__APPLE__) #if (defined(_LP64) || defined(__LP64__) || defined(_WIN64)) || defined(__APPLE__)
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Hascode : Computes a hascoding value for a given unsigned integer // Hascode : Computes a hascoding value for a given unsigned integer