summaryrefslogtreecommitdiff
path: root/indra/llkdu/llimagej2ckdu.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2016-04-14 11:31:11 -0700
committerRider Linden <rider@lindenlab.com>2016-04-14 11:31:11 -0700
commitf9f5003f4a65c110c44fc3da7c465823ca267938 (patch)
tree96427df4e311c72a1cb2bedd2a6aa70c05c6ad27 /indra/llkdu/llimagej2ckdu.cpp
parent48016ff54bced607ba11bb02825974b5133ada34 (diff)
parent9418e8b876a5193dea2ef2d583259909e595bbfe (diff)
Merge
Diffstat (limited to 'indra/llkdu/llimagej2ckdu.cpp')
-rwxr-xr-xindra/llkdu/llimagej2ckdu.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp
index 6a8959517d..282c859e9e 100755
--- a/indra/llkdu/llimagej2ckdu.cpp
+++ b/indra/llkdu/llimagej2ckdu.cpp
@@ -1034,7 +1034,7 @@ all necessary level shifting, type conversion, rounding and truncation. */
val = (kdu_int32)(sp->fval*scale16);
val = (val+128)>>8; // May be faster than true rounding
val += 128;
- if (val & ((-1)<<8))
+ if (val & ((0xffffffffU)<<8))
{
val = (val < 0 ? 0 : 255);
}
@@ -1052,7 +1052,7 @@ all necessary level shifting, type conversion, rounding and truncation. */
val = sp->ival;
val = (val+offset)>>downshift;
val += 128;
- if (val & ((-1)<<8))
+ if (val & ((0xffffffffU)<<8))
{
val = (val < 0 ? 0 : 255);
}
@@ -1075,7 +1075,7 @@ all necessary level shifting, type conversion, rounding and truncation. */
val += (1<<(KDU_FIX_POINT-8))>>1;
val >>= (KDU_FIX_POINT-8);
val += 128;
- if (val & ((-1)<<8))
+ if (val & ((0xffffffffU)<<8))
{
val = (val < 0 ? 0 : 255);
}
@@ -1094,7 +1094,7 @@ all necessary level shifting, type conversion, rounding and truncation. */
val = (val+offset)>>downshift;
val <<= upshift;
val += 128;
- if (val & ((-1)<<8))
+ if (val & ((0xffffffffU)<<8))
{
val = (val < 0 ? 0 : 256 - (1<<upshift));
}
@@ -1116,7 +1116,7 @@ all necessary level shifting, type conversion, rounding and truncation. */
val = sp->ival;
val = (val+offset)>>downshift;
val += 128;
- if (val & ((-1)<<8))
+ if (val & ((0xffffffffU)<<8))
{
val = (val < 0 ? 0 : 255);
}
@@ -1132,7 +1132,7 @@ all necessary level shifting, type conversion, rounding and truncation. */
val = sp->ival;
val <<= upshift;
val += 128;
- if (val & ((-1)<<8))
+ if (val & ((0xffffffffU)<<8))
{
val = (val < 0 ? 0 : 256 - (1<<upshift));
}