summaryrefslogtreecommitdiff
path: root/drivers/etc1/rg_etc1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/etc1/rg_etc1.cpp')
-rw-r--r--drivers/etc1/rg_etc1.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/etc1/rg_etc1.cpp b/drivers/etc1/rg_etc1.cpp
index 63877e6d12..fd109f003c 100644
--- a/drivers/etc1/rg_etc1.cpp
+++ b/drivers/etc1/rg_etc1.cpp
@@ -24,6 +24,9 @@
namespace rg_etc1
{
+ inline long labs(long val) {
+ return val < 0 ? -val : val;
+ }
inline int intabs(int val) {
@@ -1913,7 +1916,7 @@ done:
for (uint packed_c = 0; packed_c < limit; packed_c++)
{
int v = etc1_decode_value(diff, inten, selector, packed_c);
- uint err = intabs(v - color);
+ uint err = labs(v - static_cast<int>(color));
//printf("err: %d - %u = %u\n",v,color,err);
if (err < best_error)
{