Skip to content

Commit d065c76

Browse files
committed
Fixes warning on Mac.
1 parent 7086c36 commit d065c76

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/transform/ojph_colour.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ namespace ojph {
390390
// using 32 bit integer
391391
const si32 half = (1 << (bit_depth - 1));
392392
const si32 shift = half + 1;
393-
const si32 upper_limit = 0x7FFFFFFF >> (32 - bit_depth);
394-
const si32 lower_limit = 0x80000000 >> (32 - bit_depth);
393+
const si32 upper_limit = INT_MAX >> (32 - bit_depth);
394+
const si32 lower_limit = INT_MIN >> (32 - bit_depth);
395395

396396
if (is_signed)
397397
{
@@ -428,8 +428,8 @@ namespace ojph {
428428
// it is either infinity, -infinity, qNan or sNan.
429429
const si32 half = (1 << (bit_depth - 1));
430430
const si32 shift = half + 1;
431-
const si64 upper_limit = 0x7FFFFFFFFFFFFFFFLL >> (64 - bit_depth);
432-
const si64 lower_limit = 0x8000000000000000LL >> (64 - bit_depth);
431+
const si64 upper_limit = LLONG_MAX >> (64 - bit_depth);
432+
const si64 lower_limit = LLONG_MIN >> (64 - bit_depth);
433433

434434
if (is_signed)
435435
{

0 commit comments

Comments
 (0)