drm: Fix undefined behavior when bit shifting.
This commit is contained in:
parent
5502ce9a9c
commit
890712f872
1 changed files with 2 additions and 2 deletions
|
@ -656,9 +656,9 @@ void DrmPipeline::setGammaRamp(const std::shared_ptr<ColorTransformation> &trans
|
|||
static uint64_t doubleToFixed(double value)
|
||||
{
|
||||
// ctm values are in S31.32 sign-magnitude format
|
||||
uint64_t ret = std::abs(value) * (1ul << 32);
|
||||
uint64_t ret = std::abs(value) * (1ull << 32);
|
||||
if (value < 0) {
|
||||
ret |= 1ul << 63;
|
||||
ret |= 1ull << 63;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue