Mesa (master): mesa: cast the GLenum16 to GLint to avoid compile warning on android

Brian Paul brianp at kemper.freedesktop.org
Wed May 16 19:03:52 UTC 2018


Module: Mesa
Branch: master
Commit: 1261b34cd592822703a6848e78963c011447d2e7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1261b34cd592822703a6848e78963c011447d2e7

Author: jenny.q.cao <jenny.q.cao at intel.com>
Date:   Wed May 16 01:02:00 2018 -0600

mesa: cast the GLenum16 to GLint to avoid compile warning on android

Cast the enum to GLint to avoid the compile warning:
/src/mesa/main/get.c:3005:19:
warning: comparison of constant -32768 with expression of type
'GLenum16' (aka 'unsigned short') is always false
-Wtautologicalia-constant-out-of-range-compare

Tests: compilation without this warning
Signed-off-by: jenny.q.cao <jenny.q.cao at intel.com>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/get.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 62d4f1ea5d..0bf5c1ff0c 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -3068,7 +3068,7 @@ _mesa_GetFixedv(GLenum pname, GLfixed *params)
       break;
 
    case TYPE_ENUM16:
-      params[0] = INT_TO_FIXED(((GLenum16 *) p)[0]);
+      params[0] = INT_TO_FIXED((GLint)(((GLenum16 *) p)[0]));
       break;
 
    case TYPE_INT_N:




More information about the mesa-commit mailing list