From f0b684d9b7b34b19ad3b8d31dce3d17264ad0706 Mon Sep 17 00:00:00 2001
From: Jack Palevich <jackpal@google.com>
Date: Fri, 15 Jun 2012 19:34:04 +0800
Subject: Fix convert8To4, convert8To5

See b/5680952 "Compilation warnings in etc1.cpp" for discussion.

This is a manual merge of an update that was made to
frameworks/native/opengl/libs/ETC1/etc1.cpp.

sdk/emulator/opengl/host/libs/Translator/GLcommon/etc1.cpp is an exact
copy of frameworks/native/opengl/libs/ETC1/etc1.cpp, so we might as well
keep the two versions in synch.

Bug: 5680952
Change-Id: Icf5d5ed2e7c5c79eb9677d210b1ff5fee507271d
---
 emulator/opengl/host/libs/Translator/GLcommon/etc1.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/emulator/opengl/host/libs/Translator/GLcommon/etc1.cpp b/emulator/opengl/host/libs/Translator/GLcommon/etc1.cpp
index 5ed2c3c..97d1085 100644
--- a/emulator/opengl/host/libs/Translator/GLcommon/etc1.cpp
+++ b/emulator/opengl/host/libs/Translator/GLcommon/etc1.cpp
@@ -149,13 +149,13 @@ inline int divideBy255(int d) {
 static
 inline int convert8To4(int b) {
     int c = b & 0xff;
-    return divideBy255(b * 15);
+    return divideBy255(c * 15);
 }
 
 static
 inline int convert8To5(int b) {
     int c = b & 0xff;
-    return divideBy255(b * 31);
+    return divideBy255(c * 31);
 }
 
 static
-- 
cgit v1.1