mesa: cast the GLenum16 to GLint to avoid compile warning on android
authorjenny.q.cao <jenny.q.cao@intel.com>
Wed, 16 May 2018 07:02:00 +0000 (01:02 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 16 May 2018 19:02:43 +0000 (13:02 -0600)
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@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/get.c

index 62d4f1ea5d70c08d7af4dd6f5ed337196db117d2..0bf5c1ff0c4d5f2a9a5b599083b307af2ccb1101 100644 (file)
@@ -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: