Skip to content

Commit

Permalink
Use LL for 64-bit literals
Browse files Browse the repository at this point in the history
On a 32-bit architecture, these literals are too big for just a long,
they need to be long long, otherwise I get an error in GCC.
  • Loading branch information
fnordware committed Aug 14, 2014
1 parent e98d25b commit 57ecf58
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions OpenEXR/IlmImf/ImfFastHuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ FastHufDecoder::FastHufDecoder
for (int i = 0; i <= MAX_CODE_LEN; ++i)
{
codeCount[i] = 0;
base[i] = 0xffffffffffffffffL;
base[i] = 0xffffffffffffffffLL;
offset[i] = 0;
}

Expand Down Expand Up @@ -352,7 +352,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)

for (int i = 0; i <= MAX_CODE_LEN; ++i)
{
if (base[i] != 0xffffffffffffffffL)
if (base[i] != 0xffffffffffffffffLL)
{
_ljBase[i] = base[i] << (64 - i);
}
Expand All @@ -362,7 +362,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)
// Unused code length - insert dummy values
//

_ljBase[i] = 0xffffffffffffffffL;
_ljBase[i] = 0xffffffffffffffffLL;
}
}

Expand Down Expand Up @@ -417,7 +417,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)

int minIdx = TABLE_LOOKUP_BITS;

while (minIdx > 0 && _ljBase[minIdx] == 0xffffffffffffffffL)
while (minIdx > 0 && _ljBase[minIdx] == 0xffffffffffffffffLL)
minIdx--;

if (minIdx < 0)
Expand All @@ -427,7 +427,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)
// Set the min value such that the table is never tested.
//

_tableMin = 0xffffffffffffffffL;
_tableMin = 0xffffffffffffffffLL;
}
else
{
Expand Down

0 comments on commit 57ecf58

Please sign in to comment.