mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +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:
@@ -25,8 +25,8 @@
|
||||
// ------------------------------------------------------------------
|
||||
// Abs : Returns the absolute value of an Integer
|
||||
// ------------------------------------------------------------------
|
||||
inline Standard_Integer Abs (const Standard_Integer Value)
|
||||
{
|
||||
inline Standard_Integer Abs (const Standard_Integer Value)
|
||||
{
|
||||
return Value >= 0 ? Value : -Value;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,15 @@ inline Standard_Boolean IsEqual (const Standard_Integer theOne,
|
||||
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__)
|
||||
// ------------------------------------------------------------------
|
||||
// Hascode : Computes a hascoding value for a given unsigned integer
|
||||
@@ -72,21 +81,21 @@ inline Standard_Boolean IsEqual (const Standard_Utf32Char theOne,
|
||||
// ------------------------------------------------------------------
|
||||
// IsEven : Returns Standard_True if an integer is even
|
||||
// ------------------------------------------------------------------
|
||||
inline Standard_Boolean IsEven (const Standard_Integer Value)
|
||||
inline Standard_Boolean IsEven (const Standard_Integer Value)
|
||||
{ return Value % 2 == 0; }
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// IsOdd : Returns Standard_True if an integer is odd
|
||||
// ------------------------------------------------------------------
|
||||
inline Standard_Boolean IsOdd (const Standard_Integer Value)
|
||||
inline Standard_Boolean IsOdd (const Standard_Integer Value)
|
||||
{ return Value % 2 == 1; }
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Max : Returns the maximum integer between two integers
|
||||
// ------------------------------------------------------------------
|
||||
inline Standard_Integer Max (const Standard_Integer Val1,
|
||||
const Standard_Integer Val2)
|
||||
const Standard_Integer Val2)
|
||||
{
|
||||
return Val1 >= Val2 ? Val1 : Val2;
|
||||
}
|
||||
@@ -94,8 +103,8 @@ inline Standard_Integer Max (const Standard_Integer Val1,
|
||||
// ------------------------------------------------------------------
|
||||
// Min : Returns the minimum integer between two integers
|
||||
// ------------------------------------------------------------------
|
||||
inline Standard_Integer Min (const Standard_Integer Val1,
|
||||
const Standard_Integer Val2)
|
||||
inline Standard_Integer Min (const Standard_Integer Val1,
|
||||
const Standard_Integer Val2)
|
||||
{
|
||||
return Val1 <= Val2 ? Val1 : Val2;
|
||||
}
|
||||
@@ -103,32 +112,32 @@ inline Standard_Integer Min (const Standard_Integer Val1,
|
||||
// ------------------------------------------------------------------
|
||||
// Modulus : Returns the remainder of division between two integers
|
||||
// ------------------------------------------------------------------
|
||||
inline Standard_Integer Modulus (const Standard_Integer Value,
|
||||
const Standard_Integer Divisor)
|
||||
inline Standard_Integer Modulus (const Standard_Integer Value,
|
||||
const Standard_Integer Divisor)
|
||||
{ return Value % Divisor; }
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Square : Returns the square of an integer
|
||||
// ------------------------------------------------------------------
|
||||
inline Standard_Integer Square(const Standard_Integer Value)
|
||||
inline Standard_Integer Square(const Standard_Integer Value)
|
||||
{ return Value * Value; }
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// IntegerFirst : Returns the minimum value of an integer
|
||||
// ------------------------------------------------------------------
|
||||
inline Standard_Integer IntegerFirst()
|
||||
inline Standard_Integer IntegerFirst()
|
||||
{ return INT_MIN; }
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// IntegerLast : Returns the maximum value of an integer
|
||||
// ------------------------------------------------------------------
|
||||
inline Standard_Integer IntegerLast()
|
||||
inline Standard_Integer IntegerLast()
|
||||
{ return INT_MAX; }
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// IntegerSize : Returns the size in digits of an integer
|
||||
// ------------------------------------------------------------------
|
||||
inline Standard_Integer IntegerSize()
|
||||
inline Standard_Integer IntegerSize()
|
||||
{ return BITS(Standard_Integer); }
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user